]> granicus.if.org Git - fortune-mod/commitdiff
Wrap C/etc. oneline blocks in {...}
authorShlomi Fish <shlomif@shlomifish.org>
Thu, 16 Dec 2021 17:26:49 +0000 (19:26 +0200)
committerShlomi Fish <shlomif@shlomifish.org>
Thu, 16 Dec 2021 17:26:49 +0000 (19:26 +0200)
See:
https://fc-solve.shlomifish.org/docs/distro/HACKING.html#one-line-clauses
.

fortune-mod/util/strfile.c

index ba30f97e74c88508e773094f2dec1f7bef01aeb0..be65608dba681f7aec83ec9f190ff7b99f2e00d7 100644 (file)
@@ -141,6 +141,7 @@ static void getargs(int argc, char **argv)
     int ch;
 
     while ((ch = getopt(argc, argv, "c:iorsx")) != EOF)
+    {
         switch (ch)
         {
         case 'c': /* new delimiting char */
@@ -170,6 +171,7 @@ static void getargs(int argc, char **argv)
         default:
             usage();
         }
+    }
     argv += optind;
 
     if (*argv)
@@ -256,18 +258,26 @@ static int cmp_str(const void *v1, const void *v2)
     bool n1 = false;
     bool n2 = false;
     while (!isalnum(c1 = getc(Sort_1)) && c1 != '\0')
+    {
         SET_N(n1, c1);
+    }
     while (!isalnum(c2 = getc(Sort_2)) && c2 != '\0')
+    {
         SET_N(n2, c2);
+    }
 
     while (!IS_END(c1, n1) && !IS_END(c2, n2))
     {
         if (Iflag)
         {
             if (isupper(c1))
+            {
                 c1 = tolower(c1);
+            }
             if (isupper(c2))
+            {
                 c2 = tolower(c2);
+            }
         }
         if (c1 != c2)
         {