From 1907174c5f42f6dceb4db3e45fcef5008d8bc88c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 26 Feb 2020 14:01:25 +0100 Subject: [PATCH] tweaks: drop a check for something that will not occur The check has been there for a few months, and will be there for five more years in the next Ubuntu LTS. --- src/files.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/files.c b/src/files.c index 8e442d20..3b6a11de 100644 --- a/src/files.c +++ b/src/files.c @@ -1485,7 +1485,7 @@ bool write_file(const char *name, FILE *thefile, bool tmp, struct stat st; /* The status fields filled in by stat(). */ #endif - char *realname; + char *realname = real_dir_from_tilde(name); /* The filename after tilde expansion. */ char *tempname = NULL; /* The name of the temporary file we use when prepending. */ @@ -1496,13 +1496,6 @@ bool write_file(const char *name, FILE *thefile, bool tmp, bool retval = FALSE; /* The return value, to become TRUE when writing has succeeded. */ -#ifndef NANO_TINY - if (*name == '\0') - die("Tried to write a nameless file -- please report a bug\n"); -#endif - - realname = real_dir_from_tilde(name); - #ifdef ENABLE_OPERATINGDIR /* If we're writing a temporary file, we're probably going outside * the operating directory, so skip the operating directory test. */