Subject: Bugs in SetEnv and UnsetEnv

From: Mikhael Goikhman <[email-masked]>
Date: Thu, 29 May 2003 22:23:48 +0000

I would like to get some feedback before I try to resolve these bugs.
These are in both 2.4.x and 2.5.x.

1) 'UnsetEnv VARNAME' does not work, the variable is not unset, instead
   it gets an empty value "". The fix is obvious, putenv should be called
   with "VARNAME" not "VARNAME=".

2) It is documented that 'SetEnv VARNAME' works like 'UnsetEnv VARNAME'.
   I don't very like such (mis)usage of SetEnv, but this is what we have.
   Anyway, this does not work. 'SetEnv VARNAME' is just ignored, because
   I believe the action string is already destroyed when CMD_UnsetEnv is
   called.

3) 'SetEnv VARNAME ""' does not work as expected, it is ignored.
   It seems that GetNextToken is bad at parsing an empty quoted string.

Dominik, any comments?

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL:http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked]

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 30 May 2003 09:38:19 +0200

>    with "VARNAME" not "VARNAME=".

Should be easy to fix without side effects.

>    I believe the action string is already destroyed when CMD_UnsetEnv is

If it does not work anyway, we should remove that section from the
man page.

>    It seems that GetNextToken is bad at parsing an empty quoted string.

Should be fixed.

Bye

Dominik ^_^  ^_^

---

From: Dominik Vogt <[email-masked]>
Date: Fri, 30 May 2003 11:17:22 +0200

> Should be easy to fix without side effects.

Or maybe not.  The behaviour of calling putenv() with just a
variable name is not defined according to the man page on my
Debian system.  The unsetenv() function is designed for that
purpose, but it does not exist on all systems.

Bye

Dominik ^_^  ^_^

---

From: Mikhael Goikhman <[email-masked]>
Date: Fri, 30 May 2003 15:55:56 +0000

> Should be easy to fix without side effects.

As you said in another message, it's not so easy. Probably we should try
both putenv("VARNAME=") and putenv("VARNAME"). Should wait for now.

> If it does not work anyway, we should remove that section from the

Done.

> >    It seems that GetNextToken is bad at parsing an empty quoted string.

I am more like to fall into the birthday mood instead of starting to fix
such central function like GetNextToken before the release. So it should
wait too. Not critical especially that this maybe currently emulated
by 'UnsetEnv VARNAME', i.e. bug number 1. :)

Regards,
Mikhael.