summaryrefslogtreecommitdiff
path: root/startmode.c
diff options
context:
space:
mode:
authorOskar <[email protected]>2023-10-27 23:04:22 +0200
committerOskar <[email protected]>2023-10-27 23:04:22 +0200
commit2815c44224cdb99695248faadce10b1737f7c766 (patch)
tree8cd4ea572108fa15e1a6c07977a951fe77e02208 /startmode.c
parent37e748be88e6e72c37809018f9c163917d609cbd (diff)
Minor changes to GET_LINE() , also did a little test to check if it worked like it should. Seems to be working...
Diffstat (limited to 'startmode.c')
-rw-r--r--startmode.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/startmode.c b/startmode.c
index 866da36..3c5b606 100644
--- a/startmode.c
+++ b/startmode.c
@@ -79,11 +79,23 @@ int startmode(char filename[]) {
}
printf("%s", line);
free(line);
+
break;
case 'E':
case 'e':
printf("EDIT MODE\n");
break;
+ case 'C':
+ case 'c':
+
+ size_t Flines;
+ int returnval = COUNT_LINES_IN_FILE(filename, &Flines);
+ if (returnval == 1) {
+ return EXIT_FAILURE;
+ }
+ fprintf(stdout,"%s %ld lines\n", filename, Flines);
+
+ break;
case 'Q':
case 'q':
return EXIT_SUCCESS;