=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/cvs/edit.c,v retrieving revision 1.19 retrieving revision 1.20 diff -c -r1.19 -r1.20 *** src/usr.bin/cvs/edit.c 2007/01/05 08:52:37 1.19 --- src/usr.bin/cvs/edit.c 2007/01/05 09:15:00 1.20 *************** *** 1,4 **** ! /* $OpenBSD: edit.c,v 1.19 2007/01/05 08:52:37 xsa Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria * --- 1,4 ---- ! /* $OpenBSD: edit.c,v 1.20 2007/01/05 09:15:00 xsa Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria * *************** *** 244,250 **** FILE *fp; struct tm *t; time_t now; ! char *bfpath, *fdate, thishost[MAXHOSTNAMELEN]; if (cvs_noexec == 1) return; --- 244,250 ---- FILE *fp; struct tm *t; time_t now; ! char *bfpath, timebuf[64], thishost[MAXHOSTNAMELEN]; if (cvs_noexec == 1) return; *************** *** 257,269 **** if ((t = gmtime(&now)) == NULL) fatal("gmtime failed"); ! fdate = asctime(t); if (gethostname(thishost, sizeof(thishost)) == -1) fatal("gethostname failed"); (void)fprintf(fp, "E%s\t%s GMT\t%s\t%s\t\n", ! cf->file_name, fdate, thishost, cf->file_wd); if (edit_aflags & E_EDIT) (void)fprintf(fp, "E"); --- 257,271 ---- if ((t = gmtime(&now)) == NULL) fatal("gmtime failed"); ! asctime_r(t, timebuf); ! if (timebuf[strlen(timebuf) - 1] == '\n') ! timebuf[strlen(timebuf) - 1] = '\0'; if (gethostname(thishost, sizeof(thishost)) == -1) fatal("gethostname failed"); (void)fprintf(fp, "E%s\t%s GMT\t%s\t%s\t\n", ! cf->file_name, timebuf, thishost, cf->file_wd); if (edit_aflags & E_EDIT) (void)fprintf(fp, "E"); *************** *** 303,309 **** struct stat st; struct tm *t; time_t now; ! char *bfpath, *fdate, thishost[MAXHOSTNAMELEN]; if (cvs_noexec == 1) return; --- 305,311 ---- struct stat st; struct tm *t; time_t now; ! char *bfpath, timebuf[64], thishost[MAXHOSTNAMELEN]; if (cvs_noexec == 1) return; *************** *** 339,351 **** if ((t = gmtime(&now)) == NULL) fatal("gmtime failed"); ! fdate = asctime(t); if (gethostname(thishost, sizeof(thishost)) == -1) fatal("gethostname failed"); (void)fprintf(fp, "U%s\t%s GMT\t%s\t%s\t\n", ! cf->file_name, fdate, thishost, cf->file_wd); (void)fclose(fp); --- 341,355 ---- if ((t = gmtime(&now)) == NULL) fatal("gmtime failed"); ! asctime_r(t, timebuf); ! if (timebuf[strlen(timebuf) - 1] == '\n') ! timebuf[strlen(timebuf) - 1] = '\0'; if (gethostname(thishost, sizeof(thishost)) == -1) fatal("gethostname failed"); (void)fprintf(fp, "U%s\t%s GMT\t%s\t%s\t\n", ! cf->file_name, timebuf, thishost, cf->file_wd); (void)fclose(fp);