summaryrefslogtreecommitdiff
path: root/extra/locale/gen_locale.c
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-08 18:40:40 +0000
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2008-10-08 18:40:40 +0000
commit6f98f3f2bb89fdc5096b882c6599078c21ba5df1 (patch)
tree19a0aec7393a8949ef9e184aa9e48dd3bc738fe3 /extra/locale/gen_locale.c
parentb60e6c916c4e10d970303a7a5b419210797709e6 (diff)
- fix building locale (pre- and generated, even parallel)
Diffstat (limited to 'extra/locale/gen_locale.c')
-rw-r--r--extra/locale/gen_locale.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/extra/locale/gen_locale.c b/extra/locale/gen_locale.c
index 31df4156e..200e63095 100644
--- a/extra/locale/gen_locale.c
+++ b/extra/locale/gen_locale.c
@@ -554,7 +554,8 @@ static int le_cmp(const void *a, const void *b)
int main(int argc, char **argv)
{
- if ((argc != 2) || (!(fp = fopen(*++argv, "r")))) {
+ char *output_file = "locale_tables.h";
+ if ((argc < 2 || argc > 3) || (!(fp = fopen(*++argv, "r")))) {
printf("error: missing filename or file!\n");
return EXIT_FAILURE;
}
@@ -580,9 +581,11 @@ int main(int argc, char **argv)
);
}
#endif
-
- if (!(ofp = fopen("locale_tables.h", "w"))) {
- printf("error: can not open locale_tables.h for writing!\n");
+ if (argc == 3)
+ output_file = *++argv;
+ if (output_file == NULL || !(ofp = fopen(output_file, "w"))) {
+ printf("error: can not open outputfile '%s' for writing!\n",
+ output_file);
return EXIT_FAILURE;
}