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

Diff for /src/usr.bin/rcs/rcsnum.c between version 1.8 and 1.9

version 1.8, 2007/12/09 14:02:56 version 1.9, 2008/01/22 08:31:18
Line 214 
Line 214 
 {  {
         u_int32_t val;          u_int32_t val;
         const char *sp;          const char *sp;
         char *s;  
   
         if (nump->rn_id == NULL)          if (nump->rn_id == NULL)
                 nump->rn_id = xmalloc(sizeof(*(nump->rn_id)));                  nump->rn_id = xmalloc(sizeof(*(nump->rn_id)));
Line 262 
Line 261 
          * about this, cvs does this for "efficiency reasons", i'd like           * about this, cvs does this for "efficiency reasons", i'd like
          * to hear one.           * to hear one.
          *           *
          * We just make sure we remove the .0. from in the branch number.  
          *  
          * XXX - for compatibility reasons with GNU cvs we _need_           * XXX - for compatibility reasons with GNU cvs we _need_
          * to skip this part for the 'log' command, apparently it does           * to add these magic branch numbers.
          * show the magic branches for an unknown and probably  
          * completely insane and not understandable reason in that output.  
          *  
          */           */
         if (nump->rn_len > 2 && nump->rn_id[nump->rn_len - 1] == 0          if (nump->rn_len > 1 && !(nump->rn_len % 2)) {
             && !(rcsnum_flags & RCSNUM_NO_MAGIC)) {                  nump->rn_len++;
                 /*                  nump->rn_id = xrealloc(nump->rn_id, nump->rn_len + 1,
                  * Look for ".0.x" at the end of the branch number.                      sizeof(*(nump->rn_id)));
                  */                  nump->rn_id[nump->rn_len] = nump->rn_id[nump->rn_len - 1];
                 if ((s = strrchr(str, '.')) != NULL) {                  nump->rn_id[nump->rn_len - 1] = 0;
                         s--;  
                         while (*s != '.')  
                                 s--;  
   
                         /*  
                          * If we have a "magic" branch, adjust it  
                          * so the .0. is removed.  
                          */  
                         if (!strncmp(s, RCS_MAGIC_BRANCH,  
                             strlen(RCS_MAGIC_BRANCH))) {  
                                 nump->rn_id[nump->rn_len - 1] =  
                                     nump->rn_id[nump->rn_len];  
                                 nump->rn_len--;  
                         }  
                 }  
         }          }
   
         /* We can't have a single-digit rcs number. */          /* We can't have a single-digit rcs number. */

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9