lib: changed boinc_copy() to enclose path strings in quotes instead of escaping spaces

svn path=/trunk/boinc/; revision=15894
This commit is contained in:
Charlie Fenton 2008-08-19 22:36:14 +00:00
parent 00ee66965f
commit c2c5d04c31
2 changed files with 10 additions and 5 deletions

View File

@ -6819,3 +6819,10 @@ David 19 Aug 2008
lib/
filesys.C
str_util.C,h
Charlie 19 Aug 2008
- lib: changed boinc_copy() to enclose path strings in quotes instead
of escaping spaces.
lib/
filesys.C

View File

@ -492,14 +492,12 @@ int boinc_copy(const char* orig, const char* newf) {
}
return 0;
#elif defined(__EMX__)
char cmd[1024], cmd_esc[1024];
sprintf(cmd, "copy %s %s", orig, newf);
string_substitute(cmd, cmd_esc, sizeof(cmd_esc), " ", "\\ ");
char cmd[1024];
sprintf(cmd, "copy \"%s\" \"%s\"", orig, newf);
return system(cmd_esc);
#else
char cmd[1024], cmd_esc[1024];
sprintf(cmd, "cp %s %s", orig, newf);
string_substitute(cmd, cmd_esc, sizeof(cmd_esc), " ", "\\ ");
sprintf(cmd, "cp \"%s\" \"%s\"", orig, newf);
return system(cmd_esc);
#endif
}