uemacs icon indicating copy to clipboard operation
uemacs copied to clipboard

Bigger filenames should be limited to 127 for now

Open rfivet opened this issue 6 years ago • 2 comments

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 avatar Jul 29 '18 03:07 rfivet

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]

rfivet avatar Jul 29 '18 07:07 rfivet

hi,大家好

ted-cs avatar May 04 '19 04:05 ted-cs