| 399 { |
399 { |
| 400 g_strlcpy(nbuf, (tblk)->filename, |
400 g_strlcpy(nbuf, (tblk)->filename, |
| 401 sizeof (nbuf)); |
401 sizeof (nbuf)); |
| 402 } |
402 } |
| 403 |
403 |
| |
404 /* Possibly strip the drive from the path */ |
| |
405 if (!ABSPATH) { |
| |
406 /* If the path contains a colon, assume everything before the |
| |
407 * colon is intended to be a drive name and ignore it. This |
| |
408 * should be just a single drive letter, but it should be safe |
| |
409 * to drop it even if it's longer. */ |
| |
410 const char *lastcolon = strrchr(nbuf, ':'); |
| |
411 if (lastcolon) { |
| |
412 memmove(nbuf, lastcolon, strlen(lastcolon) + 1); |
| |
413 didabs = 1; /* Path was changed from absolute to relative */ |
| |
414 } |
| |
415 } |
| |
416 |
| 404 /* Convert any backslashes to forward slashes, and guard |
417 /* Convert any backslashes to forward slashes, and guard |
| 405 * against doubled-up slashes. (Some DOS versions of "tar" |
418 * against doubled-up slashes. (Some DOS versions of "tar" |
| 406 * get this wrong.) Also strip off leading slashes. |
419 * get this wrong.) Also strip off leading slashes. |
| 407 */ |
420 */ |
| 408 name = nbuf; |
421 name = nbuf; |