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

removing the bug from ns



Dear ns-users,

I would like to describe you one problem in ns, which could be solved
very simply. 

When adding Tcl code to ns, it should be added by adding tcl file names
to ns-lib.tcl (if I properly understand the documentation). If the name
of the added tcl file is added to ns-lib.tcl with space characters on
the end of the name (usually invisible), the execution of ns is
unpossible (even when the compilation is without errors).

The problem can be easily solved by changing tcl-expand.tcl in the
following part:

if { [llength $L] == 2 && [lindex $L 0] == "source" } {
	expand_file [lindex $L 1]
	} else {
	puts $line
	}

If the name of the tcl file in the ns-lib.tcl is ended by space
characters, [llength $L] is eqal to 3 and then this file is not sourced
by tcl-expand.tcl. So I think the problem could be solved by changing
"==2" to ">= 2", (it works as I tested it) even when it not indicates
the error when somebody wanted to add some additional arguments in the
"source" lines of the ns-lib.tcl.


Ivan Fellner