- free_argv(ct->conf.inputs);
- ret = create_argv(line, " ", &ct->conf.inputs);
- if (ret >= 0)
- ct->conf.inputs_num = ret;
+ if (!orig_lpr)
+ orig_lpr = ct->lpr;
+ ct->lpr = NULL;
+ cmdline = make_message("-- %s", line);
+ ret = create_shifted_argv(cmdline, " ", &argv);
+ free(cmdline);
+ if (ret < 0)
+ return ret;
+ argc = ret;
+ if (argc == 2) { /* no words (only blanks in line) */
+ free_argv(argv);
+ return 0;
+ }
+ argv[0] = para_strdup("--");
+ /*
+ * The original lpr for the interactive session has no non-option
+ * arguments. We create a fresh lpr from the words in "line" and merge
+ * it with the orignal lpr.
+ */
+ ret = lls(lls_parse(argc, argv, cmd, &argv_lpr, &errctx));
+ free_argv(argv);
+ if (ret < 0)
+ goto fail;
+ ret = lls(lls_merge(orig_lpr, argv_lpr, cmd, &ct->lpr, &errctx));
+ lls_free_parse_result(argv_lpr, cmd);
+ if (ret < 0)
+ goto fail;
+ return 1;
+fail:
+ if (errctx)
+ PARA_ERROR_LOG("%s\n", para_strerror(-ret));
+ free(errctx);
+ assert(ret < 0);