Hi Peter,

* Peter Rosin wrote on Fri, Oct 01, 2010 at 11:22:54PM CEST:
> Subject: [PATCH] cwrapper: split long lines when dumping the wrapper script.
> 
> * libltdl/config/ltmain.m4sh (func_emit_cwrapperexe_src): If
> the wrapper script contains long lines, split them for
> readability and to conform with C standards.

OK with me with nits addressed.  I see this as a fairly straightforward
way to work around the issue; we can still think about following Chuck's
proposal in due course even with this in place.

Nit 1: testsuite exposure.  Should be fairly straightforward to set
  PATH=$PATH$PATH_SEPARATOR$PATH

a couple of times until long enough (but not too long so that
environment plus command line length already go over the limit), then
build a library and a program linked against it, covering the path that
failed for you, no?

Thanks,
Ralf

> --- a/libltdl/config/ltmain.m4sh
> +++ b/libltdl/config/ltmain.m4sh
> @@ -4268,9 +4268,14 @@ void lt_dump_script (FILE* f)
>  {
>  EOF
>           func_emit_wrapper yes |
> -              $SED -e 's/\([\\"]\)/\\\1/g' \
> -                -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
> -
> +           $SED -n -e '
> +s/^\(.\{79\}\)\(..*\)/\1\n\2/

\n is portable only in the regex part, but not in the replacement part.
For that you need backslash then literal newline.

> +h
> +s/\([\\"]\)/\\\1/g
> +s/$/\\n/
> +s/\([^\n]*\).*/  fputs ("\1", f);/p

Why not above, right after h, do s/\n.*// and then simplify this s
command?

> +g
> +D'
>              cat <<"EOF"
>  }
>  EOF

Reply via email to