Index: generic/tclScan.c
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tclScan.c,v
retrieving revision 1.12
diff -u -r1.12 tclScan.c
--- generic/tclScan.c	25 Feb 2002 15:23:02 -0000	1.12
+++ generic/tclScan.c	18 Aug 2004 23:30:07 -0000
@@ -371,9 +371,7 @@
 	switch (ch) {
 	case 'l':
 	case 'L':
-#ifndef TCL_WIDE_INT_IS_LONG
 	    flags |= SCAN_LONGER;
-#endif
 	case 'h':
 	    format += Tcl_UtfToUniChar(format, &ch);
 	}
@@ -704,9 +702,7 @@
 	switch (ch) {
 	case 'l':
 	case 'L':
-#ifndef TCL_WIDE_INT_IS_LONG
 	    flags |= SCAN_LONGER;
-#endif
 	    /*
 	     * Fall through so we skip to the next character.
 	     */
@@ -1041,7 +1037,8 @@
 			    sprintf(buf, "%lu", value); /* INTL: ISO digit */
 			    objPtr = Tcl_NewStringObj(buf, -1);
 			} else {
-			    if ((unsigned long) value > UINT_MAX) {
+			    if ((flags & SCAN_LONGER)
+				    || (unsigned long) value > UINT_MAX) {
 				objPtr = Tcl_NewLongObj(value);
 			    } else {
 				objPtr = Tcl_NewIntObj(value);
