/[tar]/tar/src/tar.c
ViewVC logotype

Diff of /tar/src/tar.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.61 by gray, Mon Sep 1 17:02:45 2003 UTC revision 1.62 by eggert, Wed Sep 3 06:19:00 2003 UTC
# Line 113  confirm (const char *message_action, con Line 113  confirm (const char *message_action, con
113    }    }
114  }  }
115    
116  void  static void
117  set_archive_format (char *name)  set_archive_format (char const *name)
118  {  {
119    static struct fmttab {    static struct fmttab {
120      char *name;      char const *name;
121      enum archive_format fmt;      enum archive_format fmt;
122    } fmttab[] = {    } const fmttab[] = {
123      { "v7",      V7_FORMAT },      { "v7",      V7_FORMAT },
124      { "oldgnu",  OLDGNU_FORMAT },            { "oldgnu",  OLDGNU_FORMAT },      
125      { "posix",   POSIX_FORMAT },      { "posix",   POSIX_FORMAT },
# Line 127  set_archive_format (char *name) Line 127  set_archive_format (char *name)
127      { "star",    STAR_FORMAT },      { "star",    STAR_FORMAT },
128  #endif  #endif
129      { "gnu",     GNU_FORMAT },      { "gnu",     GNU_FORMAT },
130      NULL      { NULL,      0 }
131    };    };
132    struct fmttab *p;    struct fmttab const *p;
133    enum archive_format fmt;  
134        for (p = fmttab; strcmp (p->name, name) != 0; )
135    for (p = fmttab; p->name; p++)      if (! (++p)->name)
136      {        USAGE_ERROR ((0, 0, _("%s: Invalid archive format"),
137        if (strcmp (p->name, name) == 0)                      quotearg_colon (name)));
         {  
           fmt = p->fmt;  
           break;  
         }  
     }  
138    
139    if (archive_format != DEFAULT_FORMAT && archive_format != fmt)    if (archive_format != DEFAULT_FORMAT && archive_format != p->fmt)
140      USAGE_ERROR ((0, 0, _("Conflicting archive format options")));      USAGE_ERROR ((0, 0, _("Conflicting archive format options")));
141        
142    archive_format = fmt;    archive_format = p->fmt;
143  }  }
144    
145  /* Options.  */  /* Options.  */

Legend:
Removed from v.1.61  
changed lines
  Added in v.1.62

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26