Commit a9c3bbf8 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

files.c:do_lockfile(): Actually reference the variable we're using for the dir.

Also name it more appropriately.



git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5058 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 5 additions and 5 deletions
+5 -5
...@@ -247,7 +247,7 @@ int do_lockfile(const char *filename) ...@@ -247,7 +247,7 @@ int do_lockfile(const char *filename)
size_t lockfilesize = strlen(filename) + strlen(locking_prefix) size_t lockfilesize = strlen(filename) + strlen(locking_prefix)
+ strlen(locking_suffix) + 3; + strlen(locking_suffix) + 3;
char *lockfilename = charalloc(lockfilesize); char *lockfilename = charalloc(lockfilesize);
char *lockfilecpy = NULL; char *lockfiledir = NULL;
char lockprog[12], lockuser[16]; char lockprog[12], lockuser[16];
struct stat fileinfo; struct stat fileinfo;
int lockfd, lockpid; int lockfd, lockpid;
...@@ -296,11 +296,11 @@ int do_lockfile(const char *filename) ...@@ -296,11 +296,11 @@ int do_lockfile(const char *filename)
return -1; return -1;
} }
} else { } else {
lockfilecpy = mallocstrcpy(NULL, lockfilename); lockfiledir = mallocstrcpy(NULL, lockfilename);
lockfilecpy = dirname(lockfilecpy); lockfiledir = dirname(lockfiledir);
if (stat(lockfilename, &fileinfo) == -1) { if (stat(lockfiledir, &fileinfo) == -1) {
statusbar(_("Error writing lock file: Directory \'%s\' doesn't exist"), statusbar(_("Error writing lock file: Directory \'%s\' doesn't exist"),
lockfilecpy); lockfiledir);
return -1; return -1;
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment