ide; fixed Windows network relative paths do not go properly into recent files/projec...
authorRejean Loyer <rejean.loyer@gmail.com>
Sun, 5 May 2013 20:47:01 +0000 (16:47 -0400)
committerRejean Loyer <rejean.loyer@gmail.com>
Mon, 20 May 2013 20:58:05 +0000 (16:58 -0400)
ecere/src/sys/File.c
ide/src/ide.ec

index 53136e2..684d263 100644 (file)
@@ -409,6 +409,12 @@ void FILE_FileFixCase(char * file)
          parent[2] = '\0';
          c = 2;
       }
+      else if(file[0] == '/' && file[1] == '/')
+      {
+         parent[0] = parent[1] = '\\';
+         parent[2] = '\0';
+         c = 2;
+      }
       // Copy Entire Computer to new path
       else if(file[0] == '/'  && !file[1])
    
index ff0d84d..4c7f940 100644 (file)
@@ -3117,7 +3117,8 @@ class IDEWorkSpace : Window
       Menu fileMenu = menu.FindMenu($"File");
       Menu recentFiles = fileMenu.FindMenu($"Recent Files");
       Menu recentProjects = fileMenu.FindMenu($"Recent Projects");
-      char itemName[MAX_LOCATION + 4];
+      char * itemPath = new char[MAX_LOCATION];
+      char * itemName = new char[MAX_LOCATION+4];
       MenuItem item;
 
       recentFiles.Clear();
@@ -3125,8 +3126,9 @@ class IDEWorkSpace : Window
 
       for(recent : ideSettings.recentFiles)
       {
-         sprintf(itemName, "%d %s", 1 + c, recent);
-         MakeSystemPath(itemName);
+         strncpy(itemPath, recent, MAX_LOCATION); itemPath[MAX_LOCATION-1] = '\0';
+         MakeSystemPath(itemPath);
+         snprintf(itemName, MAX_LOCATION+4, "%d %s", 1 + c, itemPath); itemName[MAX_LOCATION+4-1] = '\0';
          recentFiles.AddDynamic(MenuItem { copyText = true, text = itemName, (Key)k1 + c, id = c, NotifySelect = ide.FileRecentFile }, ide, true);
          c++;
       }
@@ -3135,11 +3137,15 @@ class IDEWorkSpace : Window
       c = 0;
       for(recent : ideSettings.recentProjects)
       {
-         sprintf(itemName, "%d %s", 1 + c, recent);
-         MakeSystemPath(itemName);
+         strncpy(itemPath, recent, MAX_LOCATION); itemPath[MAX_LOCATION-1] = '\0';
+         MakeSystemPath(itemPath);
+         snprintf(itemName, MAX_LOCATION+4, "%d %s", 1 + c, itemPath); itemName[MAX_LOCATION+4-1] = '\0';
          recentProjects.AddDynamic(MenuItem { copyText = true, text = itemName, (Key)k1 + c, id = c, NotifySelect = ide.FileRecentProject }, ide, true);
          c++;
       }
+
+      delete itemPath;
+      delete itemName;
    }
 
    ~IDEWorkSpace()