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

Diff for /src/usr.bin/cvs/diff_internals.c between version 1.23 and 1.24

version 1.23, 2008/06/10 05:01:36 version 1.24, 2008/06/11 02:19:13
Line 73 
Line 73 
 #include <stddef.h>  #include <stddef.h>
 #include <stdio.h>  #include <stdio.h>
 #include <string.h>  #include <string.h>
   #include <time.h>
 #include <unistd.h>  #include <unistd.h>
   
 #include "cvs.h"  #include "cvs.h"
Line 878 
Line 879 
 diff_head(void)  diff_head(void)
 {  {
         char buf[64];          char buf[64];
         struct tm *t;          struct tm t;
         time_t curr_time;          time_t curr_time;
   
         if (diff_rev1 != NULL) {          if (diff_rev1 != NULL) {
                 t = gmtime(&stb1.st_mtime);                  gmtime_r(&stb1.st_mtime, &t);
         } else {          } else {
                 time(&curr_time);                  time(&curr_time);
                 t = localtime(&curr_time);                  localtime_r(&curr_time, &t);
         }          }
   
         (void)strftime(buf, sizeof(buf), "%b %G %H:%M:%S -0000", t);          (void)strftime(buf, sizeof(buf), "%b %G %H:%M:%S -0000", &t);
         diff_output("%s %s      %d %s", diff_format == D_CONTEXT ?          diff_output("%s %s      %d %s", diff_format == D_CONTEXT ?
             "***" : "---", diff_file1, t->tm_mday, buf);              "***" : "---", diff_file1, t.tm_mday, buf);
   
         if (diff_rev1 != NULL) {          if (diff_rev1 != NULL) {
                 rcsnum_tostr(diff_rev1, buf, sizeof(buf));                  rcsnum_tostr(diff_rev1, buf, sizeof(buf));
Line 899 
Line 900 
   
         diff_output("\n");          diff_output("\n");
   
         t = gmtime(&stb2.st_mtime);          gmtime_r(&stb2.st_mtime, &t);
   
         (void)strftime(buf, sizeof(buf), "%b %G %H:%M:%S -0000", t);          (void)strftime(buf, sizeof(buf), "%b %G %H:%M:%S -0000", &t);
         diff_output("%s %s      %d %s", diff_format == D_CONTEXT ?          diff_output("%s %s      %d %s", diff_format == D_CONTEXT ?
             "---" : "+++", diff_file2, t->tm_mday, buf);              "---" : "+++", diff_file2, t.tm_mday, buf);
   
         if (diff_rev2 != NULL) {          if (diff_rev2 != NULL) {
                 rcsnum_tostr(diff_rev2, buf, sizeof(buf));                  rcsnum_tostr(diff_rev2, buf, sizeof(buf));
Line 917 
Line 918 
 rdiff_head(void)  rdiff_head(void)
 {  {
         char buf[64];          char buf[64];
         struct tm *t;          struct tm t;
         time_t curr_time;          time_t curr_time;
   
         if (diff_rev1 != NULL) {          if (diff_rev1 != NULL) {
                 t = localtime(&stb1.st_mtime);                  localtime_r(&stb1.st_mtime, &t);
         } else {          } else {
                 time(&curr_time);                  time(&curr_time);
                 t = localtime(&curr_time);                  localtime_r(&curr_time, &t);
         }          }
   
         diff_output("%s ", diff_format == D_CONTEXT ? "***" : "---");          diff_output("%s ", diff_format == D_CONTEXT ? "***" : "---");
   
         if (diff_rev1 == NULL) {          if (diff_rev1 == NULL) {
                 diff_output("%s", CVS_PATH_DEVNULL);                  diff_output("%s", CVS_PATH_DEVNULL);
                 t = gmtime(&stb1.st_atime);                  gmtime_r(&stb1.st_atime, &t);
         } else {          } else {
                 rcsnum_tostr(diff_rev1, buf, sizeof(buf));                  rcsnum_tostr(diff_rev1, buf, sizeof(buf));
                 diff_output("%s:%s", diff_file1, buf);                  diff_output("%s:%s", diff_file1, buf);
         }          }
   
         (void)strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %G", t);          (void)strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %G", &t);
         diff_output("\t%s\n", buf);          diff_output("\t%s\n", buf);
   
         if (diff_rev2 != NULL) {          if (diff_rev2 != NULL) {
                 t = localtime(&stb2.st_mtime);                  localtime_r(&stb2.st_mtime, &t);
         } else {          } else {
                 time(&curr_time);                  time(&curr_time);
                 t = localtime(&curr_time);                  localtime_r(&curr_time, &t);
         }          }
   
         (void)strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %G", t);          (void)strftime(buf, sizeof(buf), "%a %b %e %H:%M:%S %G", &t);
   
         diff_output("%s %s      %s\n", diff_format == D_CONTEXT ? "---" : "+++",          diff_output("%s %s      %s\n", diff_format == D_CONTEXT ? "---" : "+++",
             diff_file2, buf);              diff_file2, buf);

Legend:
Removed from v.1.23  
changed lines
  Added in v.1.24