Some sed implementations are not greedy enough, use perl instead
The issue is demonstrated as follows:
On Linux:
$ echo ': foo.h /usr/include/stddef.h bar.h' | sed -e 's/ \/\(\\.\|[^ ]\)*//g'
: foo.h bar.h
On MacOS X:
$ echo ': foo.h /usr/include/stddef.h bar.h' | sed -e 's/ \/\(\\.\|[^ ]\)*//g'
: foo.husr/include/stddef.h bar.h
Perl is more consistent:
On Linux:
$ echo ': foo.h /usr/include/stddef.h bar.h' | perl -pe 's/ \/(\\.|[^ ])*//g;'
: foo.h bar.h
On MacOS X:
$ echo ': foo.h /usr/include/stddef.h bar.h' | perl -pe 's/ \/(\\.|[^ ])*//g;'
: foo.h bar.h
Reviewed-by: Andy Polyakov <appro@openssl.org>
parent
178da244
Please register or sign in to comment