sebastinas / yafc

Yafc is yet another ftp client (with some handy features)
Other
45 stars 16 forks source link

Justify date in ls -l #59

Closed fluks closed 9 years ago

fluks commented 9 years ago

On some locales the length of the shortened month names can vary. Calling ls -l, the date strings are not justified correctly. Fix this by finding the longest date string and justifying on it.

Closes #58.

fluks commented 9 years ago

I'm not sure how this code behaves on other locales, such as Chinese. I tested it on C, en_US.UTF-8, fi_FI.UTF-8 and ru_RU.UTF-8. It might also need some refactoring, as mbstowcs() is called twice for every date string.

TheJosh commented 9 years ago

Looks good to me.

Also, I wouldn't worry about performance here; in a program like Yafc, the network delays will dwarf these kinds of micro optimisations.

Thanks for the patch. On 06/10/2015 1:21 PM, "fluks" notifications@github.com wrote:

I'm not sure how this code behaves on other locales, such as Chinese. I tested it on C, en_US.UTF-8, fi_FI.UTF-8 and ru_RU.UTF-8. It might also need some refactoring, as mbstowcs() is called twice for every date string.

— Reply to this email directly or view it on GitHub https://github.com/sebastinas/yafc/pull/59#issuecomment-145728598.