Subject: bin/15451: usr.bin/ftp macro behavior non-intuitive
To: None <>
From: None <>
List: netbsd-bugs
Date: 02/01/2002 14:44:58
>Number:         15451
>Category:       bin
>Synopsis:       usr.bin/ftp macro behavior non-intuitive
>Confidential:   no
>Severity:       serious
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Thu Jan 31 21:46:00 PST 2002
>Originator:     Jun-ichiro itojun Hagino
>Release:        NetBSD 1.5ZA
System: NetBSD 1.5ZA NetBSD 1.5ZA (STARFRUIT) #: Fri Feb 1 11:49:09 JST 2002 i386
Architecture: i386
Machine: i386
	with the current usr.bin/ftp, the behavior of "macdef" command is
	rather non-intuitive.
	- if you "macdef" the same macro name twice, they will be entered to
	  the macro database as a different macro.  the first one defined is
	  actually invoked on $foo (2nd and other definitions are in memory,
	  but will not be used).
	- if you define macro that expands to longer string, $n reference
	  will not work correctly.
	- repeat "macdef foo" for 16 times.  see "Limit of 16 macros have
	  already been defined." error.
	- do the following.

ftp> macdef hoge
Enter macro line by line, terminating it with a null line.

ftp> $hoge get
it will be expanded to the following three commands:
(empty string)

ftp> macdef hoge
Enter macro line by line, terminating it with a null line.

ftp> $hoge get
segmentation fault

	revisit usr.bin/ftp/domacro.c