diff options
author | Guido van Rossum <guido@python.org> | 1997-08-26 20:39:54 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1997-08-26 20:39:54 (GMT) |
commit | e20aef574a1373139ae17c6c4a02d83fe5668164 (patch) | |
tree | 9212d7b645e5a2e1b77d6ff5c68673b8515d3a01 /Modules | |
parent | ab0abdcef8dac933d838cb584dd4b728c2474b1e (diff) | |
download | cpython-e20aef574a1373139ae17c6c4a02d83fe5668164.zip cpython-e20aef574a1373139ae17c6c4a02d83fe5668164.tar.gz cpython-e20aef574a1373139ae17c6c4a02d83fe5668164.tar.bz2 |
Ignore whitespace between formats (not internal to a count+format).
Diffstat (limited to 'Modules')
-rw-r--r-- | Modules/structmodule.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/Modules/structmodule.c b/Modules/structmodule.c index dbba9b4..54ca631 100644 --- a/Modules/structmodule.c +++ b/Modules/structmodule.c @@ -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') |