[BACK]Return to xargs.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / xargs

Diff for /src/usr.bin/xargs/xargs.c between version 1.1 and 1.2

version 1.1, 1995/10/18 08:47:00 version 1.2, 1996/06/11 06:48:06
Line 62 
Line 62 
 #include "pathnames.h"  #include "pathnames.h"
   
 int tflag, rval;  int tflag, rval;
   int zflag;
   
 void run __P((char **));  void run __P((char **));
 void usage __P((void));  void usage __P((void));
Line 94 
Line 95 
         nargs = 5000;          nargs = 5000;
         nline = ARG_MAX - 4 * 1024;          nline = ARG_MAX - 4 * 1024;
         nflag = xflag = 0;          nflag = xflag = 0;
         while ((ch = getopt(argc, argv, "n:s:tx")) != EOF)          while ((ch = getopt(argc, argv, "0n:s:tx")) != EOF)
                 switch(ch) {                  switch(ch) {
                 case 'n':                  case 'n':
                         nflag = 1;                          nflag = 1;
Line 110 
Line 111 
                 case 'x':                  case 'x':
                         xflag = 1;                          xflag = 1;
                         break;                          break;
                   case '0':
                           zflag = 1;
                           break;
                 case '?':                  case '?':
                 default:                  default:
                         usage();                          usage();
Line 183 
Line 187 
                 case ' ':                  case ' ':
                 case '\t':                  case '\t':
                         /* Quotes escape tabs and spaces. */                          /* Quotes escape tabs and spaces. */
                         if (insingle || indouble)                          if (insingle || indouble || zflag)
                                 goto addch;                                  goto addch;
                         goto arg2;                          goto arg2;
                   case '\0':
                           if (zflag)
                                   goto arg2;
                           goto addch;
                 case '\n':                  case '\n':
                           if (zflag)
                                   goto addch;
   
                         /* Empty lines are skipped. */                          /* Empty lines are skipped. */
                         if (argp == p)                          if (argp == p)
                                 continue;                                  continue;
Line 217 
Line 228 
                         argp = p;                          argp = p;
                         break;                          break;
                 case '\'':                  case '\'':
                         if (indouble)                          if (indouble || zflag)
                                 goto addch;                                  goto addch;
                         insingle = !insingle;                          insingle = !insingle;
                         break;                          break;
                 case '"':                  case '"':
                         if (insingle)                          if (insingle || zflag)
                                 goto addch;                                  goto addch;
                         indouble = !indouble;                          indouble = !indouble;
                         break;                          break;
                 case '\\':                  case '\\':
                           if (zflag)
                                   goto addch;
                         /* Backslash escapes anything, is escaped by quotes. */                          /* Backslash escapes anything, is escaped by quotes. */
                         if (!insingle && !indouble && (ch = getchar()) == EOF)                          if (!insingle && !indouble && (ch = getchar()) == EOF)
                                 errx(1, "backslash at EOF");                                  errx(1, "backslash at EOF");
Line 316 
Line 329 
 usage()  usage()
 {  {
         (void)fprintf(stderr,          (void)fprintf(stderr,
 "usage: xargs [-t] [-n number [-x]] [-s size] [utility [argument ...]]\n");  "usage: xargs [-0] [-t] [-n number [-x]] [-s size] [utility [argument ...]]\n");
         exit(1);          exit(1);
 }  }

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2