Deleted Added
full compact
main.c (247206) main.c (248980)
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 247206 2013-02-23 22:50:57Z jilles $");
45__FBSDID("$FreeBSD: head/bin/sh/main.c 248980 2013-04-01 17:18:22Z 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>

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

75#include "builtins.h"
76
77int rootpid;
78int rootshell;
79struct jmploc main_handler;
80int localeisutf8, initial_localeisutf8;
81
82static void cmdloop(int);
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>

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

75#include "builtins.h"
76
77int rootpid;
78int rootshell;
79struct jmploc main_handler;
80int localeisutf8, initial_localeisutf8;
81
82static void cmdloop(int);
83static void read_profile(char *);
83static void read_profile(const char *);
84static char *find_dot_file(char *);
85
86/*
87 * Main routine. We initialize things, parse the arguments, execute
88 * profiles if we're a login shell, and then call cmdloop to execute
89 * commands. The setjmp call sets up the location to jump to when an
90 * exception occurs. When an exception occurs the variable "state"
91 * is used to figure out how far we had gotten.

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

234
235
236
237/*
238 * Read /etc/profile or .profile. Return on error.
239 */
240
241static void
84static char *find_dot_file(char *);
85
86/*
87 * Main routine. We initialize things, parse the arguments, execute
88 * profiles if we're a login shell, and then call cmdloop to execute
89 * commands. The setjmp call sets up the location to jump to when an
90 * exception occurs. When an exception occurs the variable "state"
91 * is used to figure out how far we had gotten.

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

234
235
236
237/*
238 * Read /etc/profile or .profile. Return on error.
239 */
240
241static void
242read_profile(char *name)
242read_profile(const char *name)
243{
244 int fd;
245 const char *expandedname;
246
247 expandedname = expandstr(name);
248 if (expandedname == NULL)
249 return;
250 INTOFF;

--- 90 unchanged lines hidden ---
243{
244 int fd;
245 const char *expandedname;
246
247 expandedname = expandstr(name);
248 if (expandedname == NULL)
249 return;
250 INTOFF;

--- 90 unchanged lines hidden ---