[hackers] [sbase] minor style changes || dwts

From: <git_AT_suckless.org>
Date: Tue, 22 Apr 2014 14:46:23 +0200

commit b700d5a8ed5090ccd3454485805111357c326daf
Author: dwts <mr.dwts_AT_gmail.com>
Date: Tue Apr 22 13:43:01 2014 +0300

    minor style changes

diff --git a/cat.c b/cat.c
index 6db1761..ebc624f 100644
--- a/cat.c
+++ b/cat.c
_AT_@ -25,14 +25,15 @@ main(int argc, char *argv[])
 
         if(argc == 0) {
                 concat(stdin, "<stdin>", stdout, "<stdout>");
- } else for(i = 0; i < argc; i++) {
- if(!(fp = fopen(argv[i], "r"))) {
- weprintf("fopen %s:", argv[i]);
- continue;
+ } else {
+ for(i = 0; i < argc; i++) {
+ if(!(fp = fopen(argv[i], "r"))) {
+ weprintf("fopen %s:", argv[i]);
+ continue;
+ }
+ concat(fp, argv[i], stdout, "<stdout>");
+ fclose(fp);
                 }
- concat(fp, argv[i], stdout, "<stdout>");
- fclose(fp);
         }
-
         return EXIT_SUCCESS;
 }
diff --git a/fold.c b/fold.c
index 5516aae..6a95124 100644
--- a/fold.c
+++ b/fold.c
_AT_@ -44,13 +44,15 @@ main(int argc, char *argv[])
 
         if(argc == 0) {
                 fold(stdin, width);
- } else for(; argc > 0; argc--, argv++) {
- if(!(fp = fopen(argv[0], "r"))) {
- weprintf("fopen %s:", argv[0]);
- continue;
+ } else {
+ for(; argc > 0; argc--, argv++) {
+ if(!(fp = fopen(argv[0], "r"))) {
+ weprintf("fopen %s:", argv[0]);
+ continue;
+ }
+ fold(fp, width);
+ fclose(fp);
                 }
- fold(fp, width);
- fclose(fp);
         }
 
         return EXIT_SUCCESS;
diff --git a/head.c b/head.c
index ccd619c..2903f49 100644
--- a/head.c
+++ b/head.c
_AT_@ -32,13 +32,15 @@ main(int argc, char *argv[])
 
         if(argc == 0) {
                 head(stdin, "<stdin>", n);
- } else for(; argc > 0; argc--, argv++) {
- if(!(fp = fopen(argv[0], "r"))) {
- weprintf("fopen %s:", argv[0]);
- continue;
+ } else {
+ for(; argc > 0; argc--, argv++) {
+ if(!(fp = fopen(argv[0], "r"))) {
+ weprintf("fopen %s:", argv[0]);
+ continue;
+ }
+ head(fp, argv[0], n);
+ fclose(fp);
                 }
- head(fp, argv[0], n);
- fclose(fp);
         }
 
         return EXIT_SUCCESS;
Received on Tue Apr 22 2014 - 14:46:23 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 22 2014 - 14:48:07 CEST