aboutsummaryrefslogtreecommitdiff
path: root/file_io/os2/readwrite.c
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2003-05-01 03:16:30 +0000
committerJeff Trawick <trawick@apache.org>2003-05-01 03:16:30 +0000
commit6637f8e2561ec6f3d6b7f9a82466e871a53c9546 (patch)
tree4bc0d25765671b41d8ce1a2686fd3530059b4a70 /file_io/os2/readwrite.c
parentbc54f5e3fb1dd7c13b122104f3ed3a2179f7f72e (diff)
downloadapr-6637f8e2561ec6f3d6b7f9a82466e871a53c9546.tar.gz
apr-6637f8e2561ec6f3d6b7f9a82466e871a53c9546.zip
apr_file_gets(): Return APR_SUCCESS if any characters are
returned. Any I/O errors or EOF will be reported on the next call. Callers that are coded to expect returned data + APR_EOF when there is no final newline are affected by this change. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@64498 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'file_io/os2/readwrite.c')
-rw-r--r--file_io/os2/readwrite.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/file_io/os2/readwrite.c b/file_io/os2/readwrite.c
index 20c298742..6121ebc5a 100644
--- a/file_io/os2/readwrite.c
+++ b/file_io/os2/readwrite.c
@@ -349,6 +349,12 @@ APR_DECLARE(apr_status_t) apr_file_gets(char *str, int len, apr_file_t *thefile)
}
}
str[i] = 0;
+ if (i > 0) {
+ /* we stored chars; don't report EOF or any other errors;
+ * the app will find out about that on the next call
+ */
+ return APR_SUCCESS;
+ }
return rv;
}