exec.c (200136) | exec.c (229403) |
---|---|
1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1991, 1993 3 * The Regents of the University of California. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 17 unchanged lines hidden (view full) --- 26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27 * SUCH DAMAGE. 28 */ 29 30#if defined(LIBC_SCCS) && !defined(lint) 31static char sccsid[] = "@(#)exec.c 8.1 (Berkeley) 6/4/93"; 32#endif /* LIBC_SCCS and not lint */ 33#include <sys/cdefs.h> |
34__FBSDID("$FreeBSD: head/lib/libc/gen/exec.c 200136 2009-12-05 18:55:16Z ed $"); | 34__FBSDID("$FreeBSD: head/lib/libc/gen/exec.c 229403 2012-01-03 18:51:58Z ed $"); |
35 36#include "namespace.h" 37#include <sys/param.h> 38#include <sys/types.h> 39#include <sys/stat.h> 40#include <errno.h> 41#include <unistd.h> 42#include <stdlib.h> --- 111 unchanged lines hidden (view full) --- 154 int eacces, save_errno; 155 char *cur, buf[MAXPATHLEN]; 156 const char *p, *bp; 157 struct stat sb; 158 159 eacces = 0; 160 161 /* If it's an absolute or relative path name, it's easy. */ | 35 36#include "namespace.h" 37#include <sys/param.h> 38#include <sys/types.h> 39#include <sys/stat.h> 40#include <errno.h> 41#include <unistd.h> 42#include <stdlib.h> --- 111 unchanged lines hidden (view full) --- 154 int eacces, save_errno; 155 char *cur, buf[MAXPATHLEN]; 156 const char *p, *bp; 157 struct stat sb; 158 159 eacces = 0; 160 161 /* If it's an absolute or relative path name, it's easy. */ |
162 if (index(name, '/')) { | 162 if (strchr(name, '/')) { |
163 bp = name; 164 cur = NULL; 165 goto retry; 166 } 167 bp = buf; 168 169 /* If it's an empty path name, fail in the usual POSIX way. */ 170 if (*name == '\0') { --- 114 unchanged lines hidden --- | 163 bp = name; 164 cur = NULL; 165 goto retry; 166 } 167 bp = buf; 168 169 /* If it's an empty path name, fail in the usual POSIX way. */ 170 if (*name == '\0') { --- 114 unchanged lines hidden --- |