nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit a9c3bbf8e0e2c2bcb45692c9368938039685057b
parent be3e4404ee3954734b46b24834e71ee3fe366c75
Author: Chris Allegretta <chrisa@asty.org>
Date:   Fri, 11 Jul 2014 10:39:38 +0000

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

Diffstat:
Msrc/files.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/files.c b/src/files.c @@ -247,7 +247,7 @@ int do_lockfile(const char *filename) size_t lockfilesize = strlen(filename) + strlen(locking_prefix) + strlen(locking_suffix) + 3; char *lockfilename = charalloc(lockfilesize); - char *lockfilecpy = NULL; + char *lockfiledir = NULL; char lockprog[12], lockuser[16]; struct stat fileinfo; int lockfd, lockpid; @@ -296,11 +296,11 @@ int do_lockfile(const char *filename) return -1; } } else { - lockfilecpy = mallocstrcpy(NULL, lockfilename); - lockfilecpy = dirname(lockfilecpy); - if (stat(lockfilename, &fileinfo) == -1) { + lockfiledir = mallocstrcpy(NULL, lockfilename); + lockfiledir = dirname(lockfiledir); + if (stat(lockfiledir, &fileinfo) == -1) { statusbar(_("Error writing lock file: Directory \'%s\' doesn't exist"), - lockfilecpy); + lockfiledir); return -1; } }