# HG changeset patch # User Nathan Walp # Date 1069656620 0 # Node ID 072feee652442ebfbf28c74ee798a237740f46fd # Parent bfe3a796b2c2558efec7c5ded2a11e82600dd1ce [gaim-migrate @ 8246] this doesn't seem to break directory creation on *NIX, and I think it might fix it for win32, so here goes nothin' committer: Tailor Script diff -r bfe3a796b2c2 -r 072feee65244 src/util.c --- a/src/util.c Mon Nov 24 03:05:16 2003 +0000 +++ b/src/util.c Mon Nov 24 06:50:20 2003 +0000 @@ -1187,7 +1187,7 @@ return NULL; } -int gaim_build_dir (char *path, int mode) +int gaim_build_dir (const char *path, int mode) { struct stat st; char *dir, **components, delim[] = { G_DIR_SEPARATOR, '\0' }; @@ -1197,10 +1197,13 @@ return -1; dir = g_new0(char, strlen(path) + 1); - components = g_strsplit(path + 1, delim, -1); + components = g_strsplit(path, delim, -1); len = 0; for (cur = 0; components[cur] != NULL; cur++) { - dir[len++] = G_DIR_SEPARATOR; + if(*components[cur] == '\0') + continue; + if(cur != 0) + dir[len++] = G_DIR_SEPARATOR; strcpy(dir + len, components[cur]); len += strlen(components[cur]); if (stat(dir, &st) == 0) { diff -r bfe3a796b2c2 -r 072feee65244 src/util.h --- a/src/util.h Mon Nov 24 03:05:16 2003 +0000 +++ b/src/util.h Mon Nov 24 06:50:20 2003 +0000 @@ -254,15 +254,14 @@ /** * Builds a complete path from the root, making any directories along * the path which do not already exist. - * + * * @param path The path you wish to create. Note that it must start * from the root or this function will fail. - * * @param mode Unix-style permissions for this directory. - * + * * @return 0 for success, nonzero on any error. */ -int gaim_build_dir(char *path, int mode); +int gaim_build_dir(const char *path, int mode); /** * Creates a temporary file and returns a file pointer to it.