This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: A question on ACX_BUGURL


On Mon, Mar 26, 2007 at 04:03:28PM +0200, Paolo Bonzini wrote:
> H. J. Lu wrote:
> > On Mon, Mar 26, 2007 at 09:13:30AM +0200, Paolo Bonzini wrote:
> >> Please do this instead:
> >>
> >>   REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
> >>
> > 
> > Will it work with spaces in $BUGURL?
> 
> Yes, it will.  You need quoting in the echo command, but
> not in the variable assignment.  Quoting both the echo
> command-line and the variable assignment is not portable.
> 
> Variable assignments (and case statements, as Andreas
> pointed out) do not perform word splitting of variables.
> 

Here it is.


H.J.
----
2007-03-26  H.J. Lu  <hongjiu.lu@intel.com>

	* acx.m4 (ACX_BUGURL): Set BUGURL first. Quote $BUGURL first
	when setting REPORT_BUGS_TEXI.

--- config/acx.m4.url	2007-03-24 09:18:59.000000000 -0700
+++ config/acx.m4	2007-03-26 07:21:24.000000000 -0700
@@ -577,16 +577,23 @@ AC_DEFUN([ACX_BUGURL],[
                    [Direct users to URL to report a bug]),
     [case "$withval" in
       yes) AC_MSG_ERROR([bug URL not specified]) ;;
-      no)  REPORT_BUGS_TO="";
-	   REPORT_BUGS_TEXI=""
+      no)  BUGURL=
 	   ;;
-      *)   REPORT_BUGS_TO="<$withval>"
-	   REPORT_BUGS_TEXI="@uref{`echo $withval | sed 's/@/@@/g'`}"
+      *)   BUGURL="$withval"
 	   ;;
      esac],
-     REPORT_BUGS_TO="<$1>"
-     REPORT_BUGS_TEXI="@uref{`echo $1 | sed 's/@/@@/g'`}"
+     BUGURL="$1"
   )
+  case ${BUGURL} in
+  "")
+    REPORT_BUGS_TO=
+    REPORT_BUGS_TEXI=
+    ;;
+  *)
+    REPORT_BUGS_TO="<$BUGURL>"
+    REPORT_BUGS_TEXI=@uref{`echo "$BUGURL" | sed 's/@/@@/g'`}
+    ;;
+  esac;
   AC_SUBST(REPORT_BUGS_TO)
   AC_SUBST(REPORT_BUGS_TEXI)
 ])


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]