|
|
1.1 ! root 1: #ifndef lint ! 2: static char sccsid[] = "@(#)getprm.c 5.4 (Berkeley) 10/9/85"; ! 3: #endif ! 4: ! 5: #include "uucp.h" ! 6: ! 7: #define LQUOTE '(' ! 8: #define RQUOTE ')' ! 9: ! 10: /*LINTLIBRARY*/ ! 11: ! 12: /* ! 13: * get next parameter from s ! 14: * ! 15: * return - pointer to next character in s ! 16: */ ! 17: ! 18: char * ! 19: getprm(s, prm) ! 20: register char *s, *prm; ! 21: { ! 22: register char *c; ! 23: ! 24: while (*s == ' ' || *s == '\t' || *s == '\n') ! 25: s++; ! 26: ! 27: *prm = '\0'; ! 28: if (*s == '\0') ! 29: return NULL; ! 30: ! 31: if (*s == '>' || *s == '<' || *s == '|' ! 32: || *s == ';' || *s == '&') { ! 33: *prm++ = *s++; ! 34: *prm = '\0'; ! 35: return s; ! 36: } ! 37: ! 38: /* look for quoted argument */ ! 39: if (*s == LQUOTE) { ! 40: if ((c = index(s + 1, RQUOTE)) != NULL) { ! 41: c++; ! 42: while (c != s) ! 43: *prm++ = *s++; ! 44: *prm = '\0'; ! 45: return s; ! 46: } ! 47: } ! 48: ! 49: /* look for ` ` string */ ! 50: if (*s == '`') { ! 51: if ((c = index(s + 1, '`')) != NULL) { ! 52: c++; ! 53: while (c != s) ! 54: *prm++ = *s++; ! 55: *prm = '\0'; ! 56: return s; ! 57: } ! 58: } ! 59: ! 60: while (*s != ' ' && *s != '\t' && *s != '<' ! 61: && *s != '>' && *s != '|' && *s != '\0' ! 62: && *s != '&' && *s != ';' && *s != '\n') ! 63: *prm++ = *s++; ! 64: *prm = '\0'; ! 65: ! 66: return s; ! 67: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.