From 2463c1b2f8196b274a844ae5500756abc51c224d Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Sat, 19 Jan 2008 10:55:11 +0200 Subject: [PATCH] Bug 939: Documented the fix. The fix itself is in the parent commit. (cherry picked from commit 4c390589ea28eeba020357fd89841b0fc2be33b3, rewriting the NEWS entry because the bug also occurred on Debian) --- NEWS | 1 + src/protocol/fsp/fsp.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/NEWS b/NEWS index 7476701c..1dac6b33 100644 --- a/NEWS +++ b/NEWS @@ -320,6 +320,7 @@ To be released as 0.11.4. * bug 712: GnuTLS works on https://www-s.uiuc.edu/[] * fix active and passive FTP over IPv6 * bug 938: elinks -remote no longer needs a controlling tty +* bug 939: fix FSP directory listing (some compiler options left it empty) * bug 978: Python's webbrowser.open_new_tab(URL) works since now * minor bug 54, Debian bug 338402: don't force the terminal to 8 bits with no parity, and don't disable XON/XOFF flow control either diff --git a/src/protocol/fsp/fsp.c b/src/protocol/fsp/fsp.c index 58aeda82..cd62fbf8 100644 --- a/src/protocol/fsp/fsp.c +++ b/src/protocol/fsp/fsp.c @@ -171,6 +171,13 @@ display_entry(const FSP_RDENTRY *fentry, const unsigned char dircolor[]) static void sort_and_display_entries(FSP_DIR *dir, const unsigned char dircolor[]) { + /* fsp_readdir_native in fsplib 0.9 and earlier requires + * the third parameter to point to a non-null pointer + * even though it does not dereference that pointer + * and overwrites it with another one anyway. + * http://sourceforge.net/tracker/index.php?func=detail&aid=1875210&group_id=93841&atid=605738 + * Work around the bug by using non-null &tmp. + * Nothing will actually read or write tmp. */ FSP_RDENTRY fentry, tmp, *table = NULL; FSP_RDENTRY *fresult = &tmp; int size = 0; @@ -229,6 +236,8 @@ fsp_directory(FSP_SESSION *ses, struct uri *uri) if (get_opt_bool("protocol.fsp.sort")) { sort_and_display_entries(dir, dircolor); } else { + /* &tmp works around a bug in fsplib 0.9 or earlier. + * See sort_and_display_entries for details. */ FSP_RDENTRY fentry, tmp; FSP_RDENTRY *fresult = &tmp;