6
static const char defshells[] = "/bin/sh\n/bin/csh\n";
9
static size_t linesize;
12
void endusershell(void)
18
void setusershell(void)
20
if (!f) f = fopen("/etc/shells", "rbe");
21
if (!f) f = fmemopen((void *)defshells, sizeof defshells - 1, "rb");
24
char *getusershell(void)
27
if (!f) setusershell();
29
l = getline(&line, &linesize, f);
31
if (line[l-1]=='\n') line[l-1]=0;