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:
parent
d696d6530f
commit
b636024ede
@ -1165,13 +1165,22 @@ display_dir_entry(struct cache_entry *cached, off_t *pos, int *tries,
|
||||
fmt = "%b %e %H:%M";
|
||||
|
||||
wr = strftime(date, sizeof(date), fmt, when_tm);
|
||||
|
||||
while (wr < sizeof(date) - 1) date[wr++] = ' ';
|
||||
date[sizeof(date) - 1] = '\0';
|
||||
add_to_string(&string, date);
|
||||
add_html_to_string(&string, date, wr);
|
||||
} else
|
||||
#endif
|
||||
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, ' ');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user