diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/parser.cpp | 20 | ||||
-rw-r--r-- | src/spawn.cpp | 5 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/parser.cpp b/src/parser.cpp index f05f167..941db49 100644 --- a/src/parser.cpp +++ b/src/parser.cpp @@ -388,6 +388,7 @@ bool StringBuildingMachine::input(gchar chr, gchar *&result) { QRegister *reg; + gchar *str; switch (mode) { case MODE_UPPER: @@ -450,13 +451,17 @@ StateCtlE: undo.push_obj(qregspec_machine) = new QRegSpecMachine; set(&&StateCtlENum); break; + case 'U': + undo.push_obj(qregspec_machine) = new QRegSpecMachine; + set(&&StateCtlEU); + break; case 'Q': undo.push_obj(qregspec_machine) = new QRegSpecMachine; set(&&StateCtlEQ); break; - case 'U': + case '@': undo.push_obj(qregspec_machine) = new QRegSpecMachine; - set(&&StateCtlEU); + set(&&StateCtlEQuote); break; default: result = (gchar *)g_malloc(3); @@ -497,6 +502,17 @@ StateCtlEQ: result = reg->get_string(); return true; +StateCtlEQuote: + if (!qregspec_machine->input(chr, reg)) + return false; + + undo.push_obj(qregspec_machine) = NULL; + set(StateStart); + str = reg->get_string(); + result = g_shell_quote(str); + g_free(str); + return true; + StateEscaped: set(StateStart); result = String::chrdup(chr); diff --git a/src/spawn.cpp b/src/spawn.cpp index 9ea3919..0722180 100644 --- a/src/spawn.cpp +++ b/src/spawn.cpp @@ -209,6 +209,11 @@ parse_shell_command_line(const gchar *cmdline, GError **error) * \(lq0,128ED\(rq, and is recommended when writing cross-platform * macros using the EC command. * + * When using an UNIX-compatible shell or the UNIX98 shell emulation, + * you might want to use the \fB^E@\fP string-building character + * to pass Q-Register contents reliably as single arguments to + * the spawned process. + * * The spawned process inherits both \*(ST's current working * directory and its environment variables. * More precisely, \*(ST uses its environment registers |