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

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

version 1.2, 2010/10/20 06:51:26 version 1.3, 2010/10/20 19:53:53
Line 78 
Line 78 
         size_t                   rp_tlen;          size_t                   rp_tlen;
   
         struct rcs_delta        *rp_delta;          struct rcs_delta        *rp_delta;
         FILE                    *rp_file;  
         int                      rp_lineno;          int                      rp_lineno;
         int                      rp_msglineno;          int                      rp_msglineno;
         int                      rp_token;          int                      rp_token;
Line 230 
Line 229 
         pdp->rp_token = -1;          pdp->rp_token = -1;
         pdp->rp_lineno = 1;          pdp->rp_lineno = 1;
         pdp->rp_msglineno = 1;          pdp->rp_msglineno = 1;
         if ((pdp->rp_file = fdopen(rfp->rf_fd, "r")) == NULL) {  
                 xfree(pdp);  
                 return (1);  
         }  
         /* ditch the strict lock */          /* ditch the strict lock */
         rfp->rf_flags &= ~RCS_SLOCK;          rfp->rf_flags &= ~RCS_SLOCK;
         rfp->rf_pdata = pdp;          rfp->rf_pdata = pdp;
Line 343 
Line 339 
   
         pdp = rfp->rf_pdata;          pdp = rfp->rf_pdata;
   
         if (pdp->rp_file != NULL)  
                 (void)fclose(pdp->rp_file);  
         if (pdp->rp_buf != NULL)          if (pdp->rp_buf != NULL)
                 xfree(pdp->rp_buf);                  xfree(pdp->rp_buf);
         if (pdp->rp_token == RCS_TYPE_REVISION)          if (pdp->rp_token == RCS_TYPE_REVISION)
Line 850 
Line 844 
         *bp = '\0';          *bp = '\0';
   
         for (;;) {          for (;;) {
                 c = getc(pdp->rp_file);                  c = getc(rfp->rf_file);
                 if (c == '@') {                  if (c == '@') {
                         c = getc(pdp->rp_file);                          c = getc(rfp->rf_file);
                         if (c == EOF) {                          if (c == EOF) {
                                 return (EOF);                                  return (EOF);
                         } else if (c != '@') {                          } else if (c != '@') {
                                 ungetc(c, pdp->rp_file);                                  ungetc(c, rfp->rf_file);
                                 break;                                  break;
                         }                          }
                 }                  }
Line 905 
Line 899 
         c = EOF;          c = EOF;
         do {          do {
                 pre = c;                  pre = c;
                 c = getc(pdp->rp_file);                  c = getc(rfp->rf_file);
                 if (c == EOF) {                  if (c == EOF) {
                         if (ferror(pdp->rp_file)) {                          if (ferror(rfp->rf_file)) {
                                 rcsparse_warnx(rfp, "error during parsing");                                  rcsparse_warnx(rfp, "error during parsing");
                                 return (0);                                  return (0);
                         }                          }
Line 924 
Line 918 
         switch (c) {          switch (c) {
         case '@':          case '@':
                 ret = rcsparse_string(rfp, allowed);                  ret = rcsparse_string(rfp, allowed);
                 if (ret == EOF && ferror(pdp->rp_file)) {                  if (ret == EOF && ferror(rfp->rf_file)) {
                         rcsparse_warnx(rfp, "error during parsing");                          rcsparse_warnx(rfp, "error during parsing");
                         return (0);                          return (0);
                 }                  }
Line 966 
Line 960 
   
         for (;;) {          for (;;) {
                 if (c == EOF) {                  if (c == EOF) {
                         if (ferror(pdp->rp_file))                          if (ferror(rfp->rf_file))
                                 rcsparse_warnx(rfp, "error during parsing");                                  rcsparse_warnx(rfp, "error during parsing");
                         else                          else
                                 rcsparse_warnx(rfp, "unexpected end of file");                                  rcsparse_warnx(rfp, "unexpected end of file");
Line 976 
Line 970 
   
                 RBUF_PUTC(c);                  RBUF_PUTC(c);
   
                 c = getc(pdp->rp_file);                  c = getc(rfp->rf_file);
   
                 if (isspace(c)) {                  if (isspace(c)) {
                         if (c == '\n')                          if (c == '\n')
Line 984 
Line 978 
                         RBUF_PUTC('\0');                          RBUF_PUTC('\0');
                         break;                          break;
                 } else if (c == ';' || c == ':' || c == ',') {                  } else if (c == ';' || c == ':' || c == ',') {
                         ungetc(c, pdp->rp_file);                          ungetc(c, rfp->rf_file);
                         RBUF_PUTC('\0');                          RBUF_PUTC('\0');
                         break;                          break;
                 } else if (!isgraph(c)) {                  } else if (!isgraph(c)) {

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