1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

ftp: Don't pad the timestamp column with spaces.

This commit is contained in:
Kalle Olavi Niemitalo 2007-03-20 21:26:46 +02:00 committed by Witold Filipczyk
parent d696d6530f
commit b636024ede

View File

@ -1165,13 +1165,22 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries,
fmt = "%b %e %H:%M"; fmt = "%b %e %H:%M";
wr = strftime(date, sizeof(date), fmt, when_tm); wr = strftime(date, sizeof(date), fmt, when_tm);
add_html_to_string(&string, date, wr);
while (wr < sizeof(date) - 1) date[wr++] = ' ';
date[sizeof(date) - 1] = '\0';
add_to_string(&string, date);
} else } else
#endif #endif
add_to_string(&string, " "); add_to_string(&string, " ");
/* TODO: Above, the number of spaces might not match the width
* of the string generated by strftime. It depends on the
* locale. So if ELinks knows the timestamps of some FTP
* files but not others, it may misalign the file names.
* Potential solutions:
* - Pad the strings to a compile-time fixed width.
* Con: If we choose a width that suffices for all known
* locales, then it will be stupidly large for most of them.
* - Generate an HTML table.
* Con: Bloats the HTML source.
* Any solution chosen here should also be applied to the
* file: protocol handler. */
add_char_to_string(&string, ' '); add_char_to_string(&string, ' ');