]> Dogcows Code - chaz/tar/commitdiff
*** empty log message ***
authorFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:42:52 +0000 (02:42 +0000)
committerFrançois Pinard <pinard@iro.umontreal.ca>
Wed, 16 Nov 1994 02:42:52 +0000 (02:42 +0000)
src/create.c

index b03c2f227c694df8990bf5cd7545f4eab3840bc7..75c4a9521e881fb48cbe4b5c0a84aa18c73224f7 100644 (file)
@@ -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);
This page took 0.02365 seconds and 4 git commands to generate.