The style inquisition on basename.

This commit is contained in:
Christoph Lohmann 2013-03-05 21:35:55 +01:00
parent 284e9f723d
commit 52d39e35c2
2 changed files with 10 additions and 6 deletions

View File

@ -3,10 +3,17 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "util.h" #include "util.h"
static void usage(void); static void usage(void);
void
usage(void)
{
eprintf("usage: %s name [suffix]\n", argv0);
}
int int
main(int argc, char *argv[]) main(int argc, char *argv[])
{ {
@ -27,13 +34,9 @@ main(int argc, char *argv[])
if(!strcmp(&s[n], argv[1])) if(!strcmp(&s[n], argv[1]))
s[n] = '\0'; s[n] = '\0';
} }
puts(s); puts(s);
return EXIT_SUCCESS; return 0;
} }
void
usage(void)
{
eprintf("usage: %s name [suffix]\n", argv0);
}

1
uniq.c
View File

@ -4,6 +4,7 @@
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#include "text.h" #include "text.h"
#include "util.h" #include "util.h"