* Copyright (c) 1983 Regents of the University of California.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)getcom.c 5.3 (Berkeley) %G%";
getcom(buf
, size
, prompt
, error
)
if (fgets(buf
, size
, stdin
) == 0) {
* shifts to UPPERCASE if flag > 0, lowercase if flag < 0,
* and leaves it unchanged if flag = 0
getword(buf1
, buf2
, flag
)
register char *buf1
, *buf2
;
while (*buf1
&& !isspace(*buf1
) && *buf1
!= ',')
*buf2
++ = tolower(*buf1
++);
*buf2
++ = toupper(*buf1
++);
return (*buf1
? buf1
: 0);