Comment by Panzerschrek
2 days ago
This doesn't look good:
c8 buf [SP_PATH_MAX] = sp_zero;
sp_cstr_copy_to_n(path, len, buf, SP_PATH_MAX);
since
#define SP_PATH_MAX 4096
There should be a fallback for very long paths.
2 days ago
This doesn't look good:
c8 buf [SP_PATH_MAX] = sp_zero;
sp_cstr_copy_to_n(path, len, buf, SP_PATH_MAX);
since
#define SP_PATH_MAX 4096
There should be a fallback for very long paths.
I'm inclined to agree with you that paths can be arbitrarily long as a matter of principle. However in practice I believe PATH_MAX on most distros defaults to 4096 so if you're going to insist on a hard upper limit it's at least within reason.
Can you show me a realistic case with a longer path?
I guess the c8 means you don't plan on supporting Unicode on Windows? If you do, there's the 32768 "character" max path which since Win10 is opt-in without jumping through hoops.
https://learn.microsoft.com/en-us/windows/win32/fileio/maxim...
I have email backups from a provider where filenames are extremely long.