X-Git-Url: http://www.wagner.pp.ru/gitweb/?p=oss%2Fcatdoc.git;a=blobdiff_plain;f=src%2Ffileutil.c;fp=src%2Ffileutil.c;h=ce616c2ea112d170894a7d95dbf7679d00437e1c;hp=657b02252375cf2a9caa7c7b1bccd801c28767a3;hb=b89ceec5c7a586c1ad3e4758c4d2fdd160117d27;hpb=a79f2377217c571396074fccf360e01032cd77bf diff --git a/src/fileutil.c b/src/fileutil.c index 657b022..ce616c2 100644 --- a/src/fileutil.c +++ b/src/fileutil.c @@ -104,10 +104,14 @@ int check_charset(char **filename,const char *charset) { return 1; } tmppath=find_file(stradd(charset,CHARSET_EXT),charset_path); - if (tmppath&& *tmppath) { - *filename=strdup(charset); - free(tmppath); - return 1; + /* Some compilers evalate both arguments of && before + applying, so let's not use && as in the shell */ + if (tmppath) { + if (*tmppath) { + *filename=strdup(charset); + free(tmppath); + return 1; + } } return 0; }