6 void getword(char *word, char *line, char stop) {
9 for(x=0;((line[x]) && (line[x] != stop));x++)
16 while(line[y++] = line[x++]);
19 char *makeword(char *line, char stop) {
21 char *word = (char *) malloc(sizeof(char) * (strlen(line) + 1));
23 for(x=0;((line[x]) && (line[x] != stop));x++)
30 while(line[y++] = line[x++]);
34 char *fmakeword(FILE *f, char stop, int *cl) {
41 word = (char *) malloc(sizeof(char) * (wsize + 1));
44 word[ll] = (char)fgetc(f);
47 word = (char *)realloc(word,sizeof(char)*(wsize+1));
50 if((word[ll] == stop) || (feof(f)) || (!(*cl))) {
51 if(word[ll] != stop) ll++;
59 char x2c(char *what) {
62 digit = (what[0] >= 'A' ? ((what[0] & 0xdf) - 'A')+10 : (what[0] - '0'));
64 digit += (what[1] >= 'A' ? ((what[1] & 0xdf) - 'A')+10 : (what[1] - '0'));
68 void unescape_url(char *url) {
71 for(x=0,y=0;url[y];++x,++y) {
72 if((url[x] = url[y]) == '%') {
73 url[x] = x2c(&url[y+1]);
80 void plustospace(char *str) {
83 for(x=0;str[x];x++) if(str[x] == '+') str[x] = ' ';
86 int rind(char *s, char c) {
88 for(x=strlen(s) - 1;x != -1; x--)
89 if(s[x] == c) return x;
93 int getline(char *s, int n, FILE *f) {
97 s[i] = (char)fgetc(f);
102 if((s[i] == 0x4) || (s[i] == LF) || (i == (n-1))) {
104 return (feof(f) ? 1 : 0);
110 void send_fd(FILE *f, FILE *fd)
123 int ind(char *s, char c) {
127 if(s[x] == c) return x;
132 void escape_shell_cmd(char *cmd) {
136 for(x=0;cmd[x];x++) {
137 if(ind("&;`'\"|*?~<>^()[]{}$\\",cmd[x]) != -1){
140 l++; /* length has been increased */
142 x++; /* skip the character */