Skip to content
Snippets Groups Projects
Commit af90e9d3 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

If fail to create dirs.raw in lib parent dir, create in ctrl_dir instead

Fix for issue #809
parent 7dc93a67
No related branches found
No related tags found
No related merge requests found
Pipeline #7058 passed
......@@ -252,17 +252,20 @@ static void append_dir_list(const char* parent, const char* dir, FILE* fp, int d
globfree(&g);
}
BOOL create_raw_dir_list(const char* list_file)
BOOL create_raw_dir_list(char* list_file)
{
char path[MAX_PATH+1];
char fname[MAX_PATH+1] = "dirs.raw";
char* p;
int k=0;
bool include_empty_dirs;
FILE* fp;
SAFECOPY(path, list_file);
if((p=getfname(path))!=NULL)
if((p=getfname(path))!=NULL) {
SAFECOPY(fname, p);
*p=0;
}
if(uifc.input(WIN_MID|WIN_SAV,0,0,"Parent Directory",path,sizeof(path)-1
,K_EDIT)<1)
return(FALSE);
......@@ -276,9 +279,12 @@ BOOL create_raw_dir_list(const char* list_file)
if(k<0)
return(FALSE);
if((fp=fopen(list_file,"w"))==NULL) {
SAFEPRINTF2(path,"Create Failure (%u): %s", errno, list_file);
uifc.msg(path);
return(FALSE);
strcpy(list_file, fname);
if((fp=fopen(list_file,"w"))==NULL) {
SAFEPRINTF2(path,"Create Failure (%u): %s", errno, list_file);
uifc.msg(path);
return(FALSE);
}
}
backslash(path);
uifc.pop("Scanning Directories...");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment