summaryrefslogtreecommitdiffstats
path: root/generic/tclStringObj.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2017-06-29 13:18:33 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2017-06-29 13:18:33 (GMT)
commit5a901cd82780d88b242ecb0b4b08169c771aa467 (patch)
tree85e81ace2a92823af6b8edfb58836b176666db0e /generic/tclStringObj.c
parent6f051ae485f04ee08a667226febf869a38dfced1 (diff)
parentf5cec2b1ff8efe0e8ebd0c5f5b121ae0bf8055bb (diff)
downloadtcl-jn_0d_radix_prefix.zip
tcl-jn_0d_radix_prefix.tar.gz
tcl-jn_0d_radix_prefix.tar.bz2
Diffstat (limited to 'generic/tclStringObj.c')
-rw-r--r--generic/tclStringObj.c23
1 files changed, 7 insertions, 16 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 6457eb3..54edb06 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2036,14 +2036,9 @@ Tcl_AppendFormatToObj(
Tcl_AppendToObj(segment, "0o", 2);
segmentLimit -= 2;
break;
- case 'X':
-#if TCL_MAJOR_VERSION < 9
- Tcl_AppendToObj(segment, "0X", 2);
- segmentLimit -= 2;
- break;
-#endif
case 'p':
case 'x':
+ case 'X':
Tcl_AppendToObj(segment, "0x", 2);
segmentLimit -= 2;
break;
@@ -2333,6 +2328,12 @@ Tcl_AppendFormatToObj(
errCode = "OVERFLOW";
goto errorMsg;
}
+ if (ch == 'A') {
+ char *p = TclGetString(segment) + 1;
+ *p = 'x';
+ p = strchr(p, 'P');
+ if (p) *p = 'p';
+ }
break;
}
default:
@@ -2344,16 +2345,6 @@ Tcl_AppendFormatToObj(
goto error;
}
- switch (ch) {
- case 'A': {
- char *p = TclGetString(segment);
- p[1] = 'x';
- p = strchr(p, 'P');
- if (p) *p = 'p';
- break;
- }
- }
-
if (width>0 && numChars<0) {
numChars = Tcl_GetCharLength(segment);
}