Re: How to add subshell support for ash



On Sun, Mar 04, 2012 at 03:19:52PM +0100, Alexander Kriegisch wrote:
> I know how to do this via shell script, but not cleanly via C, sorry.
> 
you could start by posting the sh code as text or a comment ...

>   - Plese refer to code comments for how and why I implemented the
>     precmd via PS1 with two-fold indirection.
>
as ash is as close to pure posix as it gets, this pretty much qualifies
as a generic solution. one could even remove the paths for the other
bourne-compatible shells (except that they are less hacky) ...

> Remark: In order to get ENV into the environment for the init file, I
> had to uncomment "g_free (putenv_str)".
>
that sounds like adding a memory leak. you need to move, not remove the
free.  but then, i don't know that code, maybe there is already a second
cleanup path.

> I hope you are interested in this feature
> 
totally. but i'm only a lurker ...

> +                    // A: This leads to a stopped subshell (=frozen mc) if user calls "sh" command
>
please fix the indentation and avoid c99/c++ comments.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]