- priority: 5 --> 2
- status: open --> closed-fixed
OriginalBugID: 2145 RFE
Version: 8.1
SubmitDate: '1999-06-03'
LastModified: '1999-12-09'
Severity: MED
Status: Released
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 1726
OS: AIX
Machine: RS6000
FixedDate: '1999-12-09'
FixedInVersion: 8.3b1
ClosedDate: '2000-10-25'
Name:
Phil Dietz
DesiredBehavior:
Many people would like to see Octal conversion be optional.
Donal Fellows has posted a strtol_magic function on dejanews.com that
does just that.
Thanks.
PatchFiles:
long strtol_magic(const char *str, char **endptr, int base) {
extern int noOctal;
if (base!=0 || noOctal!=0 || (str[0]=='0' && str[1]=='x')) {
return strtol(str, endptr, base);
} else {
return strtol(str, endptr, 10);
}
}
This is being seriously considered for 8.3. It would be better
if it came as a drop-in patch to 8.2.0 that supported some sort
of tcl_useOctal var that maintained the old behavior by default.
-- 08/20/1999 hobbs
Tcl 8.3 has greatly improved error messages for octals (if you
made an error because of a bad octal, you'll know it without
question). The idea of a global switch to perterb behavior was
not generally popular, so we're going with the better error
messages, and may consider something else for Tcl9, when we
can be more lax on backwards compatibility.
-- 12/09/1999 hobbs