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

Diff for /src/usr.bin/rcs/rcs.c between version 1.30 and 1.31

version 1.30, 2006/08/04 06:13:54 version 1.31, 2006/08/07 20:55:28
Line 2664 
Line 2664 
                         expbuf[0] = '\0';                          expbuf[0] = '\0';
   
                         if (mode & RCS_KWEXP_NAME) {                          if (mode & RCS_KWEXP_NAME) {
                                 if (strlcat(expbuf, "$", sizeof(expbuf)) >= sizeof(expbuf) ||                                  char *tmp;
                                     strlcat(expbuf, kwstr, sizeof(expbuf)) >= sizeof(expbuf))  
                                   (void)xasprintf(&tmp, "$%s%s", kwstr,
                                       (mode & RCS_KWEXP_VAL) ? ": " : "");
                                   if (strlcat(expbuf, tmp, sizeof(expbuf)) >= sizeof(expbuf))
                                         errx(1, "rcs_expand_keywords: string truncated");                                          errx(1, "rcs_expand_keywords: string truncated");
                                 if ((mode & RCS_KWEXP_VAL) &&                                  xfree(tmp);
                                     strlcat(expbuf, ": ", sizeof(expbuf)) >= sizeof(expbuf))  
                                         errx(1, "rcs_expand_keywords: string truncated");  
                         }                          }
   
                         /*                          /*
Line 2678 
Line 2679 
                          */                           */
                         if (mode & RCS_KWEXP_VAL) {                          if (mode & RCS_KWEXP_VAL) {
                                 if (kwtype & RCS_KW_RCSFILE) {                                  if (kwtype & RCS_KW_RCSFILE) {
                                         if (!(kwtype & RCS_KW_FULLPATH))                                          char *tmp;
                                                 (void)strlcat(expbuf, basename(rcsfile), sizeof(expbuf));  
                                         else                                          (void)xasprintf(&tmp, "%s ",
                                                 (void)strlcat(expbuf, rcsfile, sizeof(expbuf));                                              (kwtype & RCS_KW_FULLPATH) ? rcsfile : basename(rcsfile));
                                         if (strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf))                                          if (strlcat(expbuf, tmp, sizeof(expbuf)) >= sizeof(expbuf))
                                                 errx(1, "rcs_expand_keywords: string truncated");                                                  errx(1, "rcs_expand_keywords: string truncated");
                                           xfree(tmp);
                                 }                                  }
   
                                 if (kwtype & RCS_KW_REVISION) {                                  if (kwtype & RCS_KW_REVISION) {
                                           char *tmp;
   
                                         rcsnum_tostr(rdp->rd_num, buf, sizeof(buf));                                          rcsnum_tostr(rdp->rd_num, buf, sizeof(buf));
                                         if (strlcat(buf, " ", sizeof(buf)) >= sizeof(buf) ||                                          (void)xasprintf(&tmp, "%s ", buf);
                                             strlcat(expbuf, buf, sizeof(expbuf)) >= sizeof(buf))                                          if (strlcat(expbuf, tmp, sizeof(expbuf)) >= sizeof(buf))
                                                 errx(1, "rcs_expand_keywords: string truncated");                                                  errx(1, "rcs_expand_keywords: string truncated");
                                           xfree(tmp);
                                 }                                  }
   
                                 if (kwtype & RCS_KW_DATE) {                                  if (kwtype & RCS_KW_DATE) {
Line 2705 
Line 2710 
                                 }                                  }
   
                                 if (kwtype & RCS_KW_AUTHOR) {                                  if (kwtype & RCS_KW_AUTHOR) {
                                         if (strlcat(expbuf, rdp->rd_author, sizeof(expbuf)) >= sizeof(expbuf) ||                                          char *tmp;
                                             strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf))  
                                           (void)xasprintf(&tmp, "%s ", rdp->rd_author);
                                           if (strlcat(expbuf, tmp, sizeof(expbuf)) >= sizeof(expbuf))
                                                 errx(1, "rcs_expand_keywords: string truncated");                                                  errx(1, "rcs_expand_keywords: string truncated");
                                           xfree(tmp);
                                 }                                  }
   
                                 if (kwtype & RCS_KW_STATE) {                                  if (kwtype & RCS_KW_STATE) {
                                         if (strlcat(expbuf, rdp->rd_state, sizeof(expbuf)) >= sizeof(expbuf) ||                                          char *tmp;
                                             strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf))  
                                           (void)xasprintf(&tmp, "%s ", rdp->rd_state);
                                           if (strlcat(expbuf, tmp, sizeof(expbuf)) >= sizeof(expbuf))
                                                 errx(1, "rcs_expand_keywords: string truncated");                                                  errx(1, "rcs_expand_keywords: string truncated");
                                           xfree(tmp);
                                 }                                  }
   
                                 /* order does not matter anymore below */                                  /* order does not matter anymore below */
Line 2722 
Line 2733 
                                                 errx(1, "rcs_expand_keywords: string truncated");                                                  errx(1, "rcs_expand_keywords: string truncated");
   
                                 if (kwtype & RCS_KW_SOURCE) {                                  if (kwtype & RCS_KW_SOURCE) {
                                         if (strlcat(expbuf, rcsfile, sizeof(expbuf)) >= sizeof(expbuf) ||                                          char *tmp;
                                             strlcat(expbuf, " ", sizeof(expbuf)) >= sizeof(expbuf))  
                                           (void)xasprintf(&tmp, "%s ", rcsfile);
                                           if (strlcat(expbuf, tmp, sizeof(expbuf)) >= sizeof(expbuf))
                                                 errx(1, "rcs_expand_keywords: string truncated");                                                  errx(1, "rcs_expand_keywords: string truncated");
                                           xfree(tmp);
                                 }                                  }
   
                                 if (kwtype & RCS_KW_NAME)                                  if (kwtype & RCS_KW_NAME)

Legend:
Removed from v.1.30  
changed lines
  Added in v.1.31