summaryrefslogtreecommitdiff
path: root/src/tee.c
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-08-22 18:56:06 +0200
committerJim Meyering <meyering@redhat.com>2009-08-25 09:21:00 +0200
commit5e778f7c8d1ecf3d8f11385db013af2ba026e2a5 (patch)
treee460d471f37f0dce1ba06f60f88114d1a65326c4 /src/tee.c
parent2bc0f3caaafeb240cdcfd050b7ad1fe0ad14addf (diff)
downloadcoreutils-5e778f7c8d1ecf3d8f11385db013af2ba026e2a5.tar.xz
global: convert indentation-TABs to spaces
Transformed via this shell code: t=$'\t' git ls-files \ | grep -vE '(^|/)((GNU)?[Mm]akefile|ChangeLog)|\.(am|mk)$' \ | grep -vE 'tests/pr/|help2man' \ | xargs grep -lE "^ *$t" \ | xargs perl -MText::Tabs -ni -le \ '$m=/^( *\t[ \t]*)(.*)/; print $m ? expand($1) . $2 : $_'
Diffstat (limited to 'src/tee.c')
-rw-r--r--src/tee.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/tee.c b/src/tee.c
index a1b1a2788..03a33b060 100644
--- a/src/tee.c
+++ b/src/tee.c
@@ -56,7 +56,7 @@ usage (int status)
{
if (status != EXIT_SUCCESS)
fprintf (stderr, _("Try `%s --help' for more information.\n"),
- program_name);
+ program_name);
else
{
printf (_("Usage: %s [OPTION]... [FILE]...\n"), program_name);
@@ -97,22 +97,22 @@ main (int argc, char **argv)
while ((optc = getopt_long (argc, argv, "ai", long_options, NULL)) != -1)
{
switch (optc)
- {
- case 'a':
- append = true;
- break;
+ {
+ case 'a':
+ append = true;
+ break;
- case 'i':
- ignore_interrupts = true;
- break;
+ case 'i':
+ ignore_interrupts = true;
+ break;
- case_GETOPT_HELP_CHAR;
+ case_GETOPT_HELP_CHAR;
- case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
+ case_GETOPT_VERSION_CHAR (PROGRAM_NAME, AUTHORS);
- default:
- usage (EXIT_FAILURE);
- }
+ default:
+ usage (EXIT_FAILURE);
+ }
}
if (ignore_interrupts)
@@ -166,15 +166,15 @@ tee_files (int nfiles, const char **files)
for (i = 1; i <= nfiles; i++)
{
descriptors[i] = (STREQ (files[i], "-")
- ? stdout
- : fopen (files[i], mode_string));
+ ? stdout
+ : fopen (files[i], mode_string));
if (descriptors[i] == NULL)
- {
- error (0, errno, "%s", files[i]);
- ok = false;
- }
+ {
+ error (0, errno, "%s", files[i]);
+ ok = false;
+ }
else
- setvbuf (descriptors[i], NULL, _IONBF, 0);
+ setvbuf (descriptors[i], NULL, _IONBF, 0);
}
while (1)
@@ -185,18 +185,18 @@ tee_files (int nfiles, const char **files)
continue;
#endif
if (bytes_read <= 0)
- break;
+ break;
/* Write to all NFILES + 1 descriptors.
- Standard output is the first one. */
+ Standard output is the first one. */
for (i = 0; i <= nfiles; i++)
- if (descriptors[i]
- && fwrite (buffer, bytes_read, 1, descriptors[i]) != 1)
- {
- error (0, errno, "%s", files[i]);
- descriptors[i] = NULL;
- ok = false;
- }
+ if (descriptors[i]
+ && fwrite (buffer, bytes_read, 1, descriptors[i]) != 1)
+ {
+ error (0, errno, "%s", files[i]);
+ descriptors[i] = NULL;
+ ok = false;
+ }
}
if (bytes_read == -1)
@@ -208,10 +208,10 @@ tee_files (int nfiles, const char **files)
/* Close the files, but not standard output. */
for (i = 1; i <= nfiles; i++)
if (!STREQ (files[i], "-")
- && descriptors[i] && fclose (descriptors[i]) != 0)
+ && descriptors[i] && fclose (descriptors[i]) != 0)
{
- error (0, errno, "%s", files[i]);
- ok = false;
+ error (0, errno, "%s", files[i]);
+ ok = false;
}
free (descriptors);