sbase

suckless unix tools
git clone git://git.2f30.org/sbase
Log | Files | Refs | README | LICENSE

commit 52d39e35c2468510c356335fb78b604c7f3d3bba
parent 284e9f723d71123b8c15afd1aac3eb60ee1d28be
Author: Christoph Lohmann <20h@r-36.net>
Date:   Tue,  5 Mar 2013 21:35:55 +0100

The style inquisition on basename.

Diffstat:
Mbasename.c | 15+++++++++------
Muniq.c | 1+
2 files changed, 10 insertions(+), 6 deletions(-)

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