aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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;
+
}
}
}