summaryrefslogtreecommitdiff
path: root/lib/cmpbuf.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@fb.com>2019-01-05 22:04:57 -0800
committerJim Meyering <meyering@fb.com>2019-01-05 22:47:23 -0800
commitbadccffea49ddc26b72208366f00429cc7ffb9e1 (patch)
tree67540e209f66e920565f43c84cff6f3f7fed978a /lib/cmpbuf.c
parent601eceb57cfb87ded594701acc401277c53ff837 (diff)
downloaddiffutils-badccffea49ddc26b72208366f00429cc7ffb9e1.tar.gz
maint: convert all TABs to equivalent spaces in indentation
Using this file, cat > leading-blank.exempt <<\EOF (\.gitmodules|help2man|pre-commit)$ (?:^|\/)ChangeLog[^/]*$ (?:^|\/)(?:GNU)?[Mm]akefile[^/]*$ \.(?:am|mk)$ EOF run the following command to convert all non-conforming leading white space to be all spaces: git ls-files \ | pcregrep -vf leading-blank.exempt \ | xargs pcregrep -l '^ *\t' \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_' Since that changed old NEWS, I also ran "make update-NEWS-hash" to update the old_NEWS_hash value in cfg.mk.
Diffstat (limited to 'lib/cmpbuf.c')
-rw-r--r--lib/cmpbuf.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/lib/cmpbuf.c b/lib/cmpbuf.c
index aa9a094..b100a96 100644
--- a/lib/cmpbuf.c
+++ b/lib/cmpbuf.c
@@ -54,28 +54,28 @@ block_read (int fd, char *buf, size_t nbytes)
size_t bytes_to_read = MIN (bytes_remaining, readlim);
ssize_t nread = read (fd, bp, bytes_to_read);
if (nread <= 0)
- {
- if (nread == 0)
- break;
-
- /* Accommodate Tru64 5.1, which can't read more than INT_MAX
- bytes at a time. They call that a 64-bit OS? */
- if (errno == EINVAL && INT_MAX < bytes_to_read)
- {
- readlim = INT_MAX;
- continue;
- }
-
- /* This is needed for programs that have signal handlers on
- older hosts without SA_RESTART. It also accommodates
- ancient AIX hosts that set errno to EINTR after uncaught
- SIGCONT. See <news:1r77ojINN85n@ftp.UU.NET>
- (1993-04-22). */
- if (! SA_RESTART && errno == EINTR)
- continue;
-
- return SIZE_MAX;
- }
+ {
+ if (nread == 0)
+ break;
+
+ /* Accommodate Tru64 5.1, which can't read more than INT_MAX
+ bytes at a time. They call that a 64-bit OS? */
+ if (errno == EINVAL && INT_MAX < bytes_to_read)
+ {
+ readlim = INT_MAX;
+ continue;
+ }
+
+ /* This is needed for programs that have signal handlers on
+ older hosts without SA_RESTART. It also accommodates
+ ancient AIX hosts that set errno to EINTR after uncaught
+ SIGCONT. See <news:1r77ojINN85n@ftp.UU.NET>
+ (1993-04-22). */
+ if (! SA_RESTART && errno == EINTR)
+ continue;
+
+ return SIZE_MAX;
+ }
bp += nread;
}
while (bp < buflim);