--- a/src/foomatic-rip.c Tue Jun 03 19:45:58 2008 +0200
+++ b/src/foomatic-rip.c Wed Jun 04 11:38:31 2008 +0200
@@ -330,7 +330,7 @@ cups_split_options_parameters(const char
}
else
{
- option->name = key_value[0];
+ option->name = options_splitted[i];
option->value = g_strdup("");
}
@@ -525,6 +525,8 @@ send_job_to_ghostscript(const char *inpu
char *gs_stdout;
char *gs_stderr;
int gs_exit_status;
+ unsigned int i;
+ unsigned int flags;
#if 0
/* If the filename is not defined, then read the stdin */
@@ -541,9 +543,24 @@ send_job_to_ghostscript(const char *inpu
}
#endif
+ /* Parse any argument, and rewrite if we need to modify it */
+ if (strcmp(gs_argv[0], "gs") == 0)
+ {
+ /* replace it by the foomatic-wrapper */
+ g_free(gs_argv[0]);
+ gs_argv[0] = g_strdup("foomatic-gswrapper");
+ }
+ for (i=1; gs_argv[i]; i++)
+ {
+ if (strcmp(gs_argv[i], "-sOutputFile=-") == 0)
+ {
+ //g_free(gs_argv[i]);
+ //gs_argv[i] = g_strdup("-sOutputFile=/tmp/a.ps");
+ }
+ }
+
if (0)
{
- unsigned int i;
trace("argv:\n");
for (i=0; gs_argv[i]; i++)
{
@@ -565,10 +582,11 @@ send_job_to_ghostscript(const char *inpu
}
+ flags = G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_SEARCH_PATH | G_SPAWN_CHILD_INHERITS_STDIN;
status = g_spawn_sync(NULL, /* working_directory */
gs_argv, /* argv */
NULL, /* envp */
- G_SPAWN_LEAVE_DESCRIPTORS_OPEN | G_SPAWN_SEARCH_PATH | G_SPAWN_CHILD_INHERITS_STDIN, /* flags */
+ flags, /* flags */
NULL, /* child_setup */
NULL, /* user_data */
&gs_stdout, /* standard_output */
@@ -590,7 +608,7 @@ send_job_to_ghostscript(const char *inpu
trace("exit_status = %d\n", gs_exit_status);
/* Job terminated */
- trace("standard_output:\n%s\n", gs_stdout);
+ trace("gs_stdout (len=%z):\n%s\n", gs_stdout);
trace("gs_stderr:\n%s\n", gs_stderr);
g_free(gs_stdout);