autoconf-patches
[Top][All Lists]
Advanced

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

Fix for AC_SHELL_UNSET


From: Pavel Roskin
Subject: Fix for AC_SHELL_UNSET
Date: Mon, 25 Sep 2000 13:03:34 -0400 (EDT)

Hello!

If we want to document that assignments don't always affect $? we should
not rely on the opposite even if that code has no chance to be executed by
ash.

It's often easier to follow the constraints than to make assumptions that
can be wrong.

Who knows, maybe there is a shell that doesn't support unset and doesn't
change $? on assignments? I don't want to worry about it - I want to apply
this patch and forget it.

For your convenience, AC_SHELL_UNSETENV will be changed to AC_SHELL_UNSET
by a separate patch :-)

ChangeLog:
        * acgeneral.m4 (AC_SHELL_UNSET): Don't rely on assignments
        changing $?.

Regards,
Pavel Roskin

____________________
Index: acgeneral.m4
--- acgeneral.m4        Mon Sep 25 06:35:25 2000
+++ acgeneral.m4        Mon Sep 25 13:02:21 2000
@@ -804,7 +804,7 @@
 # Try to unset the env VAR, otherwise set it to
 # VALUE-IF-UNSET-NOT-SUPPORTED.  `ac_unset' must have been computed.
 define([AC_SHELL_UNSET],
-[$ac_unset $1 || test "${$1+set}" != set || $1=$2 && export $1])
+[$ac_unset $1 || test "${$1+set}" != set || { $1=$2; export $1; }])
 
 
 # AC_SHELL_MKDIR_P(PATH)
____________________





reply via email to

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