]> Dogcows Code - chaz/tar/blobdiff - src/list.c
Provide tar(1) and rmt(8) manpages.
[chaz/tar] / src / list.c
index 8ba07cd95490182fbd2dfa3b469ff4f9b1e17e02..3a59f2993abbb6ef3c397641558f0cb458062268 100644 (file)
@@ -1,24 +1,24 @@
 /* List a tar archive, with support routines for reading a tar archive.
 
-   Copyright (C) 1988, 1992, 1993, 1994, 1996, 1997, 1998, 1999, 2000,
-   2001, 2003, 2004, 2005, 2006, 2007, 2010, 2012
+   Copyright 1988, 1992-1994, 1996-2001, 2003-2007, 2010, 2012-2013
    Free Software Foundation, Inc.
 
-   Written by John Gilmore, on 1985-08-26.
+   This file is part of GNU tar.
 
-   This program is free software; you can redistribute it and/or modify it
-   under the terms of the GNU General Public License as published by the
-   Free Software Foundation; either version 3, or (at your option) any later
-   version.
+   GNU tar is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
 
-   This program is distributed in the hope that it will be useful, but
-   WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
-   Public License for more details.
+   GNU tar is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
 
-   You should have received a copy of the GNU General Public License along
-   with this program; if not, write to the Free Software Foundation, Inc.,
-   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+   Written by John Gilmore, on 1985-08-26.  */
 
 #include <system.h>
 #include <inttostr.h>
@@ -723,7 +723,7 @@ from_header (char const *where0, size_t digs, char const *type,
                    type));
          return -1;
        }
-      if (!ISSPACE ((unsigned char) *where))
+      if (!isspace ((unsigned char) *where))
        break;
       where++;
     }
@@ -861,7 +861,7 @@ from_header (char const *where0, size_t digs, char const *type,
        value = -value;
     }
 
-  if (where != lim && *where && !ISSPACE ((unsigned char) *where))
+  if (where != lim && *where && !isspace ((unsigned char) *where))
     {
       if (type)
        {
@@ -1111,7 +1111,10 @@ simple_print_header (struct tar_stat_info *st, union block *blk,
   if (verbose_option <= 1)
     {
       /* Just the fax, mam.  */
-      fprintf (stdlis, "%s\n", quotearg (temp_name));
+      fputs (quotearg (temp_name), stdlis);
+      if (show_transformed_names_option && st->had_trailing_slash)
+       fputc ('/', stdlis);
+      fputc ('\n', stdlis);
     }
   else
     {
@@ -1138,9 +1141,7 @@ simple_print_header (struct tar_stat_info *st, union block *blk,
        case GNUTYPE_SPARSE:
        case REGTYPE:
        case AREGTYPE:
-         modes[0] = '-';
-         if (temp_name[strlen (temp_name) - 1] == '/')
-           modes[0] = 'd';
+         modes[0] = st->had_trailing_slash ? 'd' : '-';
          break;
        case LNKTYPE:
          modes[0] = 'h';
@@ -1251,6 +1252,8 @@ simple_print_header (struct tar_stat_info *st, union block *blk,
               datewidth, time_stamp);
 
       fprintf (stdlis, " %s", quotearg (temp_name));
+      if (show_transformed_names_option && st->had_trailing_slash)
+       fputc ('/', stdlis);
 
       switch (blk->header.typeflag)
        {
This page took 0.025782 seconds and 4 git commands to generate.