Re: [dev] [st] Fixed -e with support for spaces

From: Joseph Xu <josephzxu_AT_gmail.com>
Date: Fri, 26 Nov 2010 18:35:58 -0500

Josh and I were discussing this over IRC. Here's an alternative patch I
came up with. It relies on the shell that executes st to parse the
arguments, so you can't run a command like st -e "touch arst", you have
to run st -e touch arst. This also means you can't have any st arguments
after the -e because they'll all be included in the command to run.
xterm also has this restriction, although for some reason it's "smart"
enough to run xterm -e "touch arst" correctly.

On 11/26/2010 05:57 PM, Josh Rickmar wrote:
> Here's a quick fix to pass the opt_cmd to $SHELL -c, which fixes a
> bug where you couldn't call -e with a command with spaces (arguments
> to that command).
>
> I earlier tried to pass the command directly to execvp() by using
> strsep to set args, but the code turned out to be far too complex
> (I think).

Received on Sat Nov 27 2010 - 00:35:58 CET

This archive was generated by hypermail 2.2.0 : Sat Nov 27 2010 - 00:48:02 CET