diff options
author | Sascha Schumann <sas@php.net> | 2000-08-20 14:02:57 +0000 |
---|---|---|
committer | Sascha Schumann <sas@php.net> | 2000-08-20 14:02:57 +0000 |
commit | c8b8a908ca9bed4891798e94bb1a138df2257ae7 (patch) | |
tree | b906f5b12b2123f820e04c834a7aa1b0a59e2d3f /ext/session/mod_files.c | |
parent | ce0c4a799106187bcde96079ca5dfd70900b7528 (diff) | |
download | php-git-c8b8a908ca9bed4891798e94bb1a138df2257ae7.tar.gz |
Provide PHP_SEPARATOR which expands to the default directory separator
on the target platform.
Diffstat (limited to 'ext/session/mod_files.c')
-rw-r--r-- | ext/session/mod_files.c | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index cc8b7f9a66..3257186a03 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -55,12 +55,6 @@ ps_module ps_mod_files = { PS_MOD(files) }; -#ifdef PHP_WIN32 -#define DIR_DELIMITER '\\' -#else -#define DIR_DELIMITER '/' -#endif - static int _ps_files_valid_key(const char *key) { size_t len; @@ -98,10 +92,10 @@ static char *_ps_files_path_create(char *buf, size_t buflen, ps_files *data, con (strlen(data->basedir) + 2 * data->dirdepth + keylen + 5 + sizeof(FILE_PREFIX))) return NULL; p = key; - n = sprintf(buf, "%s%c", data->basedir, DIR_DELIMITER); + n = sprintf(buf, "%s%c", data->basedir, PHP_SEPARATOR); for (i = 0; i < data->dirdepth; i++) { buf[n++] = *p++; - buf[n++] = DIR_DELIMITER; + buf[n++] = PHP_SEPARATOR; } buf[n] = '\0'; strcat(buf, FILE_PREFIX); @@ -175,7 +169,7 @@ static int _ps_files_cleanup_dir(const char *dirname, int maxlifetime) /* does the file start with our prefix? */ if (!strncmp(entry->d_name, FILE_PREFIX, sizeof(FILE_PREFIX) - 1) && /* create full path */ - snprintf(buf, MAXPATHLEN, "%s%c%s", dirname, DIR_DELIMITER, + snprintf(buf, MAXPATHLEN, "%s%c%s", dirname, PHP_SEPARATOR, entry->d_name) > 0 && /* stat the directory entry */ V_STAT(buf, &sbuf) == 0 && |