exec.c (204800) | exec.c (213760) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * This code is derived from software contributed to Berkeley by 6 * Kenneth Almquist. 7 * 8 * Redistribution and use in source and binary forms, with or without --- 22 unchanged lines hidden (view full) --- 31 */ 32 33#ifndef lint 34#if 0 35static char sccsid[] = "@(#)exec.c 8.4 (Berkeley) 6/8/95"; 36#endif 37#endif /* not lint */ 38#include <sys/cdefs.h> |
39__FBSDID("$FreeBSD: head/bin/sh/exec.c 204800 2010-03-06 16:57:53Z jilles $"); | 39__FBSDID("$FreeBSD: head/bin/sh/exec.c 213760 2010-10-13 04:01:01Z obrien $"); |
40 41#include <sys/types.h> 42#include <sys/stat.h> 43#include <unistd.h> 44#include <fcntl.h> 45#include <errno.h> 46#include <stdlib.h> 47 --- 38 unchanged lines hidden (view full) --- 86 union param param; /* definition of builtin function */ 87 int special; /* flag for special builtin commands */ 88 short cmdtype; /* index identifying command */ 89 char rehash; /* if set, cd done since entry created */ 90 char cmdname[ARB]; /* name of command */ 91}; 92 93 | 40 41#include <sys/types.h> 42#include <sys/stat.h> 43#include <unistd.h> 44#include <fcntl.h> 45#include <errno.h> 46#include <stdlib.h> 47 --- 38 unchanged lines hidden (view full) --- 86 union param param; /* definition of builtin function */ 87 int special; /* flag for special builtin commands */ 88 short cmdtype; /* index identifying command */ 89 char rehash; /* if set, cd done since entry created */ 90 char cmdname[ARB]; /* name of command */ 91}; 92 93 |
94STATIC struct tblentry *cmdtable[CMDTABLESIZE]; 95STATIC int builtinloc = -1; /* index in path of %builtin, or -1 */ | 94static struct tblentry *cmdtable[CMDTABLESIZE]; 95static int builtinloc = -1; /* index in path of %builtin, or -1 */ |
96int exerrno = 0; /* Last exec error */ 97 98 99STATIC void tryexec(char *, char **, char **); 100STATIC void printentry(struct tblentry *, int); 101STATIC struct tblentry *cmdlookup(const char *, int); 102STATIC void delete_cmd_entry(void); 103 --- 506 unchanged lines hidden (view full) --- 610/* 611 * Locate a command in the command hash table. If "add" is nonzero, 612 * add the command to the table if it is not already present. The 613 * variable "lastcmdentry" is set to point to the address of the link 614 * pointing to the entry, so that delete_cmd_entry can delete the 615 * entry. 616 */ 617 | 96int exerrno = 0; /* Last exec error */ 97 98 99STATIC void tryexec(char *, char **, char **); 100STATIC void printentry(struct tblentry *, int); 101STATIC struct tblentry *cmdlookup(const char *, int); 102STATIC void delete_cmd_entry(void); 103 --- 506 unchanged lines hidden (view full) --- 610/* 611 * Locate a command in the command hash table. If "add" is nonzero, 612 * add the command to the table if it is not already present. The 613 * variable "lastcmdentry" is set to point to the address of the link 614 * pointing to the entry, so that delete_cmd_entry can delete the 615 * entry. 616 */ 617 |
618STATIC struct tblentry **lastcmdentry; | 618static struct tblentry **lastcmdentry; |
619 620 621STATIC struct tblentry * 622cmdlookup(const char *name, int add) 623{ 624 int hashval; 625 const char *p; 626 struct tblentry *cmdp; --- 226 unchanged lines hidden --- | 619 620 621STATIC struct tblentry * 622cmdlookup(const char *name, int add) 623{ 624 int hashval; 625 const char *p; 626 struct tblentry *cmdp; --- 226 unchanged lines hidden --- |