mirror of
https://github.com/python/cpython.git
synced 2025-10-17 20:28:43 +00:00
Ignore whitespace between formats (not internal to a count+format).
This commit is contained in:
parent
ab0abdcef8
commit
e20aef574a
3 changed files with 13 additions and 0 deletions
|
@ -38,6 +38,7 @@ PERFORMANCE OF THIS SOFTWARE.
|
|||
#include "mymath.h"
|
||||
|
||||
#include <limits.h>
|
||||
#include <ctype.h>
|
||||
|
||||
|
||||
/* Exception */
|
||||
|
@ -981,6 +982,8 @@ calcsize(fmt, f)
|
|||
s = fmt;
|
||||
size = 0;
|
||||
while ((c = *s++) != '\0') {
|
||||
if (isspace(c))
|
||||
continue;
|
||||
if ('0' <= c && c <= '9') {
|
||||
num = c - '0';
|
||||
while ('0' <= (c = *s++) && c <= '9') {
|
||||
|
@ -1075,6 +1078,8 @@ struct_pack(self, args)
|
|||
res = restart = PyString_AsString(result);
|
||||
|
||||
while ((c = *s++) != '\0') {
|
||||
if (isspace(c))
|
||||
continue;
|
||||
if ('0' <= c && c <= '9') {
|
||||
num = c - '0';
|
||||
while ('0' <= (c = *s++) && c <= '9')
|
||||
|
@ -1179,6 +1184,8 @@ struct_unpack(self, args)
|
|||
str = start;
|
||||
s = fmt;
|
||||
while ((c = *s++) != '\0') {
|
||||
if (isspace(c))
|
||||
continue;
|
||||
if ('0' <= c && c <= '9') {
|
||||
num = c - '0';
|
||||
while ('0' <= (c = *s++) && c <= '9')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue