diff options
author | Max Horn | 2009-02-21 18:39:53 +0000 |
---|---|---|
committer | Max Horn | 2009-02-21 18:39:53 +0000 |
commit | 9f2c0dcc6f5c278fa06be8d0fdfaf69c27b40282 (patch) | |
tree | de775932246061d6548a790d9f2cb5bc6fd46dd9 /engines/sci/tools.cpp | |
parent | 0d41ca8d38ce6c604a2a7c9c763b9bf92dd5a9c9 (diff) | |
download | scummvm-rg350-9f2c0dcc6f5c278fa06be8d0fdfaf69c27b40282.tar.gz scummvm-rg350-9f2c0dcc6f5c278fa06be8d0fdfaf69c27b40282.tar.bz2 scummvm-rg350-9f2c0dcc6f5c278fa06be8d0fdfaf69c27b40282.zip |
SCI: Tons of cleanup
svn-id: r38721
Diffstat (limited to 'engines/sci/tools.cpp')
-rw-r--r-- | engines/sci/tools.cpp | 36 |
1 files changed, 1 insertions, 35 deletions
diff --git a/engines/sci/tools.cpp b/engines/sci/tools.cpp index b1d0829bd6..95b5dd1275 100644 --- a/engines/sci/tools.cpp +++ b/engines/sci/tools.cpp @@ -37,6 +37,7 @@ #ifdef UNIX #include <fnmatch.h> +#include <sys/stat.h> #endif #include "common/archive.h" @@ -315,41 +316,6 @@ void sci_finish_find(sci_dir_t *dir) { #endif -int sci_mkpath(const char *path) { - const char *path_position = path; - char *next_separator = NULL; - - if (chdir(G_DIR_SEPARATOR_S)) { // Go to root - sciprintf("Error: Could not change to root directory '%s'", G_DIR_SEPARATOR_S); - return -1; - } - - do { - if (next_separator) - *next_separator = G_DIR_SEPARATOR_S[0]; - next_separator = (char *)strchr(path_position, G_DIR_SEPARATOR_S[0]); - - if (next_separator) - *next_separator = 0; - - if (*path_position) { // Unless we're at the first slash... - if (chdir(path_position)) { - if (scimkdir(path_position, 0700) || chdir(path_position)) { - sciprintf("Error: Could not create subdirectory '%s' in", path_position); - if (next_separator) - *next_separator = G_DIR_SEPARATOR_S[0]; - sciprintf(" '%s'!\n", path); - return -2; - } - } - } - path_position = next_separator + 1; - - } while (next_separator); - - return 0; -} - /* Returns the case-sensitive filename of a file. ** Expects *dir to be uninitialized and the caller to free it afterwards. |