Skip to content

Commit

Permalink
Prevent shell expansion (#789)
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Feb 14, 2024
1 parent 464cbeb commit 51cf5cd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3748,6 +3748,11 @@ int nii_createFilename(struct TDICOMdata dcm, char *niiFilename, struct TDCMopts
for (size_t pos = 0; pos < strlen(outname); pos++)
if (outname[pos] == ':') //not allowed by MacOS
outname[pos] = '_';
#endif
#if !defined(_WIN64) || !defined(_WIN32)
for (size_t pos = 0; pos < strlen(outname); pos++)
if (outname[pos] == '`' || outname[pos] == '$') // unix shell expansion characters
outname[pos] = '_';
#endif
cleanISO8859(outname);
//re-insert explicit path separators: -f %t/%s_%p will have folder for time, but will not segment a protocol named "fMRI\bold"
Expand Down

0 comments on commit 51cf5cd

Please sign in to comment.