diff --git a/src/browser.c b/src/browser.c
index 3297dbda5fea6f2c95709bf19272b5e0af1f0422..99ec507281594f129f52cb183930bfdfdd1e7b3a 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -83,15 +83,10 @@ char *do_browser(char *path)
     assert(path != NULL && path[strlen(path) - 1] == '/');
 
     /* Get the file list, and set longest and width in the process. */
-    browser_init(path, dir);
+    read_the_list(path, dir);
 
     closedir(dir);
 
-    assert(filelist != NULL);
-
-    /* Sort the file list. */
-    qsort(filelist, filelist_len, sizeof(char *), diralphasort);
-
     /* If given, reselect the present_name and then discard it. */
     if (present_name != NULL) {
 	browser_select_dirname(present_name);
@@ -419,10 +414,8 @@ char *do_browse_from(const char *inpath)
  * set filelist_len to the number of files in that list, set longest to
  * the width in columns of the longest filename in that list (between 15
  * and COLS), and set width to the number of files that we can display
- * per line.  longest needs to be at least 15 columns in order to
- * display ".. (parent dir)", as Pico does.  Assume path exists and is a
- * directory. */
-void browser_init(const char *path, DIR *dir)
+ * per line.  And sort the list too. */
+void read_the_list(const char *path, DIR *dir)
 {
     const struct dirent *nextdir;
     size_t i = 0, path_len = strlen(path);
@@ -445,9 +438,10 @@ void browser_init(const char *path, DIR *dir)
      * in the list whenever possible, as Pico does. */
     longest += 10;
 
-    /* Make sure longest is between 15 and COLS. */
+    /* If needed, make room for ".. (parent dir)". */
     if (longest < 15)
 	longest = 15;
+    /* Make sure we're not wider than the window. */
     if (longest > COLS)
 	longest = COLS;
 
@@ -477,6 +471,11 @@ void browser_init(const char *path, DIR *dir)
      * filelist, so record it. */
     filelist_len = i;
 
+    assert(filelist != NULL);
+
+    /* Sort the list of names. */
+    qsort(filelist, filelist_len, sizeof(char *), diralphasort);
+
     /* Calculate how many files fit on a line -- feigning room for two
      * spaces beyond the right edge, and adding two spaces of padding
      * between columns. */
diff --git a/src/proto.h b/src/proto.h
index 61bca28d6d3c79c84064e4f99d77ea9e0f398f83..1f5e16204f268d83aa087bf38c7e25eeab1b3e04 100644
--- a/src/proto.h
+++ b/src/proto.h
@@ -152,7 +152,7 @@ typedef void (*functionptrtype)(void);
 #ifndef DISABLE_BROWSER
 char *do_browser(char *path);
 char *do_browse_from(const char *inpath);
-void browser_init(const char *path, DIR *dir);
+void read_the_list(const char *path, DIR *dir);
 functionptrtype parse_browser_input(int *kbinput);
 void browser_refresh(void);
 void browser_select_dirname(const char *needle);