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

Diff for /src/usr.bin/cvs/cvs.c between version 1.136 and 1.137

version 1.136, 2007/09/19 12:48:41 version 1.137, 2007/09/19 13:36:32
Line 395 
Line 395 
 cvs_read_rcfile(void)  cvs_read_rcfile(void)
 {  {
         char rcpath[MAXPATHLEN], *buf, *lbuf, *lp, *p;          char rcpath[MAXPATHLEN], *buf, *lbuf, *lp, *p;
         int i, linenum;          int cmd_parsed, cvs_parsed, i, linenum;
         size_t len, pos;          size_t len, pos;
         struct cvs_cmd *cmdp;          struct cvs_cmd *cmdp, *tcmdp;
         FILE *fp;          FILE *fp;
   
         linenum = 0;          linenum = 0;
Line 416 
Line 416 
                 return;                  return;
         }          }
   
           cmdp = cvs_findcmd(cvs_command);
           if (cmdp == NULL)
                   fatal("unknown command `%s'", cvs_command);
   
           cmd_parsed = cvs_parsed = 0;
         lbuf = NULL;          lbuf = NULL;
         while ((buf = fgetln(fp, &len)) != NULL) {          while ((buf = fgetln(fp, &len)) != NULL) {
                 if (buf[len - 1] == '\n') {                  if (buf[len - 1] == '\n') {
Line 452 
Line 457 
                         *lp = '\0';                          *lp = '\0';
                 }                  }
   
                 if (strcmp(p, "cvs") == 0) {                  if (strcmp(p, "cvs") == 0 && !cvs_parsed) {
                         /*                          /*
                          * Global default options.  In the case of cvs only,                           * Global default options.  In the case of cvs only,
                          * we keep the 'cvs' string as first argument because                           * we keep the 'cvs' string as first argument because
Line 461 
Line 466 
                          */                           */
                         *lp = ' ';                          *lp = ' ';
                         cvs_defargs = xstrdup(p);                          cvs_defargs = xstrdup(p);
                           cvs_parsed = 1;
                 } else {                  } else {
                         lp++;                          lp++;
                         cmdp = cvs_findcmd(p);                          tcmdp = cvs_findcmd(p);
                         if (cmdp == NULL) {                          if (tcmdp == NULL && verbosity == 2)
                                 if (verbosity == 2)                                  cvs_log(LP_NOTICE,
                                         cvs_log(LP_NOTICE,                                      "unknown command `%s' in `%s:%d'",
                                             "unknown command `%s' in `%s:%d'",                                      p, rcpath, linenum);
                                             p, rcpath, linenum);  
                           if (tcmdp != cmdp || cmd_parsed)
                                 continue;                                  continue;
                         }  
   
                         cmdp->cmd_defargs = xstrdup(lp);                          cmdp->cmd_defargs = xstrdup(lp);
                           cmd_parsed = 1;
                 }                  }
         }          }
         if (lbuf != NULL)          if (lbuf != NULL)

Legend:
Removed from v.1.136  
changed lines
  Added in v.1.137