aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsinanmohd <sinan@firemail.cc>2023-06-15 07:01:27 +0530
committersinanmohd <sinan@firemail.cc>2023-06-15 07:02:19 +0530
commit63f1c8153389d97305625a41d3f5df1a1b0bb738 (patch)
tree373f5ec015cae86d6e013edcaecf901badf921d8
parent746ea2a4ed3d395a7460ce627c64a2e1a222bc7e (diff)
5.11: clean up, 80 char limitHEADmaster
-rw-r--r--5.11.c77
1 files changed, 39 insertions, 38 deletions
diff --git a/5.11.c b/5.11.c
index 2677df7..4834d1b 100644
--- a/5.11.c
+++ b/5.11.c
@@ -21,27 +21,27 @@ int main(int argc, char **argv)
while (--argc > 0 && **++argv == '-') {
while (*++*argv) {
switch (**argv) {
- case 'e' :
- entab_bool = TRUE;
- break;
- case 'd' :
- detab_bool = TRUE;
- break;
- case 's' :
- if (*++*argv != '=')
- break;
-
- while (*++*argv && stop_position < MAXSTOPS) {
- stops[stop_position++] = atoi(*argv);
- printf("loooop -- %d\n", stop_position);
-
- while (isdigit(**argv))
- ++*argv;
-
- if (**argv == '\0')
- --*argv;
- }
- break;
+ case 'e' :
+ entab_bool = TRUE;
+ break;
+ case 'd' :
+ detab_bool = TRUE;
+ break;
+ case 's' :
+ if (*++*argv != '=')
+ break;
+
+ while (*++*argv && stop_position < MAXSTOPS) {
+ stops[stop_position++] = atoi(*argv);
+ printf("loooop -- %d\n", stop_position);
+
+ while (isdigit(**argv))
+ ++*argv;
+
+ if (**argv == '\0')
+ --*argv;
+ }
+ break;
}
}
}
@@ -67,23 +67,24 @@ void detab(int *stops, int limit)
while((input = getchar()) != EOF) {
switch (input) {
- case '\t' :
- for (space = count%stops[stop_position]; space < stops[stop_position]; space++)
- putchar(' ');
- count = 0;
-
- if (stop_position < limit)
- stop_position++;
-
- break;
- case '\n' :
- count = 0;
- break;
- default :
- putchar(input);
- count++;
- break;
-
+ case '\t' :
+ for (space = count%stops[stop_position]; space <
+ stops[stop_position]; space++)
+ putchar(' ');
+ count = 0;
+
+ if (stop_position < limit)
+ stop_position++;
+
+ break;
+ case '\n' :
+ count = 0;
+ break;
+ default :
+ putchar(input);
+ count++;
+ break;
+
}
}
}