On Mon, Mar 10, 2008 at 1:34 AM, Tony Balinski <[EMAIL PROTECTED]> wrote:
> Quoting Bert Wesarg <[EMAIL PROTECTED]>:
>
>  > >  > 4. #1907176 Empty $file_path
>  > >
>  > >  Since it is easy to fix...
>  > Tony, I have a patch with your suggestions, should I/could I/may I
>
>  Be my guest.
The only problem is still VMS, I have protect it currently with an #ifndef VMS

diff --quilt old/source/file.c new/source/file.c
--- old/source/file.c
+++ new/source/file.c
@@ -111,10 +111,11 @@ void removeVersionNumber(char *fileName)
 WindowInfo *EditNewFile(WindowInfo *inWindow, char *geometry, int iconic,
         const char *languageMode, const char *defaultPath)
 {
     char name[MAXPATHLEN];
     WindowInfo *window;
+    size_t len;

     /*... test for creatability? */

     /* Find a (relatively) unique name for the new file */
     UniqueUntitledName(name);
@@ -124,11 +125,19 @@ WindowInfo *EditNewFile(WindowInfo *inWi
        window = CreateDocument(inWindow, name);
     else
        window = CreateWindow(name, geometry, iconic);
        
     strcpy(window->filename, name);
-    strcpy(window->path, defaultPath ? defaultPath : "");
+    strcpy(window->path, defaultPath ? defaultPath : GetCurrentDir());
+#ifndef VMS
+    len = strlen(window->path);
+    if (len > 0 && window->path[len - 1] != '/') {
+        if (len < sizeof(window->path) - 1) {
+            strcat(window->path, "/");
+        }
+    }
+#endif
     SetWindowModified(window, FALSE);
     CLEAR_ALL_LOCKS(window->lockReasons);
     UpdateWindowReadOnly(window);
     UpdateStatsLine(window);
     UpdateWindowTitle(window);


Bert
>
>  Tony
-- 
NEdit Develop mailing list - [email protected]
http://www.nedit.org/mailman/listinfo/develop

Reply via email to