summaryrefslogtreecommitdiff
path: root/locale/programs/charmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs/charmap.c')
-rw-r--r--locale/programs/charmap.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index f76bc24709..b8e994fdac 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -120,7 +120,7 @@ charmap_read (const char *filename)
}
}
- if (result == NULL)
+ if (result == NULL && filename != NULL)
{
/* OK, one more try. We also accept the names given to the
character sets in the files. Sometimes they differ from the
@@ -155,12 +155,9 @@ charmap_read (const char *filename)
char junk[BUFSIZ];
if (fscanf (fp, " <code_set_name> %as", &name) == 1
- || (fscanf (fp, " <code_set_name> \"%as\"", &name)
- == 1)
|| fscanf (fp, "%% alias %as", &name) == 1)
{
- if (filename != NULL
- && strcasecmp (name, filename) == 0)
+ if (strcasecmp (name, filename) == 0)
break;
free (name);
@@ -189,9 +186,6 @@ charmap_read (const char *filename)
result = (cmfile == NULL
? NULL : parse_charmap (cmfile));
- if (result)
- return result;
-
break;
}
}