diff options
author | Aaron Griffin <aaron@archlinux.org> | 2006-08-06 20:49:38 +0200 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2006-08-06 20:49:38 +0200 |
commit | d74249c258fd3b0716b7f0a2aadcabc574e6ca77 (patch) | |
tree | ee900cea6750b4e2bd49bf6053f6cf2e2658fdc4 /subs | |
parent | b81b2b920d300f1cb292fecf96e9d590497607f8 (diff) | |
download | mkinitcpio-d74249c258fd3b0716b7f0a2aadcabc574e6ca77.tar.gz mkinitcpio-d74249c258fd3b0716b7f0a2aadcabc574e6ca77.tar.xz |
Removed 'subs' in favor of split in klibc-extras
git-svn-id: http://projects.archlinux.org/svn/initramfs/mkinitcpio@143 880c04e9-e011-0410-abf7-b926e227c9cd
Diffstat (limited to 'subs')
-rw-r--r-- | subs/Makefile | 11 | ||||
-rw-r--r-- | subs/README | 11 | ||||
-rw-r--r-- | subs/subs.c | 42 |
3 files changed, 0 insertions, 64 deletions
diff --git a/subs/Makefile b/subs/Makefile deleted file mode 100644 index e3ae446..0000000 --- a/subs/Makefile +++ /dev/null @@ -1,11 +0,0 @@ -CC = klcc -CFLAGS = -Wall -TARGET = subs - -all: $(TARGET) - -$(TARGET): $(TARGET).c - $(CC) $(CFLAGS) $(TARGET).c -o $(TARGET) - -clean: - rm -f $(TARGET) diff --git a/subs/README b/subs/README deleted file mode 100644 index ca29eb2..0000000 --- a/subs/README +++ /dev/null @@ -1,11 +0,0 @@ -The subs tool has been created to solve the IFS ignorance of dash. -Instead of doing - -OLDIFS=$IFS -IFS=$char -func $arglist -IFS=$OLDIFS - -now do - -func $(subs -n $char $arglist) diff --git a/subs/subs.c b/subs/subs.c deleted file mode 100644 index 03f05c5..0000000 --- a/subs/subs.c +++ /dev/null @@ -1,42 +0,0 @@ -#include <strings.h> -#include <stdio.h> -#include <unistd.h> - -void usage(char *name) -{ - fprintf(stderr,"Usage:\n\t%s [-n <character>] [-w <character>] <string>\n",name); -} - -int main(int argc, char *argv[]) -{ - char *h,n=':',w=' '; - int c; - - while((c=getopt(argc, argv, "n:w:"))!=-1) - switch(c) - { - case 'n': - n=optarg[0]; - break; - case 'w': - w=optarg[0]; - break; - default: - usage(argv[0]); - return 1; - } - - if(optind>=argc) - { - usage(argv[0]); - return 1; - } - - h=argv[optind]; - while( (h=index(h, n)) !=NULL ) - *h++=w; - - printf("%s",argv[optind]); - - return 0; -} |