… | |
… | |
47 | |
47 | |
48 | #include <unistd.h> |
48 | #include <unistd.h> |
49 | |
49 | |
50 | /* Has to be after above includes so we don't redefine some values */ |
50 | /* Has to be after above includes so we don't redefine some values */ |
51 | #include "global.h" |
51 | #include "global.h" |
52 | |
|
|
53 | static unsigned int curtmp = 0; |
|
|
54 | |
52 | |
55 | /* This function removes everything in the directory. */ |
53 | /* This function removes everything in the directory. */ |
56 | void |
54 | void |
57 | remove_directory (const char *path) |
55 | remove_directory (const char *path) |
58 | { |
56 | { |
… | |
… | |
180 | char buf[MAX_BUF], *cp = buf; |
178 | char buf[MAX_BUF], *cp = buf; |
181 | struct stat statbuf; |
179 | struct stat statbuf; |
182 | |
180 | |
183 | if (!filename || !*filename) |
181 | if (!filename || !*filename) |
184 | return; |
182 | return; |
|
|
183 | |
185 | strcpy (buf, filename); |
184 | assign (buf, filename); |
186 | |
185 | |
187 | while ((cp = strchr (cp + 1, (int) '/'))) |
186 | while ((cp = strchr (cp + 1, (int) '/'))) |
188 | { |
187 | { |
189 | *cp = '\0'; |
188 | *cp = '\0'; |
190 | if (stat (buf, &statbuf) || !S_ISDIR (statbuf.st_mode)) |
189 | if (stat (buf, &statbuf) || !S_ISDIR (statbuf.st_mode)) |