summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2010-02-03 08:53:02 +0100
committerJim Meyering <meyering@redhat.com>2010-02-03 08:53:02 +0100
commit3ea7fe86ac3c1a887038e0e3e1c07ba4634ad1a5 (patch)
tree724c373678f99a6b2a797f0879804b6125c65883 /sample
parent2bea18bc85c6815e742dd3aa287d8f7aa2f0bb74 (diff)
downloadgzip-3ea7fe86ac3c1a887038e0e3e1c07ba4634ad1a5.tar.gz
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 'sample')
-rw-r--r--sample/zread.c24
-rwxr-xr-xsample/ztouch4
2 files changed, 14 insertions, 14 deletions
diff --git a/sample/zread.c b/sample/zread.c
index 8492dc9..e20de49 100644
--- a/sample/zread.c
+++ b/sample/zread.c
@@ -20,35 +20,35 @@ int main(argc, argv)
int n;
if (argc < 1 || argc > 2) {
- fprintf(stderr, "usage: %s [file[.gz]]\n", argv[0]);
- exit(EXIT_FAILURE);
+ fprintf(stderr, "usage: %s [file[.gz]]\n", argv[0]);
+ exit(EXIT_FAILURE);
}
strcpy(cmd, "gzip -dc "); /* use "gzip -c" for zwrite */
if (argc == 2) {
- strncat(cmd, argv[1], sizeof(cmd)-strlen(cmd));
+ strncat(cmd, argv[1], sizeof(cmd)-strlen(cmd));
}
infile = popen(cmd, "r"); /* use "w" for zwrite */
if (infile == NULL) {
- fprintf(stderr, "%s: popen('%s', 'r') failed\n", argv[0], cmd);
- exit(EXIT_FAILURE);
+ fprintf(stderr, "%s: popen('%s', 'r') failed\n", argv[0], cmd);
+ exit(EXIT_FAILURE);
}
/* Read one byte using getc: */
n = getc(infile);
if (n == EOF) {
- pclose(infile);
- exit(EXIT_SUCCESS);
+ pclose(infile);
+ exit(EXIT_SUCCESS);
}
putchar(n);
/* Read the rest using fread: */
for (;;) {
- n = fread(buf, 1, BUFSIZ, infile);
- if (n <= 0) break;
- fwrite(buf, 1, n, stdout);
+ n = fread(buf, 1, BUFSIZ, infile);
+ if (n <= 0) break;
+ fwrite(buf, 1, n, stdout);
}
if (pclose(infile) != 0) {
- fprintf(stderr, "%s: pclose failed\n", argv[0]);
- exit(EXIT_FAILURE);
+ fprintf(stderr, "%s: pclose failed\n", argv[0]);
+ exit(EXIT_FAILURE);
}
exit(EXIT_SUCCESS);
return 0; /* just to make compiler happy */
diff --git a/sample/ztouch b/sample/ztouch
index e408e2b..c5d30ad 100755
--- a/sample/ztouch
+++ b/sample/ztouch
@@ -7,9 +7,9 @@ foreach $file (@ARGV) {
read (FILE, $_, 8);
($magic, $method, $flags, $time) = unpack ("A2C2V", $_);
if ($magic eq "\037\213") {
- utime ($time, $time, $file);
+ utime ($time, $time, $file);
}
else {
- warn "$file is not compressed with gzip!\n";
+ warn "$file is not compressed with gzip!\n";
}
}