pidgin/win32/untar.c

branch
release-2.x.y
changeset 36177
68b8eb10977f
parent 36176
f38a5005e8a8
child 36183
c3cad56ac8b9
equal deleted inserted replaced
36176:f38a5005e8a8 36177:68b8eb10977f
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;

mercurial