diff --git a/ChangeLog b/ChangeLog
index b4b6bba21da1b00d58dbdf9670d18607b3779944..4d2646d0fe1bc60da55cedba77ec66319858d351 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
 2016-01-20  Benno Schulenberg  <bensberg@justemail.net>
 	* src/files.c (open_buffer): Readjust the indentation and a comment.
+	* src/files.c (has_valid_path): Get rid of a global variable.
 
 2016-01-20  Rishabh Dave  <rishabhddave@gmail.com>
 	* src/files.c (verify_path, open_buffer): When opening a new buffer,
diff --git a/src/files.c b/src/files.c
index 8a7a0812f1ff6f3d01d595730aceb2f7ad20ebd4..cbf64341e0935cfa51ffe4c9b43299e4695908c8 100644
--- a/src/files.c
+++ b/src/files.c
@@ -33,27 +33,26 @@
 #include <pwd.h>
 #include <libgen.h>
 
-/* Determine whether the containing directory of the given filename exists.
- * Pass the result back in the global variable valid_path. */
-void verify_path(const char *filename)
+/* Verify that the containing directory of the given filename exists. */
+bool has_valid_path(const char *filename)
 {
     char *parentdir;
     struct stat parentinfo;
+    bool validity = TRUE;
 
     if (strrchr(filename, '/') == NULL)
 	parentdir = mallocstrcpy(NULL, ".");
     else
 	parentdir = dirname(mallocstrcpy(NULL, filename));
 
-    if (stat(parentdir, &parentinfo) != -1 && S_ISDIR(parentinfo.st_mode))
-	valid_path = TRUE;
-    else {
+    if (stat(parentdir, &parentinfo) == -1 || !S_ISDIR(parentinfo.st_mode)) {
 	statusbar(_("Directory '%s' does not exist"), parentdir);
-	valid_path = FALSE;
+	validity = FALSE;
 	beep();
     }
 
     free(parentdir);
+    return validity;
 }
 
 /* Add an entry to the openfile openfilestruct.  This should only be
@@ -135,7 +134,7 @@ void set_modified(void)
     titlebar(NULL);
 
 #ifndef NANO_TINY
-    if (!ISSET(LOCKING) || openfile->filename[0] == '\0' || !valid_path)
+    if (!ISSET(LOCKING) || openfile->filename[0] == '\0')
 	return;
 
     if (openfile->lock_filename == NULL) {
@@ -404,10 +403,10 @@ bool open_buffer(const char *filename, bool undoable)
     if (new_buffer) {
 	make_new_buffer();
 
-	verify_path(filename);
-
+	if (!has_valid_path(filename))
+	    quiet = TRUE;
 #ifndef NANO_TINY
-	if (valid_path) {
+	else {
 	    if (ISSET(LOCKING) && filename[0] != '\0') {
 		int lockstatus = do_lockfile(filename);
 		if (lockstatus < 0) {
@@ -977,7 +976,7 @@ int open_file(const char *filename, bool newfie, bool quiet, FILE **f)
 	}
 
 	if (newfie) {
-	    if (!quiet && valid_path)
+	    if (!quiet)
 		statusbar(_("New File"));
 	    return -2;
 	}
diff --git a/src/global.c b/src/global.c
index b252f64a5f367744b33f9a67a2695a5f60428670..829c19bf849d5d23838909ee59ede9a2013dce30 100644
--- a/src/global.c
+++ b/src/global.c
@@ -40,8 +40,6 @@ bool func_key;
 	/* Whether the current keystroke is an extended keypad value. */
 bool focusing = FALSE;
 	/* Whether an update of the edit window should center the cursor. */
-bool valid_path;
-	/* Whether the containing directory of a specified file exists. */
 
 #ifndef NANO_TINY
 int controlleft = CONTROL_LEFT;
diff --git a/src/proto.h b/src/proto.h
index 1056b76da67a3a2202a2df2970c49b723af7b0c9..cf33e778e9f1a54013fba8fb773c106893328caf 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -34,7 +34,6 @@ extern volatile sig_atomic_t sigwinch_counter;
 extern bool meta_key;
 extern bool func_key;
 extern bool focusing;
-extern bool valid_path;
 
 #ifndef NANO_TINY
 extern int controlleft;