Commit 3087e6fb authored by rswindell's avatar rswindell
Browse files

Created prep_code() to replace strip_slash() and do a better job of preparing

imported internal codes by stripping illegal filename chars.
parent dbc3eccd
......@@ -1985,4 +1985,19 @@ void errormsg(int line, char *source, char action, char *object, ulong access)
#endif
}
/* Prepare a string to be used as an internal code */
char* prep_code(char *str)
{
char tmp[1024];
int i,j;
for(i=j=0;str[i];i++)
if(str[i]>' ' && str[i]!='*' && str[i]!='?'
&& strchr(ILLEGAL_FILENAME_CHARS,str[i])==NULL)
tmp[j++]=str[i];
tmp[j]=0;
strcpy(str,tmp);
return(str);
}
/* End of SCFG.C */
......@@ -110,5 +110,8 @@ int code_ok(char *str);
int bits(long l);
void getar(char *desc, char *ar);
/* Prepare a string to be used as an internal code */
char* prep_code(char *str);
/* scfgnet.h */
faddr_t atofaddr(char *str);
......@@ -35,20 +35,6 @@
#include "scfg.h"
char* DLLCALL strip_slash(char *str)
{
char tmp[1024];
int i,j;
for(i=j=0;str[i];i++)
if(str[i]!='/' && str[i]!='\\')
tmp[j++]=str[i];
tmp[j]=0;
strcpy(str,tmp);
return(str);
}
char *utos(char *str)
{
static char out[128];
......@@ -566,7 +552,7 @@ import into the current message group.
break; }
uifc.pop("Importing Areas...");
while(!feof(stream)) {
if(!fgets(str,128,stream)) break;
if(!fgets(str,sizeof(str),stream)) break;
truncsp(str);
if(!str[0])
continue;
......@@ -703,8 +689,7 @@ import into the current message group.
if(!fgets(str,128,stream)) break;
truncsp(str); } }
truncsp(tmpsub.code_suffix);
strip_slash(tmpsub.code_suffix);
prep_code(tmpsub.code_suffix);
truncsp(tmpsub.sname);
truncsp(tmpsub.lname);
truncsp(tmpsub.qwkname);
......
......@@ -547,6 +547,8 @@ command: DIR /ON /AD /B > DIRS.RAW
}
}
prep_code(tmpdir.code_suffix);
for(j=0;j<cfg.total_dirs;j++) {
if(cfg.dir[j]->lib!=i)
continue;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment