diff options
author | Richard M. Stallman <rms@gnu.org> | 1994-11-17 16:10:36 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1994-11-17 16:10:36 +0000 |
commit | 8600e6edbad67efacd43e26865e20629fb459600 (patch) | |
tree | a8ae14c6e06ae8d147cdbd9c15411f61b72de0f4 /src/filelock.c | |
parent | 7c7daa220d9fdd567211537f383861996308249a (diff) | |
download | emacs-8600e6edbad67efacd43e26865e20629fb459600.tar.gz |
(init_filelock): Always copy lock_path.
Diffstat (limited to 'src/filelock.c')
-rw-r--r-- | src/filelock.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/filelock.c b/src/filelock.c index eefeed195f7..f7e21576678 100644 --- a/src/filelock.c +++ b/src/filelock.c @@ -455,18 +455,20 @@ t if it is locked by you, else a string of the name of the locker.") init_filelock () { + char *new_path + lock_path = egetenv ("EMACSLOCKDIR"); if (! lock_path) lock_path = PATH_LOCK; + /* Copy the path in case egetenv got it from a Lisp string. */ + new_path = (char *) xmalloc (strlen (lock_path) + 2); + strcpy (new_path, lock_path); + lock_path = new_path; + /* Make sure it ends with a slash. */ if (lock_path[strlen (lock_path) - 1] != '/') - { - char *new_path = (char *) xmalloc (strlen (lock_path) + 2); - strcpy (new_path, lock_path); - lock_path = new_path; - strcat (lock_path, "/"); - } + strcat (lock_path, "/"); superlock_path = (char *) xmalloc ((strlen (lock_path) + sizeof (SUPERLOCK_NAME))); |