Skip to content

Commit

Permalink
ide; fixed Windows network relative paths do not go properly into rec…
Browse files Browse the repository at this point in the history
…ent files/project. closes #880.
  • Loading branch information
redj committed May 20, 2013
1 parent 2fd59c5 commit 3d3092d
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
6 changes: 6 additions & 0 deletions ecere/src/sys/File.c
Expand Up @@ -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])

Expand Down
16 changes: 11 additions & 5 deletions ide/src/ide.ec
Expand Up @@ -3117,16 +3117,18 @@ 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();
c = 0;

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++;
}
Expand All @@ -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()
Expand Down

0 comments on commit 3d3092d

Please sign in to comment.