Rev 10 | Rev 7676 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 10 | Rev 3718 | ||
---|---|---|---|
Line 21... | Line 21... | ||
21 | 21 | ||
22 | /* Selected characters are entered by the env var 'oncechar'. |
22 | /* Selected characters are entered by the env var 'oncechar'. |
23 | * Words entered by stdin. Output to stdout. */ |
23 | * Words entered by stdin. Output to stdout. */ |
24 | 24 | ||
25 | #include "../wims.h" |
25 | #include "../wims.h" |
- | 26 | #include "../Lib/basicstr.c" |
|
26 | #define MAX_WORDLEN 1023 |
27 | #define MAX_WORDLEN 1023 |
27 | 28 | ||
28 | char wbuf[MAX_WORDLEN+1]; |
29 | char wbuf[MAX_WORDLEN+1]; |
29 | char selbuf[256]; |
30 | char selbuf[256]; |
30 | 31 | ||
Line 55... | Line 56... | ||
55 | char *p; |
56 | char *p; |
56 | 57 | ||
57 | p=getenv("oncechar"); if(p==NULL || *p==0) return 0; |
58 | p=getenv("oncechar"); if(p==NULL || *p==0) return 0; |
58 | snprintf(selbuf,sizeof(selbuf),"%s",p); |
59 | snprintf(selbuf,sizeof(selbuf),"%s",p); |
59 | for(p=selbuf; *p; p++) |
60 | for(p=selbuf; *p; p++) |
60 | if(isspace(*p) || strchr("^?*.${}[]()\\",*p)!=NULL) |
61 | if(isspace(*p) || strchr("^?*.${}[]()\\",*p)!=NULL) ovlstrcpy(p,p+1); |
61 | do{ |
62 | do{ |
62 | c=getword(); checkword(); |
63 | c=getword(); checkword(); |
63 | } |
64 | } |
64 | while(c!=EOF); |
65 | while(c!=EOF); |
65 | return 0; |
66 | return 0; |