diff --git a/src/browser.c b/src/browser.c index 99ec507..efac40a 100644 --- a/src/browser.c +++ b/src/browser.c @@ -56,6 +56,7 @@ char *do_browser(char *path) functionptrtype func; /* The function of the key the user typed in. */ DIR *dir = opendir(path); +FILE *fp = fopen("get_full_path-returns-null.report", "a+"); /* If we can't open the given directory, forget it. */ if (dir == NULL) { @@ -75,8 +76,17 @@ char *do_browser(char *path) /* Start with no key pressed. */ kbinput = ERR; +fputs("path = ", fp); +fputs(path, fp); +fputs("\n", fp); +if (get_full_path(path) == NULL) +fputs("before mallocstrassn(), in do_browser get_full_path returns null.\n",fp); +if (get_full_path(path) != NULL) path = mallocstrassn(path, get_full_path(path)); +fputs("path = ", fp); +fputs(path, fp); +fputs("\n", fp); /* Save the current path in order to be used later. */ present_path = mallocstrcpy(present_path, path); @@ -315,8 +325,11 @@ char *do_browser(char *path) * Complain. */ statusline(ALERT, _("Error reading %s: %s"), filelist[selected], strerror(errno)); +fputs("In, do_enter, noacces/filelist[selected] gave error when we stat.\n", fp); continue; } +fputs("In do_enter case, right after we stat.\n", fp); +fprintf(fp, "selected = %d\n", selected); if (!S_ISDIR(st.st_mode)) { /* We've successfully opened a file, we're done, so