319 } |
319 } |
320 sstr_t wd = sstr(cwd); |
320 sstr_t wd = sstr(cwd); |
321 sstr_t pp = sstr(path); |
321 sstr_t pp = sstr(path); |
322 p.length = wd.length + pp.length + 1; |
322 p.length = wd.length + pp.length + 1; |
323 p.ptr = malloc(p.length + 1); |
323 p.ptr = malloc(p.length + 1); |
324 p = sstrncat(3, p, wd, sstrn("/", 1), pp); |
324 p = sstrncat(p, 3, wd, sstrn("/", 1), pp); |
325 p.ptr[p.length] = '\0'; |
325 p.ptr[p.length] = '\0'; |
326 } else { |
326 } else { |
327 p = sstrdup(sstr(path)); |
327 p = sstrdup(sstr(path)); |
328 } |
328 } |
329 if(p.ptr[p.length-1] == '/') { |
329 if(p.ptr[p.length-1] == '/') { |