bug-sh-utils
[Top][All Lists]
Advanced

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

Re: (no subject)


From: Bob Proulx
Subject: Re: (no subject)
Date: Sun, 26 Oct 2003 10:45:44 -0700
User-agent: Mutt/1.3.28i

Let me redirect you to <address@hidden>.  I am sure that
someone there would have comment about your issue with sed.

Please be sure to include a subject line as noted in the 'sed'
information.  Your message to bug-shellutils did not have a subject.
Thanks,
Bob

  sed --version

  E-mail bug reports to: address@hidden .
  Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

address@hidden wrote:
> Subject Brokenness in sed
> 
> I've searched around and this is apparently a very old problem.
> When you join two lines into the pattern space with the 'N'
> command, an insertion should precede all the text in the
> current pattern.  It does on every UNIX box I have access to,
> except for GNU's sed program.  Further, there is no option for
> either normalizing or "ab-normalizing" the behavior.  This is
> a bug.  It needs to be possible to get normal behavior, preferably
> without having to specify an ``--insert-normally'' option.
> 
> Here is a short script (from the GCC fixinclude stuff) that
> demonstrates the problem.
> 
> #! /bin/ksh
> 
> res=test-$$
> 
> # # # # # # # INPUT FILE:
> #
> cat > ${res}-in.h <<'_EOF_'
> #ifndef TEST
> #define TEST
> 
> extern "C++" {
> inline void *memchr(void *__1, int __2, size_t __3)
>       { return (void *)memchr((const void *)__1, __2, __3); }
> inline char *strstr(char *__1, const char *__2)
>       { return (char *)strstr((const char *)__1, __2); }
> }
> 
> #endif /* TEST */
> _EOF_
> 
> # # # # # # # RESULT FILE:
> #
> cat > ${res}-samp.h <<'_EOF_'
> #ifndef TEST
> #define TEST
> 
> #ifndef __GNUC__
> extern "C++" {
> inline void *memchr(void *__1, int __2, size_t __3)
>       { return (void *)memchr((const void *)__1, __2, __3); }
> inline char *strstr(char *__1, const char *__2)
>       { return (char *)strstr((const char *)__1, __2); }
> }
> #endif /* ! __GNUC__ */
> 
> #endif /* TEST */
> _EOF_
> 
> # # # # # # # OUTPUT FILE:
> #
> SED=${SED:-$PWD/=b/sed/sed}
> [ -x ${SED} ] || SED=`which sed`
> 
> cmd='/extern "C\+\+"/N
>      /inline void.*memchr/i\
> #ifndef __GNUC__
>      /return.*strstr/N
>      /return.*strstr.*}/a\
> #endif /* ! __GNUC__ */'
> 
> ${SED} "${cmd}" ${res}-in.h > ${res}-out.h
> 
> if cmp ${res}-samp.h ${res}-out.h > /dev/null
> then
>   exitcode=0
>   echo "'sed' works correctly"
> else
>   echo "INVALID RESULT"
>   exitcode=1
> fi
> rm -f ${res}-*
> exit $exitcode




reply via email to

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