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

Diff for /src/usr.bin/basename/basename.c between version 1.2 and 1.3

version 1.2, 1996/06/26 05:31:37 version 1.3, 1997/08/17 21:25:01
Line 61 
Line 61 
         char **argv;          char **argv;
 {  {
         char *p;          char *p;
         int ch;  
   
         setlocale(LC_ALL, "");          setlocale(LC_ALL, "");
   
         while ((ch = getopt(argc, argv, "")) != -1)          if (argc != 2 && argc != 3)
                 switch(ch) {  
                 case '?':  
                 default:  
                         usage();  
                 }  
         argc -= optind;  
         argv += optind;  
   
         if (argc != 1 && argc != 2)  
                 usage();                  usage();
           argc--;
           argv++;
   
         /*          /*
          * (1) If string is // it is implementation defined whether steps (2)           * (1) If string is // it is implementation defined whether steps (2)
Line 88 
Line 80 
         for (p = *argv;; ++p) {          for (p = *argv;; ++p) {
                 if (!*p) {                  if (!*p) {
                         if (p > *argv)                          if (p > *argv)
                                 (void)printf("/\n");                                  (void)putchar('/');
                         else                          (void)putchar('\n');
                                 (void)printf("\n");  
                         exit(0);                          exit(0);
                 }                  }
                 if (*p != '/')                  if (*p != '/')
Line 135 
Line 126 
                                 p[off] = '\0';                                  p[off] = '\0';
                 }                  }
         }          }
         (void)printf("%s\n", p);          (void)puts(p);
         exit(0);          exit(0);
 }  }
   

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