diff --git a/ChangeLog b/ChangeLog
index 5c33f2d513f47551fae86e9070bdcf840f8bc78a..6b39019cfc5ac4b20fd1f86ecd3737ba96b23ba3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -27,6 +27,10 @@ CVS code -
 	  (DLR)
   findnextfile()
 	- Simplify the uses of tail(). (DLR)
+  striponedir()
+	- Since all the strings passed to this are dynamically
+	  allocated, use null_at() to strip the directory from the
+	  string. (DLR)
 - doc/syntax/c.nanorc:
 	- Since .i and .ii are preprocessed C and C++ output, colorize
 	  them here. (Mike Frysinger)
diff --git a/src/browser.c b/src/browser.c
index 7de12d6cf2d8c6d57784c83c75d12a6022c9e84b..051d25125561d7c1f3ebe59a766255f7b2a2153c 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -334,7 +334,6 @@ char *do_browser(char *path, DIR *dir)
 			"..") == 0) {
 		    prev_dir = mallocstrcpy(NULL, filelist[selected]);
 		    striponedir(prev_dir);
-		    align(&prev_dir);
 		}
 
 		dir = opendir(filelist[selected]);
@@ -967,7 +966,8 @@ void do_last_file(void)
     selected = filelist_len - 1;
 }
 
-/* Strip one directory from the end of path. */
+/* Strip one directory from the end of path, which should be
+ * dynamically allocated. */
 void striponedir(char *path)
 {
     char *tmp;
@@ -977,7 +977,7 @@ void striponedir(char *path)
     tmp = strrchr(path, '/');
 
     if (tmp != NULL)
- 	*tmp = '\0';
+ 	null_at(&path, tmp - path);
 }
 
 #endif /* !DISABLE_BROWSER */