1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-09-20 10:53:29 +02:00

37501 (+ revise test): correct byte counts when simulating memstream via temp file

This commit is contained in:
Jun T 2016-01-04 22:29:37 -08:00 committed by Barton E. Schaefer
parent 524f802610
commit ead199291f
3 changed files with 12 additions and 7 deletions

View File

@ -1,3 +1,8 @@
2016-01-04 Barton E. Schaefer <schaefer@zsh.org>
* Jun T. (+ revise test): 37501: Src/builtin.c, Test/B03print.ztst:
correct byte counts when simulating memstream via temp file
2016-01-02 Barton E. Schaefer <schaefer@zsh.org>
* 37497: Src/builtin.c: handle NUL bytes in "printf -v".

View File

@ -4879,10 +4879,10 @@ bin_print(char *name, char **args, Options ops, int func)
#else
rewind(fout);
buf = (char *)zalloc(count + 1);
rcount = fread(buf, count, 1, fout);
rcount = fread(buf, 1, count, fout);
if (rcount < count)
zwarnnam(name, "i/o error: %e", errno);
buf[rcount] = '\0';
buf[rcount++] = '\0';
#endif
queue_signals();
stringval = metafy(buf, rcount - 1, META_REALLOC);

View File

@ -304,9 +304,9 @@
unset foo
print -v foo once more
print -r -- $foo
printf -v foo "%s-" into the breach
print -r -- $foo
typeset -p foo
printf -v foo "%s\0%s-" into the breach
typeset -p foo
0:print and printf into a variable
>once more
>into-the-breach-
>typeset foo='once more'
>typeset foo=$'into\C-@the-breach\C-@-'