summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/src/history.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cvs/src/history.c')
-rw-r--r--contrib/cvs/src/history.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/contrib/cvs/src/history.c b/contrib/cvs/src/history.c
index 4979398..40b5e14 100644
--- a/contrib/cvs/src/history.c
+++ b/contrib/cvs/src/history.c
@@ -770,11 +770,8 @@ history_write (type, update_dir, revs, name, repository)
if (save_cwd (&cwd))
error_exit ();
- if ( CVS_CHDIR (pwdir) < 0)
- error (1, errno, "can't chdir(%s)", pwdir);
- homedir = xgetwd ();
- if (homedir == NULL)
- error (1, errno, "can't getwd in %s", pwdir);
+ if ( CVS_CHDIR (pwdir) < 0 || (homedir = xgetwd ()) == NULL)
+ homedir = pwdir;
if (restore_cwd (&cwd, NULL))
error_exit ();
@@ -786,7 +783,9 @@ history_write (type, update_dir, revs, name, repository)
PrCurDir += i; /* Point to '/' separator */
tilde = "~";
}
- free (homedir);
+
+ if (homedir != pwdir)
+ free (homedir);
}
}
}
OpenPOWER on IntegriCloud