[Top][All Lists]

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

Re: [Nmh-workers] mhshow display bug

From: David Levine
Subject: Re: [Nmh-workers] mhshow display bug
Date: Sat, 12 Apr 2014 11:06:07 -0400

Paul F. wrote:

> the %s isn't getting dropped -- it's getting expanded to an empty
> string.  i.e., at this point, at the end of parse_display_string():
>         snprintf (buffer, buflen, ct->c_termproc, term);
> the value of term is an empty string, and the value of ct->c_termproc
> is this:
>       %s | /usr/bin/iconv -f ISO-8859-1 -t UTF-8 | less
> term is an empty string because the only thing in cp at the start of
> parse_display_string() (cp is expanded to buffer, which is in turn
> copied to term) is "%l".  the %l that gets consumed along the way, as
> you say, creating no output.
> continuing back, the reason cp contains just "%l" at the start of
> parse_display_string() is this snippet, in show_text():
>         if (concatsw)
>             snprintf(buffer, sizeof(buffer), "%%l");
>         else
>             snprintf (buffer, sizeof(buffer), "%%l%s %%F", progsw ? progsw :
>                       moreproc && *moreproc ? moreproc : DEFAULT_PAGER);
> if the concatsw test weren't there, then cp would be "%lless %F", which
> is the command that should eventually be expanded into the %s in my
> configured display filter.

OK, I can reproduce it now.  "%%l" obviously works in the common case
but I don't if it should be changed all the time, or not used when
there's a ct->c_termproc, i.e.,

    if (concatsw  &&  ! ct->c_termproc)

Or if parse_display_string() show look for the empty buffer when
appending c_termproc?  (Definitely my last choice.)

I'll leave this for Ken.  While this is probably redundant given your
explanation above, here's what my debug statements printed out:

  uip/mhshowsbr.c:517; concatsw=0, cp=%lcat %F
  uip/mhshowsbr.c:1018; end of parse_display_string(), buffer=cat 
'/tmp/mhshowFwSznm' | /usr/bin/iconv -f ISO-8859-1 -t UTF-8 | less

  uip/mhshowsbr.c:517; concatsw=1, cp=%l
  uip/mhshowsbr.c:1018; end of parse_display_string(), buffer= | /usr/bin/iconv 
-f ISO-8859-1 -t UTF-8 | less
  /bin/sh: -c: line 0: syntax error near unexpected token `|'
  /bin/sh: -c: line 0: ` | /usr/bin/iconv -f ISO-8859-1 -t UTF-8 | less "$@"'


reply via email to

[Prev in Thread] Current Thread [Next in Thread]