5 static const char defshells
[] = "/bin/sh\n/bin/csh\n";
8 static size_t linesize
;
11 void endusershell(void)
17 void setusershell(void)
19 if (!f
) f
= fopen("/etc/shells", "rbe");
20 if (!f
) f
= fmemopen((void *)defshells
, sizeof defshells
- 1, "rb");
23 char *getusershell(void)
26 if (!f
) setusershell();
28 l
= getline(&line
, &linesize
, f
);
30 if (line
[l
-1]=='\n') line
[l
-1]=0;