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

Diff for /src/usr.bin/cvs/log.c between version 1.25 and 1.26

version 1.25, 2005/08/05 16:21:41 version 1.26, 2005/09/19 15:45:16
Line 65 
Line 65 
         LOG_DEBUG,          LOG_DEBUG,
 };  };
   
   #if !defined(RCSPROG)
 static int send_m = 1;  static int send_m = 1;
   #endif
 static u_int cvs_log_dest = LD_STD;  static u_int cvs_log_dest = LD_STD;
 static u_int cvs_log_flags = 0;  static u_int cvs_log_flags = 0;
   
Line 205 
Line 207 
         int ecp;          int ecp;
         char prefix[64], buf[1024], ebuf[255];          char prefix[64], buf[1024], ebuf[255];
         FILE *out;          FILE *out;
   #if !defined(RCSPROG)
         struct cvs_cmd *cmdp;          struct cvs_cmd *cmdp;
   #endif
   
         if (level > LP_MAX)          if (level > LP_MAX)
                 return (-1);                  return (-1);
Line 220 
Line 224 
                 ecp = 0;                  ecp = 0;
   
         /* always use the command name in error messages, not aliases */          /* always use the command name in error messages, not aliases */
   #if !defined(RCSPROG)
         cmdp = cvs_findcmd(cvs_command);          cmdp = cvs_findcmd(cvs_command);
   
         /* The cvs program appends the command name to the program name */          /* The cvs program appends the command name to the program name */
Line 235 
Line 240 
                         snprintf(prefix, sizeof(prefix), "%s %s", __progname,                          snprintf(prefix, sizeof(prefix), "%s %s", __progname,
                             cmdp->cmd_name);                              cmdp->cmd_name);
         } else /* just use the standard strlcpy */          } else /* just use the standard strlcpy */
   #endif
                 strlcpy(prefix, __progname, sizeof(prefix));                  strlcpy(prefix, __progname, sizeof(prefix));
   
         if ((cvs_log_flags & LF_PID) && (level != LP_TRACE)) {          if ((cvs_log_flags & LF_PID) && (level != LP_TRACE)) {
Line 254 
Line 260 
                 else                  else
                         out = stderr;                          out = stderr;
   
   #if !defined(RCSPROG)
                 if (cvs_cmdop == CVS_OP_SERVER) {                  if (cvs_cmdop == CVS_OP_SERVER) {
                         if (out == stdout)                          if (out == stdout)
                                 putc('M', out);                                  putc('M', out);
Line 263 
Line 270 
                         }                          }
                         putc(' ', out);                          putc(' ', out);
                 }                  }
   #endif
   
                 fputs(prefix, out);                  fputs(prefix, out);
                 if (level != LP_TRACE)                  if (level != LP_TRACE)
Line 292 
Line 300 
 cvs_printf(const char *fmt, ...)  cvs_printf(const char *fmt, ...)
 {  {
         int ret;          int ret;
   #if !defined(RCSPROG)
         char *nstr, *dp, *sp;          char *nstr, *dp, *sp;
   #endif
         va_list vap;          va_list vap;
   
         va_start(vap, fmt);          va_start(vap, fmt);
   
   #if !defined(RCSPROG)
         if (cvs_cmdop == CVS_OP_SERVER) {          if (cvs_cmdop == CVS_OP_SERVER) {
                 ret = vasprintf(&nstr, fmt, vap);                  ret = vasprintf(&nstr, fmt, vap);
                 if (ret != -1) {                  if (ret != -1) {
Line 325 
Line 336 
                         free(nstr);                          free(nstr);
                 }                  }
         } else          } else
   #endif
                 ret = vprintf(fmt, vap);                  ret = vprintf(fmt, vap);
   
         va_end(vap);          va_end(vap);
Line 333 
Line 345 
 void  void
 cvs_putchar(int c)  cvs_putchar(int c)
 {  {
   #if !defined(RCSPROG)
         if (cvs_cmdop == CVS_OP_SERVER && send_m) {          if (cvs_cmdop == CVS_OP_SERVER && send_m) {
                 send_m = 0;                  send_m = 0;
                 putc('M', stdout);                  putc('M', stdout);
                 putc(' ', stdout);                  putc(' ', stdout);
         }          }
   #endif
   
         putc(c, stdout);          putc(c, stdout);
   
   #if !defined(RCSPROG)
         if (cvs_cmdop == CVS_OP_SERVER && c == '\n')          if (cvs_cmdop == CVS_OP_SERVER && c == '\n')
                 send_m = 1;                  send_m = 1;
   #endif
 }  }

Legend:
Removed from v.1.25  
changed lines
  Added in v.1.26