#628 Empty $file_path

closed-fixed
nobody
None
5
2008-06-10
2008-03-04
Tony Balinski
No

When you start NEdit without a particular file, you get a document labelled "Unknown". It is created without a file path, which can be a big problem if you execute macros from it using $file_name.

This is easy to fix in function EditNewFile() in file.c, where window->path is assigned:

strcpy(window->path, defaultPath ? defaultPath : "");

Instead of "", call GetCurrentDir() (in util/utils.c).
On Unix/Linux/Posix/Cygwin you'll need to add a "/" to that, since that's how file paths are normally terminated in NEdit. (On VMS, I expect this is not necessary, but I don't have such a system to play with. I don't know about other file path conventions on other systems.)

Having made the change results in a correctly assigned $file_path value for these documents. This path is visible in the statistics line (if you use that), another useful feature.

Discussion

<< < 1 2 3 (Page 3 of 3)
  • Bert Wesarg
    Bert Wesarg
    2008-10-01

    Ohh,

    I think we are not done with this bug:

    start nedit
    modifie the Untitled buffer
    close window without saving
    -> Untitled without path

     
<< < 1 2 3 (Page 3 of 3)