Deleted Added
full compact
main.c (200943) main.c (200956)
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

--- 28 unchanged lines hidden (view full) ---

37#endif /* not lint */
38
39#ifndef lint
40#if 0
41static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/28/95";
42#endif
43#endif /* not lint */
44#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

--- 28 unchanged lines hidden (view full) ---

37#endif /* not lint */
38
39#ifndef lint
40#if 0
41static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 5/28/95";
42#endif
43#endif /* not lint */
44#include <sys/cdefs.h>
45__FBSDID("$FreeBSD: head/bin/sh/main.c 200943 2009-12-24 15:14:22Z jilles $");
45__FBSDID("$FreeBSD: head/bin/sh/main.c 200956 2009-12-24 18:41:14Z jilles $");
46
47#include <stdio.h>
48#include <signal.h>
49#include <sys/stat.h>
50#include <unistd.h>
51#include <fcntl.h>
52#include <locale.h>
53#include <errno.h>

--- 210 unchanged lines hidden (view full) ---

264
265
266
267/*
268 * Read a file containing shell functions.
269 */
270
271void
46
47#include <stdio.h>
48#include <signal.h>
49#include <sys/stat.h>
50#include <unistd.h>
51#include <fcntl.h>
52#include <locale.h>
53#include <errno.h>

--- 210 unchanged lines hidden (view full) ---

264
265
266
267/*
268 * Read a file containing shell functions.
269 */
270
271void
272readcmdfile(char *name)
272readcmdfile(const char *name)
273{
274 int fd;
275
276 INTOFF;
277 if ((fd = open(name, O_RDONLY)) >= 0)
278 setinputfd(fd, 1);
279 else
280 error("Can't open %s: %s", name, strerror(errno));

--- 10 unchanged lines hidden (view full) ---

291 */
292
293
294STATIC char *
295find_dot_file(char *basename)
296{
297 static char localname[FILENAME_MAX+1];
298 char *fullname;
273{
274 int fd;
275
276 INTOFF;
277 if ((fd = open(name, O_RDONLY)) >= 0)
278 setinputfd(fd, 1);
279 else
280 error("Can't open %s: %s", name, strerror(errno));

--- 10 unchanged lines hidden (view full) ---

291 */
292
293
294STATIC char *
295find_dot_file(char *basename)
296{
297 static char localname[FILENAME_MAX+1];
298 char *fullname;
299 char *path = pathval();
299 const char *path = pathval();
300 struct stat statb;
301
302 /* don't try this for absolute or relative paths */
303 if( strchr(basename, '/'))
304 return basename;
305
306 while ((fullname = padvance(&path, basename)) != NULL) {
307 strcpy(localname, fullname);

--- 41 unchanged lines hidden ---
300 struct stat statb;
301
302 /* don't try this for absolute or relative paths */
303 if( strchr(basename, '/'))
304 return basename;
305
306 while ((fullname = padvance(&path, basename)) != NULL) {
307 strcpy(localname, fullname);

--- 41 unchanged lines hidden ---