emikulic / darkhttpd

When you need a web server in a hurry.
https://unix4lyfe.org/darkhttpd/
ISC License
1.03k stars 83 forks source link

Add modified time to directory listings #50

Closed hhartzer closed 6 months ago

hhartzer commented 6 months ago

Also add .editorconfig to help keep formatting consistent.

Fixes: #48

hhartzer commented 6 months ago

I still need to test this with Kodi, but the code itself may be good and possibly the final product. Feel free to leave comments, though.

Please don't merge yet if it does look good!

hhartzer commented 6 months ago

It works, except on files that exceed 1GB. I will push up a fix.

emikulic commented 6 months ago

Please squash commits. :) Or I can do it at merge time if you prefer.

hhartzer commented 6 months ago

Feel free to do it at merge time in that case, but I'm happy to squash commits if that's easier for you.

emikulic commented 6 months ago

Thanks!

hhartzer commented 6 months ago

Thank you for merging!

g-rden commented 6 months ago

What does the .editorconfig file do? Did that just slip into the repo?

emikulic commented 6 months ago

The commit msg states "Also add .editorconfig to help keep formatting consistent" - looks like spaces vs tabs to me.

g-rden commented 6 months ago

I am blind, sorry

hhartzer commented 6 months ago

Whenever I would open darkhttpd.c in nvim, if I made a new line it would format it with tabs instead of spaces, making the file inconsistent. With the .editorconfig it doesn't do that.

It's pretty configurable and widely supported: https://editorconfig.org/

g-rden commented 6 months ago

Another question: Why not print the mod times for directories too? Like this https://github.com/g-rden/darkhttpd/commit/c1d7c45d6b238bb6c52cd629f2c730033d13e721

Kodi probably doesn't use the dir times for anything, but I don't see a reason not to display them too.

emikulic commented 6 months ago

That looks pretty good. Please send a PR.

emikulic commented 6 months ago

Done in #61 - thanks!