From ca43598c1b6836e78ef8b50e791d221ba492769c Mon Sep 17 00:00:00 2001 From: Xavier Santolaria Date: Fri, 5 Jan 2007 09:32:50 +0000 Subject: use current working directory fullpath for notifications. --- usr.bin/cvs/edit.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/usr.bin/cvs/edit.c b/usr.bin/cvs/edit.c index 1bba91a42b9..c99e6bc5c85 100644 --- a/usr.bin/cvs/edit.c +++ b/usr.bin/cvs/edit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: edit.c,v 1.20 2007/01/05 09:15:00 xsa Exp $ */ +/* $OpenBSD: edit.c,v 1.21 2007/01/05 09:32:49 xsa Exp $ */ /* * Copyright (c) 2006, 2007 Xavier Santolaria * @@ -244,7 +244,7 @@ cvs_edit_local(struct cvs_file *cf) FILE *fp; struct tm *t; time_t now; - char *bfpath, timebuf[64], thishost[MAXHOSTNAMELEN]; + char *bfpath, timebuf[64], thishost[MAXHOSTNAMELEN], wdir[MAXPATHLEN]; if (cvs_noexec == 1) return; @@ -264,8 +264,11 @@ cvs_edit_local(struct cvs_file *cf) if (gethostname(thishost, sizeof(thishost)) == -1) fatal("gethostname failed"); + if (getcwd(wdir, sizeof(wdir)) == NULL) + fatal("getcwd failed"); + (void)fprintf(fp, "E%s\t%s GMT\t%s\t%s\t\n", - cf->file_name, timebuf, thishost, cf->file_wd); + cf->file_name, timebuf, thishost, wdir); if (edit_aflags & E_EDIT) (void)fprintf(fp, "E"); @@ -305,7 +308,7 @@ cvs_unedit_local(struct cvs_file *cf) struct stat st; struct tm *t; time_t now; - char *bfpath, timebuf[64], thishost[MAXHOSTNAMELEN]; + char *bfpath, timebuf[64], thishost[MAXHOSTNAMELEN], wdir[MAXPATHLEN]; if (cvs_noexec == 1) return; @@ -348,8 +351,11 @@ cvs_unedit_local(struct cvs_file *cf) if (gethostname(thishost, sizeof(thishost)) == -1) fatal("gethostname failed"); + if (getcwd(wdir, sizeof(wdir)) == NULL) + + fatal("getcwd failed"); (void)fprintf(fp, "U%s\t%s GMT\t%s\t%s\t\n", - cf->file_name, timebuf, thishost, cf->file_wd); + cf->file_name, timebuf, thishost, wdir); (void)fclose(fp); -- cgit v1.2.3