On Wed, Nov 24, 2010 at 7:10 PM, Grissiom <[email protected]> wrote:
> ======================================
> diff --git a/fish_indent.c b/fish_indent.c
> index 5e709f2..a1eda61 100644
> --- a/fish_indent.c
> +++ b/fish_indent.c
> @@ -167,33 +167,72 @@ static int indent( string_buffer_t *out, wchar_t
> *in, int flags )
> }
>
> case TOK_REDIRECT_OUT:
> + {
> + switch( *last)
> + {
> + case L'1':
> + {
> + sb_append( out, L" >"
> );
> + break;
> + }
> +
> + case L'2':
> + {
> + sb_append( out, L" ^"
> );
> + break;
> + }
> +
> + default:
> + sb_append(
> out, L" ", last , L">");
> + }
> + break;
> + }
> +
A switch is not appropriate. The last variable might be "10", "20", etc.
> +
> case TOK_REDIRECT_IN:
> - case TOK_REDIRECT_FD:
> {
> - sb_append( out, last );
We need a space before last here to avoid having it run together with
the previous token.
> The only thing to do is deal with TOK_REDIRECT_FD. fish tokenizer
> treat _all_ TOK_REDIRECT_FD as output redirect. I'm not familiar with
> this area and have nothing to say now.
>
> It's too late to go to bed and my bran refuse to run... Take your own
> risk to apply the patch :D
It's alright, I was working on a correct patch before I saw yours. I
reviewed the tokenizer.c and fish_indent.c, so I believe I understand
how things are being parsed. I'll post the patch in a moment.
------------------------------------------------------------------------------
Increase Visibility of Your 3D Game App & Earn a Chance To Win $500!
Tap into the largest installed PC base & get more eyes on your game by
optimizing for Intel(R) Graphics Technology. Get started today with the
Intel(R) Software Partner Program. Five $500 cash prizes are up for grabs.
http://p.sf.net/sfu/intelisp-dev2dev
_______________________________________________
Fish-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/fish-users