[PATCH gccmakedep] Fix gccmakedep from mutilates arguments containing "'" or " * "

Jesse Adkins jesserayadkins at gmail.com
Fri Dec 10 18:12:38 PST 2010


On Fri, Dec 3, 2010 at 1:20 PM, Matt Turner <mattst88 at gmail.com> wrote:
> From: Peter Breitenlohner <peb at mppmu.mpg.de>
>
> Fixes https://bugs.freedesktop.org/show_bug.cgi?id=7414
> ---
>  gccmdep.cpp |   10 +++++++---
>  1 files changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/gccmdep.cpp b/gccmdep.cpp
> index ff4b12a..6c7c05f 100644
> --- a/gccmdep.cpp
> +++ b/gccmdep.cpp
> @@ -32,7 +32,9 @@ while [ $# != 0 ]; do
>     else
>        case "$1" in
>            -D*|-I*|-U*)
> -               args="$args '$1'"
> +XCOMM arg may contain single quotes
> +               qarg=`echo "$1" | sed "s/'/'\\\\\\\\''/g"`
> +                args="$args '$qarg'"
>                ;;
>            -g*|-O*)
>                ;;
> @@ -74,7 +76,8 @@ XCOMM ignore these flags
>                            echo "Unknown option '$1' ignored" 1>&2
>                            ;;
>                        *)
> -                           files="$files $1"
> +XCOMM filename may contain blanks
> +                           files="$files '$1'"
>                            ;;
>                    esac
>                fi
> @@ -115,7 +118,8 @@ CMD="$CC -M $args $files"
>  if [ X"$makefile" != X- ]; then
>     CMD="$CMD >> $TMP"
>  fi
> -eval $CMD
> +XCOMM Do not wilcard expand '*' in args
> +eval "$CMD"
>  if [ X"$makefile" != X- ]; then
>     $RM ${makefile}.bak
>     $MV $makefile ${makefile}.bak
> --
> 1.7.2.2
>
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
>

Reviewed-by: Jesse Adkins <jesserayadkins at gmail.com>


More information about the xorg-devel mailing list