diff options
Diffstat (limited to 'src/cups/genppd.c')
-rw-r--r-- | src/cups/genppd.c | 44 |
1 files changed, 4 insertions, 40 deletions
diff --git a/src/cups/genppd.c b/src/cups/genppd.c index 53b970d..0c8830d 100644 --- a/src/cups/genppd.c +++ b/src/cups/genppd.c @@ -55,6 +55,7 @@ #include <ctype.h> #include <errno.h> #include <libgen.h> +#include <strings.h> #if defined(HAVE_VARARGS_H) && !defined(HAVE_STDARG_H) #include <varargs.h> #else @@ -224,13 +225,6 @@ static int write_ppd(gpFile fp, const stp_printer_t *p, * 'main()' - Process files on the command-line... */ -const char slang_c[] = "LANG=C"; -const char slcall_c[] = "LC_ALL=C"; -const char slcnumeric_c[] = "LC_NUMERIC=C"; -char lang_c[sizeof(slang_c) + 1]; -char lcall_c[sizeof(slcall_c) + 1]; -char lcnumeric_c[sizeof(slcnumeric_c) + 1]; - int /* O - Exit status */ main(int argc, /* I - Number of command-line arguments */ char *argv[]) /* I - Command-line arguments */ @@ -239,12 +233,9 @@ main(int argc, /* I - Number of command-line arguments */ * Force POSIX locale, since stp_init incorrectly calls setlocale... */ - strcpy(lang_c, slang_c); - strcpy(lcall_c, slcall_c); - strcpy(lcnumeric_c, slcnumeric_c); - putenv(lang_c); - putenv(lcall_c); - putenv(lcnumeric_c); + (void) setenv("LANG", "C", 1); + (void) setenv("LC_ALL", "C", 1); + (void) setenv("LC_NUMERIC", "C", 1); /* * Initialise libgutenprint @@ -2431,33 +2422,6 @@ write_ppd( } stp_parameter_description_destroy(&desc); - /* Constraints */ - stp_describe_parameter(v, "PPDUIConstraints", &desc); - if (desc.is_active && desc.p_type == STP_PARAMETER_TYPE_STRING_LIST) - { - num_opts = stp_string_list_count(desc.bounds.str); - if (num_opts > 0) - { - gpputs(fp, "*% ===== Constraints ===== \n"); - for (i = 0; i < num_opts; i++) - { - char *opt1, *opt2; - opt = stp_string_list_param(desc.bounds.str, i); - opt1 = stp_strdup(opt->text); - opt2 = strrchr(opt1, '*'); - if (opt2) - { - opt2[-1] = 0; - gpprintf(fp, "*%s: %s %s\n", opt->name, opt1, opt2); - gpprintf(fp, "*%s: %s %s\n", opt->name, opt2, opt1); - } - stp_free(opt1); - } - gpputs(fp, "\n"); - } - } - stp_parameter_description_destroy(&desc); - if (!language) { /* |