Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: typeset -T shouldn't cause an exit.



On Wed, 10 Apr 2013 15:59:10 +0000
Larry Schrof <larrys@xxxxxx> wrote:
? In my .zshenv, I tie LD_LIBRARY_PATH<->ld_library_path and
> CLASSPATH<->classpath.
> 
> The problem is that typeset -T causes a fatal exit 126 if one attempts to
> tie
> variables that are already tied. (Fatal meaning that it stops sourcing
> my .zshenv at that line; it does not continue reading.) This seems both
> overly
> harsh and inconvenient.
> 
> Can we fix this behavior so that at worst a warning is issued and zsh
> continues along happily?

That seems entirely reasonable, but note you only get the error if it
was tied to something else before, so it's not 100% benign.

diff --git a/Src/builtin.c b/Src/builtin.c
index d91c2d9..cd88643 100644
--- a/Src/builtin.c
+++ b/Src/builtin.c
@@ -2470,7 +2470,7 @@ bin_typeset(char *name, char **argv, Options ops, int func)
 			setsparam(asg0.name, ztrdup(asg0.value));
 		    return 0;
 		} else {
-		    zerrnam(name, "can't tie already tied scalar: %s",
+		    zwarnnam(name, "can't tie already tied scalar: %s",
 			    asg0.name);
 		}
 		return 1;

pws



Messages sorted by: Reverse Date, Date, Thread, Author