summaryrefslogtreecommitdiff
path: root/lib/sh/zgetline.c~
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sh/zgetline.c~')
-rw-r--r--lib/sh/zgetline.c~13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/sh/zgetline.c~ b/lib/sh/zgetline.c~
index 4a63a17a..f5604c50 100644
--- a/lib/sh/zgetline.c~
+++ b/lib/sh/zgetline.c~
@@ -1,7 +1,7 @@
/* zgetline - read a line of input from a specified file descriptor and return
a pointer to a newly-allocated buffer containing the data. */
-/* Copyright (C) 2008 Free Software Foundation, Inc.
+/* Copyright (C) 2008,2009 Free Software Foundation, Inc.
This file is part of GNU Bash, the Bourne Again SHell.
@@ -34,6 +34,14 @@
extern int errno;
#endif
+extern ssize_t zread __P((int, char *, size_t));
+extern ssize_t zreadc __P((int, char *));
+extern ssize_t zreadintr __P((int, char *, size_t));
+extern ssize_t zreadcintr __P((int, char *));
+
+typedef ssize_t breadfunc_t __P((int, char *, size_t));
+typedef ssize_t creadfunc_t __P((int, char *));
+
/* Initial memory allocation for automatic growing buffer in zreadlinec */
#define GET_LINE_INITIAL_ALLOCATION 16
@@ -71,7 +79,8 @@ zgetline (fd, lineptr, n, unbuffered_read)
if (retval <= 0)
{
- line[nr] = '\0';
+ if (line)
+ line[nr] = '\0';
break;
}