summaryrefslogtreecommitdiffstats
path: root/Objects/stringobject.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/stringobject.c')
-rw-r--r--Objects/stringobject.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Objects/stringobject.c b/Objects/stringobject.c
index d40b908..ed5af57 100644
--- a/Objects/stringobject.c
+++ b/Objects/stringobject.c
@@ -818,6 +818,8 @@ formatstring(format, args)
res = getstringvalue(result) + reslen - rescnt;
}
if (sign) {
+ if (fill != ' ')
+ *res++ = sign;
rescnt--;
if (width > len)
width--;
@@ -828,7 +830,7 @@ formatstring(format, args)
*res++ = fill;
} while (--width > len);
}
- if (sign)
+ if (sign && fill == ' ')
*res++ = sign;
memcpy(res, buf, len);
res += len;