git-svn-id: svn://svn.savannah.gnu.org/nano/branches/nano_2_4_branch@5421
35c25a1d-7b9e-4130-9fde-
d3aeb78583b8
+2015-11-06 Benno Schulenberg <bensberg@justemail.net>
+ * src/files.c (write_lockfile): Don't bail out when the hostname is
+ overlong, but instead truncate it properly and continue. This fixes
+ Ubuntu bug #1509081 reported by Sam Reed.
+
2015-10-31 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (copy_from_filestruct): When pasting while the mark is
on, the mark's pointer needs to be refreshed only when it is on the
mypid = getpid();
if (gethostname(myhostname, 31) < 0) {
- statusbar(_("Couldn't determine hostname for lock file: %s"), strerror(errno));
- goto free_and_fail;
+ if (errno == ENAMETOOLONG)
+ myhostname[31] = '\0';
+ else {
+ statusbar(_("Couldn't determine hostname for lock file: %s"), strerror(errno));
+ goto free_and_fail;
+ }
}
/* Check if the lock exists before we try to delete it...*/