|
|
| version 1.3, 2003/11/04 17:03:11 | version 1.4, 2004/03/22 22:32:50 |
|---|---|
| Line 73 static int margc; | Line 73 static int margc; |
| static char *margv[MAX_MARGV]; | static char *margv[MAX_MARGV]; |
| uid_t uid, euid; | uid_t uid, euid; |
| int main(int _argc, char *_argv[]); | int main(int _argc, char **_argv); |
| static void cmdscanner(void); | static void cmdscanner(void); |
| static struct cmd *getcmd(const char *_name); | static struct cmd *getcmd(const char *_name); |
| static void intr(int _signo); | static void intr(int _signo); |
| Line 81 static void makeargv(void); | Line 81 static void makeargv(void); |
| static int ingroup(const char *_grname); | static int ingroup(const char *_grname); |
| int | int |
| main(int argc, char *argv[]) | main(int argc, char **argv) |
| { | { |
| register struct cmd *c; | struct cmd *c; |
| euid = geteuid(); | euid = geteuid(); |
| uid = getuid(); | uid = getuid(); |
| Line 140 lpc_prompt(void) | Line 140 lpc_prompt(void) |
| static void | static void |
| cmdscanner(void) | cmdscanner(void) |
| { | { |
| register struct cmd *c; | struct cmd *c; |
| static EditLine *el; | static EditLine *el; |
| static History *hist; | static History *hist; |
| size_t len; | size_t len; |
| Line 226 cmdscanner(void) | Line 226 cmdscanner(void) |
| static struct cmd * | static struct cmd * |
| getcmd(const char *name) | getcmd(const char *name) |
| { | { |
| register const char *p, *q; | const char *p, *q; |
| register struct cmd *c, *found; | struct cmd *c, *found; |
| register int nmatches, longest; | int nmatches, longest; |
| longest = 0; | longest = 0; |
| nmatches = 0; | nmatches = 0; |
| Line 257 getcmd(const char *name) | Line 257 getcmd(const char *name) |
| static void | static void |
| makeargv(void) | makeargv(void) |
| { | { |
| register char *cp; | char *cp; |
| register char **argp = margv; | char **argp = margv; |
| register int n = 0; | int n = 0; |
| margc = 0; | margc = 0; |
| for (cp = cmdline; *cp && (size_t)(cp - cmdline) < sizeof(cmdline) && | for (cp = cmdline; *cp && (size_t)(cp - cmdline) < sizeof(cmdline) && |
| Line 285 makeargv(void) | Line 285 makeargv(void) |
| * Help command. | * Help command. |
| */ | */ |
| void | void |
| help(int argc, char *argv[]) | help(int argc, char **argv) |
| { | { |
| register struct cmd *c; | struct cmd *c; |
| if (argc == 1) { | if (argc == 1) { |
| register int i, j, w; | int i, j, w; |
| int columns, width = 0, lines; | int columns, width = 0, lines; |
| printf("Commands may be abbreviated. Commands are:\n\n"); | printf("Commands may be abbreviated. Commands are:\n\n"); |
| Line 324 help(int argc, char *argv[]) | Line 324 help(int argc, char *argv[]) |
| return; | return; |
| } | } |
| while (--argc > 0) { | while (--argc > 0) { |
| register char *arg; | char *arg; |
| arg = *++argv; | arg = *++argv; |
| c = getcmd(arg); | c = getcmd(arg); |
| if (c == (struct cmd *)-1) | if (c == (struct cmd *)-1) |
| Line 346 ingroup(const char *grname) | Line 347 ingroup(const char *grname) |
| static struct group *gptr=NULL; | static struct group *gptr=NULL; |
| static int ngroups = 0; | static int ngroups = 0; |
| static gid_t groups[NGROUPS]; | static gid_t groups[NGROUPS]; |
| register gid_t gid; | gid_t gid; |
| register int i; | int i; |
| if (gptr == NULL) { | if (gptr == NULL) { |
| if ((gptr = getgrnam(grname)) == NULL) { | if ((gptr = getgrnam(grname)) == NULL) { |