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=ce0bdb7b50d3405b0c4b87b4715c297f8284f4ce;hp=86139ecdb833e332679d5ec03078b7198319713c;hb=4c1c2b85914997dfaab4718b2723bdb5ba2ef779;hpb=236251f0528f1c2e14a9940d75fd97aba49c573c diff --git a/src/fileutil.c b/src/fileutil.c index 86139ec..ce0bdb7 100644 --- a/src/fileutil.c +++ b/src/fileutil.c @@ -99,19 +99,18 @@ char *find_file(char *name, const char *path) /************************************************************************/ int check_charset(char **filename,const char *charset) { char *tmppath; + if (charset == NULL ) { + return 0; + } if (!strncmp(charset,"utf-8",6)) { *filename=strdup("utf-8"); return 1; } tmppath=find_file(stradd(charset,CHARSET_EXT),charset_path); - /* Some compilers evalate both arguments of && before - applying, so let's not use && as in the shell */ - if (tmppath) { - if (*tmppath) { + if (tmppath && *tmppath) { *filename=strdup(charset); free(tmppath); return 1; - } } return 0; }