summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'options.c')
-rw-r--r--options.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/options.c b/options.c
index 777ba50..f69d0cb 100644
--- a/options.c
+++ b/options.c
@@ -34,10 +34,10 @@
/* Values from foomatic keywords in the ppd file */
char printer_model [256];
-char printer_id [128];
+char printer_id [256];
char driver [128];
-char cmd [1024];
-char cmd_pdf [1024];
+char cmd [4096];
+char cmd_pdf [4096];
dstr_t *postpipe = NULL; /* command into which the output of this
filter should be piped */
int ps_accounting = 1;
@@ -677,7 +677,8 @@ char * get_valid_value_string(option_t *opt, const char *value)
/* Check if "value" is a predefined choice (except for "Custom", which is
* not really a predefined choice, but an error if used without further
* parameters) */
- if (strcmp(value, "Custom") != 0 && (choice = option_find_choice(opt, value)))
+ if ((strcmp(value, "Custom") != 0 || strcmp(opt->name, "PageSize") == 0) &&
+ (choice = option_find_choice(opt, value)))
return strdup(choice->value);
if (opt->type == TYPE_ENUM) {
@@ -751,7 +752,7 @@ void build_foomatic_custom_command(dstr_t *cmd, option_t *opt, const char *value
{
choice_t *choice = option_find_choice(opt, "Custom");
char ** paramvalues = paramvalues_from_string(opt, values);
- char width[30], height[20];
+ char width[30], height[30];
int pos;
assert(choice);
@@ -765,7 +766,7 @@ void build_foomatic_custom_command(dstr_t *cmd, option_t *opt, const char *value
if ((pos = dstrreplace(cmd, "%0", width, 0)) < 0)
pos = dstrreplace(cmd, "0", width, 0);
- if ((pos = dstrreplace(cmd, "%1", height, pos) < 0))
+ if (dstrreplace(cmd, "%1", height, pos) < 0)
dstrreplace(cmd, "0", height, pos);
free_paramvalues(opt, paramvalues);
@@ -1215,7 +1216,7 @@ void option_set_choice(option_t *opt, const char *name, const char *text,
}
if (!startswith(code, "%% FoomaticRIPOptionSetting"))
- unhtmlify(choice->command, 1024, code);
+ unhtmlify(choice->command, 65536, code);
}
/*
@@ -1529,10 +1530,10 @@ void read_ppd_file(const char *filename)
unhtmlify(postpipe->data, postpipe->alloc, value->data);
}
else if (strcmp(key, "FoomaticRIPCommandLine") == 0) {
- unhtmlify(cmd, 1024, value->data);
+ unhtmlify(cmd, 4096, value->data);
}
else if (strcmp(key, "FoomaticRIPCommandLinePDF") == 0) {
- unhtmlify(cmd_pdf, 1024, value->data);
+ unhtmlify(cmd_pdf, 4096, value->data);
}
else if (strcmp(key, "FoomaticRIPNoPageAccounting") == 0) {
/* Boolean value */
@@ -1742,7 +1743,7 @@ int ppd_supports_pdf()
* line */
if (startswith(cmd, "gs"))
{
- strncpy(cmd_pdf, cmd, 1024);
+ strncpy(cmd_pdf, cmd, 4096);
return 1;
}