Index: generic/nsf.c =================================================================== diff -u -r3b608d8c845202e9e517fe45b17b2d17d55cbfc3 -r587c2fab1a2b2e3854b0ba2fe086766611c1f248 --- generic/nsf.c (.../nsf.c) (revision 3b608d8c845202e9e517fe45b17b2d17d55cbfc3) +++ generic/nsf.c (.../nsf.c) (revision 587c2fab1a2b2e3854b0ba2fe086766611c1f248) @@ -20636,10 +20636,14 @@ Nsf_ltoa(buffer+1, (long)Tcl_CallFrame_level(framePtr), &l); resultObj = Tcl_NewStringObj(buffer, l+1); } else { - /* - * If not called from an nsf frame, return 1 as default. - */ - resultObj = Tcl_NewIntObj(1); + if (level == CALLING_LEVEL) { + resultObj = Tcl_NewStringObj("#0", 2); + } else { + /* + * If not called from an nsf frame, return 1 as default. + */ + resultObj = Tcl_NewIntObj(1); + } } return resultObj;