From: François Pinard Date: Wed, 16 Nov 1994 02:42:52 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=1ed2a7f45aa9e60bbd739aa827f3aafce4f34bda;p=chaz%2Ftar *** empty log message *** --- diff --git a/src/create.c b/src/create.c index b03c2f2..75c4a95 100644 --- a/src/create.c +++ b/src/create.c @@ -299,13 +299,6 @@ badfile: char *link_name = lp->name; /* We found a link. */ - hstat.st_size = 0; - header = start_header(p, &hstat); - if (header == NULL) - { - critical_error = 1; - goto badfile; - } while(!f_absolute_paths && *link_name == '/') { static int link_warn = 0; @@ -315,6 +308,16 @@ badfile: } link_name++; } + if (link_name - lp->name >= NAMSIZ) + write_longlink (link_name); + + hstat.st_size = 0; + header = start_header(p, &hstat); + if (header == NULL) + { + critical_error = 1; + goto badfile; + } strncpy(header->header.linkname, link_name,NAMSIZ); if(header->header.linkname[NAMSIZ-1]) { @@ -1340,3 +1343,14 @@ write_eot() userec(p); } } + +/* Write a LF_LONGLINK or LF_LONGNAME record. */ +void +write_long (p) +{ + /* Link name won't fit, so we write + an LF_LONGLINK record. */ + hstat.st_size = strlen (link_name) + 1; + header = start_header ("././@LongLink", &hstat); + header->header.linkflag = LF_NAMES; + finish_header (header);