diff options
author | Guido van Rossum <guido@python.org> | 1993-04-01 20:59:32 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1993-04-01 20:59:32 (GMT) |
commit | f56e3db1dd4bedc9331933504f5008a03f5d3131 (patch) | |
tree | e5dad2acc4127f93e054658c6226ecec274c2930 /Python/marshal.c | |
parent | 41ffccbba75413c64efad283da19b8038aa07dd1 (diff) | |
download | cpython-f56e3db1dd4bedc9331933504f5008a03f5d3131.zip cpython-f56e3db1dd4bedc9331933504f5008a03f5d3131.tar.gz cpython-f56e3db1dd4bedc9331933504f5008a03f5d3131.tar.bz2 |
Support for frozen scripts; added -i option.
Diffstat (limited to 'Python/marshal.c')
-rw-r--r-- | Python/marshal.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/Python/marshal.c b/Python/marshal.c index 65f7f2d..3853ff9 100644 --- a/Python/marshal.c +++ b/Python/marshal.c @@ -225,7 +225,8 @@ wr_object(x, fp) typedef WFILE RFILE; /* Same struct with different invariants */ #define r_byte(p) ((p)->fp ? getc((p)->fp) \ - : ((p)->ptr != (p)->end) ? *(p)->ptr++ : EOF) + : ((p)->ptr != (p)->end) ? \ + (unsigned char)*(p)->ptr++ : EOF) static int r_string(s, n, p) @@ -425,6 +426,19 @@ rd_object(fp) return r_object(&rf); } +object * +rds_object(str, len) + char *str; + int len; +{ + RFILE rf; + rf.fp = NULL; + rf.str = NULL; + rf.ptr = str; + rf.end = str + len; + return r_object(&rf); +} + /* And an interface for Python programs... */ static object * |