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

user/961: m4: len(`') returns `'




>Number:         961
>Category:       user
>Synopsis:       m4: len(`') returns `'
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    bugs
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Nov  2 09:40:01 MST 1999
>Last-Modified:
>Originator:     Claus Assmann
>Organization:
endmail.ORG
>Release:        OpenBSD 2.6
>Environment:
	System      : OpenBSD 2.6
	Architecture: OpenBSD.i386
	Machine     : i386
>Description:

the len function in /usr/bin/m4 returns an empty string
if given an empty string as argument instead of 0.


>How-To-Repeat:

$ echo 'len()' | m4

$ echo 'len()' | gm4
0

>Fix:
	
Patch (fixes this problem, side-effects unknown...)

--- eval.c	Mon Aug  2 21:53:42 1999
+++ /usr/src/usr.bin/m4/eval.c	Mon Sep  7 15:09:13 1998
@@ -97,7 +97,7 @@
   * have macro-or-builtin() type call. We adjust
   * argc to avoid further checking..
   */
-	if (argc == 3 && !*(argv[2]) && (td & ~STATIC) != LENGTYPE)
+	if (argc == 3 && !*(argv[2]))
 		argc--;
 
 	switch (td & ~STATIC) {

>Audit-Trail:
>Unformatted: