diff options
author | Jari Aalto <jari.aalto@cante.net> | 2002-07-17 14:10:11 +0000 |
---|---|---|
committer | Jari Aalto <jari.aalto@cante.net> | 2009-09-12 16:46:55 +0000 |
commit | 7117c2d221b2aed4ede8600f6a36b7c1454b4f55 (patch) | |
tree | b792f26ecca68813c51ed5ba2e381790758ef31b /builtins/evalstring.c | |
parent | f73dda092b33638d2d5e9c35375f687a607b5403 (diff) | |
download | bash-7117c2d221b2aed4ede8600f6a36b7c1454b4f55.tar.gz |
Imported from ../bash-2.05b.tar.gz.devel-base-dist
Diffstat (limited to 'builtins/evalstring.c')
-rw-r--r-- | builtins/evalstring.c | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/builtins/evalstring.c b/builtins/evalstring.c index b164e744..860a3de8 100644 --- a/builtins/evalstring.c +++ b/builtins/evalstring.c @@ -83,6 +83,7 @@ parse_and_execute_cleanup () (flags & SEVAL_NONINT) -> interactive = 0; (flags & SEVAL_INTERACT) -> interactive = 1; (flags & SEVAL_NOHIST) -> call bash_history_disable () + (flags & SEVAL_NOFREE) -> don't free STRING when finished */ int @@ -123,7 +124,7 @@ parse_and_execute (string, from_file, flags) } add_unwind_protect (pop_stream, (char *)NULL); - if (orig_string) + if (orig_string && ((flags & SEVAL_NOFREE) == 0)) add_unwind_protect (xfree, orig_string); end_unwind_frame (); @@ -320,23 +321,7 @@ cat_file (r) return -1; } - rval = 0; - while (1) - { - nr = zread (fd, lbuf, sizeof(lbuf)); - if (nr == 0) - break; - else if (nr < 0) - { - rval = -1; - break; - } - if (zwrite (1, lbuf, nr) < 0) - { - rval = -1; - break; - } - } + rval = zcatfd (fd, 1, fn); free (fn); close (fd); |