summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2017-06-29 11:19:39 (GMT)
committerdgp <dgp@users.sourceforge.net>2017-06-29 11:19:39 (GMT)
commitdc423cbb0f73bd96b52a63f446b2c96204ebf703 (patch)
treecfcdd94fc3ea6e1836a599bf6c6d9a22d1339ea0
parent9bbcda6793ebf1d466c034f4b63342abaafcd2dc (diff)
parent073ff3c5fe40eeac93ae5508b647a7019006f431 (diff)
downloadtcl-dc423cbb0f73bd96b52a63f446b2c96204ebf703.zip
tcl-dc423cbb0f73bd96b52a63f446b2c96204ebf703.tar.gz
tcl-dc423cbb0f73bd96b52a63f446b2c96204ebf703.tar.bz2
merge 8.6
-rw-r--r--generic/tclStringObj.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/generic/tclStringObj.c b/generic/tclStringObj.c
index 4a3b6f1..c84b500 100644
--- a/generic/tclStringObj.c
+++ b/generic/tclStringObj.c
@@ -2027,8 +2027,11 @@ Tcl_AppendFormatToObj(
segmentLimit -= 1;
precision--;
break;
- case 'x':
case 'X':
+ Tcl_AppendToObj(segment, "0X", 2);
+ segmentLimit -= 2;
+ break;
+ case 'x':
Tcl_AppendToObj(segment, "0x", 2);
segmentLimit -= 2;
break;
@@ -2192,7 +2195,11 @@ Tcl_AppendFormatToObj(
}
digitOffset = (int) (bits % base);
if (digitOffset > 9) {
- bytes[numDigits] = 'a' + digitOffset - 10;
+ if (ch == 'X') {
+ bytes[numDigits] = 'A' + digitOffset - 10;
+ } else {
+ bytes[numDigits] = 'a' + digitOffset - 10;
+ }
} else {
bytes[numDigits] = '0' + digitOffset;
}
@@ -2314,14 +2321,6 @@ Tcl_AppendFormatToObj(
goto error;
}
- switch (ch) {
- case 'E':
- case 'G':
- case 'X': {
- Tcl_SetObjLength(segment, Tcl_UtfToUpper(TclGetString(segment)));
- }
- }
-
if (width>0 && numChars<0) {
numChars = Tcl_GetCharLength(segment);
}