[hackers] [sbase] code-style: whitespace fixes || Hiltjo Posthuma

From: <git_AT_suckless.org>
Date: Wed, 30 Sep 2015 20:44:17 +0200 (CEST)

commit 53be1589796215129579c23375efcc1285358bd9
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Sun Sep 6 22:33:41 2015 +0200
Commit: sin <sin_AT_2f30.org>
CommitDate: Wed Sep 30 19:44:10 2015 +0100

    code-style: whitespace fixes

diff --git a/libutil/cp.c b/libutil/cp.c
index 0f098d3..0427095 100644
--- a/libutil/cp.c
+++ b/libutil/cp.c
_AT_@ -87,12 +87,12 @@ cp(const char *s1, const char *s2, int depth)
                                 continue;
 
                         estrlcpy(ns1, s1, sizeof(ns1));
- if(s1[strlen(s1) - 1] != '/')
+ if (s1[strlen(s1) - 1] != '/')
                                 estrlcat(ns1, "/", sizeof(ns1));
                         estrlcat(ns1, d->d_name, sizeof(ns1));
 
                         estrlcpy(ns2, s2, sizeof(ns2));
- if(s2[strlen(s2) - 1] != '/')
+ if (s2[strlen(s2) - 1] != '/')
                                 estrlcat(ns2, "/", sizeof(ns2));
                         estrlcat(ns2, d->d_name, sizeof(ns2));
 
diff --git a/libutil/eregcomp.c b/libutil/eregcomp.c
index 49c1bc5..02c8698 100644
--- a/libutil/eregcomp.c
+++ b/libutil/eregcomp.c
_AT_@ -1,21 +1,23 @@
+#include <sys/types.h>
+
 #include <regex.h>
 #include <stdio.h>
-#include <sys/types.h>
 
 #include "../util.h"
 
 int
 enregcomp(int status, regex_t *preg, const char *regex, int cflags)
 {
- char errbuf[BUFSIZ] = "";
- int r;
+ char errbuf[BUFSIZ] = "";
+ int r;
+
+ if ((r = regcomp(preg, regex, cflags)) == 0)
+ return r;
 
- if((r = regcomp(preg, regex, cflags)) == 0)
- return r;
+ regerror(r, preg, errbuf, sizeof(errbuf));
+ enprintf(status, "invalid regex: %s\n", errbuf);
 
- regerror(r, preg, errbuf, sizeof(errbuf));
- enprintf(status, "invalid regex: %s\n", errbuf);
- return r;
+ return r;
 }
 
 int
diff --git a/libutil/strcasestr.c b/libutil/strcasestr.c
index 873fe4e..26eb6bb 100644
--- a/libutil/strcasestr.c
+++ b/libutil/strcasestr.c
_AT_@ -28,7 +28,11 @@
 char *
 strcasestr(const char *h, const char *n)
 {
- size_t l = strlen(n);
- for (; *h; h++) if (!strncasecmp(h, n, l)) return (char *)h;
- return 0;
+ size_t l = strlen(n);
+
+ for (; *h; h++)
+ if (!strncasecmp(h, n, l))
+ return (char *)h;
+
+ return 0;
 }
diff --git a/ls.c b/ls.c
index 22506d3..427ada3 100644
--- a/ls.c
+++ b/ls.c
_AT_@ -28,7 +28,7 @@ struct entry {
 static struct {
         dev_t dev;
         ino_t ino;
-} tree[PATH_MAX] = { { 0, 0 } };
+} tree[PATH_MAX];
 
 static int Aflag = 0;
 static int aflag = 0;
_AT_@ -307,6 +307,7 @@ visit(const struct entry *ent)
 
         tree[i].ino = ino;
         tree[i].dev = dev;
+
         return i;
 }
 
diff --git a/sed.c b/sed.c
index 81d693a..4d35bb5 100644
--- a/sed.c
+++ b/sed.c
_AT_@ -1329,7 +1329,7 @@ cmd_l(Cmd *c)
                         printf("%s", escapes[(unsigned int)*p]);
                         rlen = 1;
                 } else if (!(rlen = charntorune(&r, p, end - p))) {
- /* ran out of chars, print the bytes of the short sequence */
+ /* ran out of chars, print the bytes of the short sequence */
                         for (; p < end; p++)
                                 printf("\\%03hho", (unsigned char)*p);
                         break;
Received on Wed Sep 30 2015 - 20:44:17 CEST

This archive was generated by hypermail 2.3.0 : Wed Sep 30 2015 - 20:48:12 CEST