aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/clump.c
diff options
context:
space:
mode:
authorepochqwert <epoch@hacking.allowed.org>2015-04-23 04:53:35 -0500
committerepochqwert <epoch@hacking.allowed.org>2015-04-23 04:53:35 -0500
commita36652959e52e8c810b7d2d76a283b2ae9718d96 (patch)
treea8c9712f7eb243d72bfdb492c0c14e630e78a03d /src/bin/clump.c
parent318b3220d191011bb9132efd4dbd5e6fb467b4e7 (diff)
downloadmisc-a36652959e52e8c810b7d2d76a283b2ae9718d96.tar.gz
misc-a36652959e52e8c810b7d2d76a283b2ae9718d96.zip
elapsedtime handles partial seconds better
unescape now handles multiple lines from stdin clump can now have an optional argument to specify input separator cuturl can now take compressed short options. (like: cuturl -dPs) filemon... I don't remember. just reformatted it looks like. ipconvert. looks like I added explainations before output. normalpath now uses getenv("PWD") instead of getcwd() so you can pick what you want to be the base for relative paths. urcdump... nothing I guess. probably a space or something dumb. httpd... more environment variables set for CGIs
Diffstat (limited to 'src/bin/clump.c')
-rw-r--r--src/bin/clump.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/bin/clump.c b/src/bin/clump.c
index 18c8e5b..ec06d17 100644
--- a/src/bin/clump.c
+++ b/src/bin/clump.c
@@ -8,17 +8,19 @@
//printf "a a\na b\na c\nb a\nb b\nc a\nc b\n" | clump
//still working on the name.
-int main() {
+int main(int argc,char *argv[]) {
char line[256];
char *id;
+ char sep=' ';
char *value;
char *oldid=malloc(1);
*oldid=0;
+ if(argc > 1) sep=argv[1][0];
while(fgets(line,sizeof(line),stdin)) {
id=line;
if(strchr(line,'\n')) *strchr(line,'\n')=0;
- if(strchr(id,' ')) {
- value=strchr(id,' ');
+ if(strchr(id,sep)) {
+ value=strchr(id,sep);
*value=0;
value++;
}