Commit 05e22692 authored by Robert Sprowson's avatar Robert Sprowson
Browse files

Hypothetical C syntax swapped for reality

Nice though it would be to be able to use logical or to test multiple characters at once, that expression simply evaluates to "TRUE" in the real world, so the substitution for underscore never worked when shortening filenames.
The function still doesn't follow Microsoft's rules (see ticket #313) yet.
parent f7bb3d25
...@@ -430,7 +430,7 @@ int shorten_lfn(char * longfname, char * shortname, char * shortnamebuff, DIR_in ...@@ -430,7 +430,7 @@ int shorten_lfn(char * longfname, char * shortname, char * shortnamebuff, DIR_in
continue; continue;
} }
} }
if(longfname[i] == ('+' || ',' || ';' || '=' || '[' || ']' || '.')) if(strchr("+,;=[]", longfname[i]) != NULL)
{ {
shortnamebuff[o] = '_'; shortnamebuff[o] = '_';
}else }else
...@@ -452,7 +452,7 @@ int shorten_lfn(char * longfname, char * shortname, char * shortnamebuff, DIR_in ...@@ -452,7 +452,7 @@ int shorten_lfn(char * longfname, char * shortname, char * shortnamebuff, DIR_in
continue; continue;
} }
if(extension[i]==' ') continue; if(extension[i]==' ') continue;
if(extension[i] == ('+' || ',' || ';' || '=' || '[' || ']')) if(strchr("+,;=[]", extension[i]) != NULL)
{ {
shortnamebuff[o] = '_'; shortnamebuff[o] = '_';
}else }else
......
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