src/mess/zippath.c
| r3143 | r3144 | |
| 67 | 67 | *endpos = pos; |
| 68 | 68 | |
| 69 | 69 | /* now skip until we find a path separator */ |
| 70 | | while((pos > 0) && !osd_is_path_separator(path[pos])) |
| 70 | while((pos >= 0) && !osd_is_path_separator(path[pos])) |
| 71 | 71 | pos--; |
| 72 | 72 | |
| 73 | 73 | /* return beginpos */ |
| r3143 | r3144 | |
| 87 | 87 | parse_parent_path(path, &pos, NULL); |
| 88 | 88 | |
| 89 | 89 | /* return the result */ |
| 90 | | return (pos > 0) ? astring_cpych(dst, path, pos + 1) : NULL; |
| 90 | return (pos >= 0) ? astring_cpych(dst, path, pos + 1) : NULL; |
| 91 | 91 | } |
| 92 | 92 | |
| 93 | 93 | |
| r3143 | r3144 | |
| 320 | 320 | { |
| 321 | 321 | /* trim the path of trailing path separators */ |
| 322 | 322 | i = astring_len(apath); |
| 323 | | while((i > 0) && osd_is_path_separator(astring_c(apath)[i - 1])) |
| 323 | while((i > 1) && osd_is_path_separator(astring_c(apath)[i - 1])) |
| 324 | 324 | i--; |
| 325 | 325 | apath_trimmed = astring_cpysubstr(apath_trimmed, apath, 0, i); |
| 326 | 326 | |