Removed submodules
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
static void usage (void) __attribute__ ((unused));
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
int c;
|
||||
while ((c = getchar()) != EOF)
|
||||
{
|
||||
putchar(c);
|
||||
}
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
FILE *fp = fopen(argv[1], "r");
|
||||
if (fp == NULL)
|
||||
{
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
int c;
|
||||
while ((c = fgetc(fp)) != EOF)
|
||||
{
|
||||
putchar(c);
|
||||
}
|
||||
|
||||
fclose(fp);
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
static void
|
||||
usage (void)
|
||||
{
|
||||
printf ("cat, print the contents of a file\n");
|
||||
printf ("usage: cat FILE\n");
|
||||
}
|
||||
Reference in New Issue
Block a user