]> Dogcows Code - chaz/tar/blobdiff - src/names.c
New option --format=ustar forces POSIX.1-1988 archive format.
[chaz/tar] / src / names.c
index a8a03bb6434df6945826a78aab8474eab1f828a3..66648a08810460579849f18d80331b233edca67a 100644 (file)
@@ -20,9 +20,7 @@
 #include "system.h"
 
 #include <fnmatch.h>
-#include <grp.h>
 #include <hash.h>
-#include <pwd.h>
 #include <quotearg.h>
 
 #include "common.h"
@@ -610,9 +608,11 @@ bool
 all_names_found (struct tar_stat_info *p)
 {
   struct name const *cursor;
-  size_t len = strlen (p->file_name);
-  if (occurrence_option == 0 || p->had_trailing_slash)
+  size_t len;
+
+  if (!p->file_name || occurrence_option == 0 || p->had_trailing_slash)
     return false;
+  len = strlen (p->file_name);
   for (cursor = namelist; cursor; cursor = cursor->next)
     {
       if (cursor->regexp
@@ -636,7 +636,7 @@ names_notfound (void)
          ERROR ((0, 0, _("%s: Not found in archive"),
                  quotearg_colon (cursor->name)));
        else
-         ERROR ((0, 0, _("%s: Required occurence not found in archive"),
+         ERROR ((0, 0, _("%s: Required occurrence not found in archive"),
                  quotearg_colon (cursor->name)));
       }
   
@@ -1026,7 +1026,9 @@ safer_name_suffix (char const *file_name, bool link_target)
        {
          if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
            prefix_len = p + 2 - file_name;
-
+         else if (p[0] == '.' && ISSLASH (p[1]))
+           prefix_len = p + 1 - file_name;
+         
          do
            {
              char c = *p++;
This page took 0.021418 seconds and 4 git commands to generate.