| changeset 154 | 229fb0caa092 |
| parent 136 | eef2b734f2cc |
| child 186 | 7f45d0401e37 |
1.1 --- a/util.c Fri Feb 29 11:51:58 2008 -0500 1.2 +++ b/util.c Fri Mar 07 08:52:09 2008 -0500 1.3 @@ -21,8 +21,11 @@ 1.4 strcpy(buffer, root); 1.5 p = buffer + strlen(buffer); 1.6 slash = path; 1.7 - for (slash = path; slash[1] != '\0'; slash = next) { 1.8 + for (slash = path; *slash != '\0'; slash = next) { 1.9 next = strchr(slash + 1, '/'); 1.10 + if (next == NULL) 1.11 + next = slash + strlen(slash); 1.12 + 1.13 memcpy(p, slash, next - slash); 1.14 p += next - slash; 1.15 *p = '\0';