aboutsummaryrefslogtreecommitdiff
path: root/libio/iogetwline.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-07-25 21:09:46 +0000
committerUlrich Drepper <drepper@redhat.com>2000-07-25 21:09:46 +0000
commita3b231b751694620419c112a240fc20663015596 (patch)
tree8df1d7bac9507b25eb44fce1fb96ab5b2216997a /libio/iogetwline.c
parentd54adfd98ee51ff41ffe12214aa5ae8aee32dccf (diff)
downloadglibc-a3b231b751694620419c112a240fc20663015596.tar
glibc-a3b231b751694620419c112a240fc20663015596.tar.gz
glibc-a3b231b751694620419c112a240fc20663015596.tar.bz2
glibc-a3b231b751694620419c112a240fc20663015596.zip
Update.
* libio/Makefile: Add rules build, run, and distribute tst-widetext.c. * libio/tst-widetext.c: New file. * libio/tst-widetext.input: New file. * libio/iogetwline.c (_IO_getwline_info): Pretty print.
Diffstat (limited to 'libio/iogetwline.c')
-rw-r--r--libio/iogetwline.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/libio/iogetwline.c b/libio/iogetwline.c
index b7f111586a..760d54a013 100644
--- a/libio/iogetwline.c
+++ b/libio/iogetwline.c
@@ -86,32 +86,32 @@ _IO_getwline_info (fp, buf, n, delim, extract_delim, eof)
*ptr++ = wc;
n--;
}
- else
- {
- wchar_t *t;
- if ((_IO_size_t) len >= n)
- len = n;
- t = wmemchr ((void *) fp->_wide_data->_IO_read_ptr, delim, len);
- if (t != NULL)
- {
- _IO_size_t old_len = ptr - buf;
- len = t - fp->_wide_data->_IO_read_ptr;
- if (extract_delim >= 0)
- {
- ++t;
- if (extract_delim > 0)
- ++len;
- }
- wmemcpy ((void *) ptr, (void *) fp->_wide_data->_IO_read_ptr,
- len);
- fp->_wide_data->_IO_read_ptr = t;
- return old_len + len;
- }
- wmemcpy ((void *) ptr, (void *) fp->_wide_data->_IO_read_ptr, len);
- fp->_wide_data->_IO_read_ptr += len;
- ptr += len;
- n -= len;
- }
+ else
+ {
+ wchar_t *t;
+ if ((_IO_size_t) len >= n)
+ len = n;
+ t = wmemchr ((void *) fp->_wide_data->_IO_read_ptr, delim, len);
+ if (t != NULL)
+ {
+ _IO_size_t old_len = ptr - buf;
+ len = t - fp->_wide_data->_IO_read_ptr;
+ if (extract_delim >= 0)
+ {
+ ++t;
+ if (extract_delim > 0)
+ ++len;
+ }
+ wmemcpy ((void *) ptr, (void *) fp->_wide_data->_IO_read_ptr,
+ len);
+ fp->_wide_data->_IO_read_ptr = t;
+ return old_len + len;
+ }
+ wmemcpy ((void *) ptr, (void *) fp->_wide_data->_IO_read_ptr, len);
+ fp->_wide_data->_IO_read_ptr += len;
+ ptr += len;
+ n -= len;
+ }
}
return ptr - buf;
}