Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bigger filenames should be limited to 127 for now #9

Open
rfivet opened this issue Jul 29, 2018 · 2 comments
Open

Bigger filenames should be limited to 127 for now #9

rfivet opened this issue Jul 29, 2018 · 2 comments

Comments

@rfivet
Copy link

rfivet commented Jul 29, 2018

I did a quick recheck after last commit setting up NFILEN to 256

  • em crashes when called with filename argument longer than 255 [easy to fix with mystrscpy instead of strcpy]

  • as em variables size are limited to 127+1, longer filenames will create problems with macroes [ex: $cfname holds the filename of current buffer]

  • write-file command can be called with strings up to and longer than 255, so em will create files having up to 255 characters, but can't open them either with find-file command or as argument from command line [LOCK ERROR: cannot access lock file - File name too long]

  • filenames completion works, a manual display refresh [^L] is necessary to clean up the display.

attached is a simple em script I used to generate the files for test: [strip .txt extension]
tstfnam.cmd.txt

I would suggest to limit NFILEN to 128 for now and fix the strcpy of filename arg issue.

@rfivet
Copy link
Author

rfivet commented Jul 29, 2018

Lock creation failure happens as lock filename is generated by appending ".lock~" to the target filename. So with NFILEN at 256 matching OS maximum filename size of 255, we can use current em for editing file with filename up to 249 characters.
[Note: I did most of my testing on local directory filenames, without pathname]

@ted-cs
Copy link

ted-cs commented May 4, 2019

hi,大家好

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants