Skip to content

Commit

Permalink
Use "getcwd" for relative path
Browse files Browse the repository at this point in the history
  • Loading branch information
neurolabusc committed Apr 22, 2016
1 parent 31c59d8 commit 3b05390
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion console/nii_dicom_batch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,12 @@ void dropFilenameFromPath(char *path) { //
strcpy(path,"");
} else
path[dirPath - path] = 0; // please make sure there is enough space in TargetDirectory
if (strlen(path) == 0) strcat (path,"."); //relative path - use cwd
if (strlen(path) == 0) { //file name did not specify path, assume relative path and return current working directory
//strcat (path,"."); //relative path - use cwd <- not sure if this works on Windows!
char cwd[1024];
getcwd(cwd, sizeof(cwd));
strcat (path,cwd);
}
}


Expand Down

0 comments on commit 3b05390

Please sign in to comment.