-/* $OpenBSD: alloc.c,v 1.12 2015/10/17 13:32:46 mmcc Exp $ */
+/* $OpenBSD: alloc.c,v 1.13 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Copyright (c) 2002 Marc Espie.
*
*/
#include <stdint.h>
+
#include "sh.h"
struct link {
-/* $OpenBSD: c_ksh.c,v 1.43 2015/10/09 19:36:27 tedu Exp $ */
+/* $OpenBSD: c_ksh.c,v 1.44 2015/10/19 02:15:45 mmcc Exp $ */
/*
* built-in Korn commands: c_*
*/
-#include "sh.h"
#include <sys/stat.h>
+
#include <ctype.h>
+#include "sh.h"
int
c_cd(char **wp)
-/* $OpenBSD: c_sh.c,v 1.50 2015/10/10 00:10:07 deraadt Exp $ */
+/* $OpenBSD: c_sh.c,v 1.51 2015/10/19 02:15:45 mmcc Exp $ */
/*
* built-in Bourne commands
*/
-#include "sh.h"
+#include <sys/resource.h>
#include <sys/stat.h>
#include <sys/time.h>
-#include <sys/resource.h>
+
+#include "sh.h"
static void p_time(struct shf *, int, struct timeval *, int, char *, char *);
-/* $OpenBSD: c_test.c,v 1.20 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: c_test.c,v 1.21 2015/10/19 02:15:45 mmcc Exp $ */
/*
* test(1); version 7-like -- author Erik Baalbergen
* modified by J.T. Conklin to add POSIX compatibility.
*/
-#include "sh.h"
#include <sys/stat.h>
+
+#include "sh.h"
#include "c_test.h"
/* test(1) accepts the following grammar:
-/* $OpenBSD: c_ulimit.c,v 1.20 2015/09/15 18:15:05 tedu Exp $ */
+/* $OpenBSD: c_ulimit.c,v 1.21 2015/10/19 02:15:45 mmcc Exp $ */
/*
ulimit -- handle "ulimit" builtin
that was originally under case SYSULIMIT in source file "xec.c".
*/
-#include "sh.h"
#include <sys/resource.h>
+#include "sh.h"
+
#define SOFT 0x1
#define HARD 0x2
-/* $OpenBSD: edit.c,v 1.46 2015/10/09 19:36:27 tedu Exp $ */
+/* $OpenBSD: edit.c,v 1.47 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Command line editing - common code
#include "config.h"
#ifdef EDIT
-#include "sh.h"
-#include "tty.h"
-#include "edit.h"
#include <sys/ioctl.h>
+#include <sys/stat.h>
+
#include <ctype.h>
#include <libgen.h>
-#include <sys/stat.h>
+
+#include "sh.h"
+#include "edit.h"
+#include "tty.h"
X_chars edchars;
-/* $OpenBSD: emacs.c,v 1.58 2015/10/16 23:18:59 mmcc Exp $ */
+/* $OpenBSD: emacs.c,v 1.59 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Emacs-like command line editing and history
#include "config.h"
#ifdef EMACS
-#include "sh.h"
-#include <sys/stat.h>
#include <sys/queue.h>
+#include <sys/stat.h>
+
#include <ctype.h>
#include <locale.h>
+
+#include "sh.h"
#include "edit.h"
static Area aedit;
-/* $OpenBSD: eval.c,v 1.43 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: eval.c,v 1.44 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Expansion - quoting, separation, substitution, globbing
*/
-#include "sh.h"
-#include <pwd.h>
-#include <dirent.h>
#include <sys/stat.h>
+#include <dirent.h>
+#include <pwd.h>
+
+#include "sh.h"
+
/*
* string expansion
*
-/* $OpenBSD: exec.c,v 1.59 2015/10/17 18:43:22 mmcc Exp $ */
+/* $OpenBSD: exec.c,v 1.60 2015/10/19 02:15:45 mmcc Exp $ */
/*
* execute command tree
*/
-#include "sh.h"
-#include "c_test.h"
-#include <ctype.h>
#include <sys/stat.h>
+
+#include <ctype.h>
#include <paths.h>
+#include "sh.h"
+#include "c_test.h"
+
/* Does ps4 get parameter substitutions done? */
# define PS4_SUBSTITUTE(s) substitute((s), 0)
-/* $OpenBSD: expr.c,v 1.28 2015/09/22 21:50:40 millert Exp $ */
+/* $OpenBSD: expr.c,v 1.29 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Korn expression evaluation
* todo: better error handling: if in builtin, should be builtin error, etc.
*/
-#include "sh.h"
#include <ctype.h>
+#include "sh.h"
/* The order of these enums is constrained by the order of opinfo[] */
enum token {
-/* $OpenBSD: history.c,v 1.47 2015/10/09 19:36:27 tedu Exp $ */
+/* $OpenBSD: history.c,v 1.48 2015/10/19 02:15:45 mmcc Exp $ */
/*
* command history
* to work on your system
*/
-#include "sh.h"
#include <sys/stat.h>
+#include "sh.h"
+
#ifdef HISTORY
# include <sys/mman.h>
-/* $OpenBSD: io.c,v 1.30 2015/09/22 21:50:40 millert Exp $ */
+/* $OpenBSD: io.c,v 1.31 2015/10/19 02:15:45 mmcc Exp $ */
/*
* shell buffered IO and formatted output
*/
+#include <sys/stat.h>
+
#include <ctype.h>
+
#include "sh.h"
-#include <sys/stat.h>
static int initio_done;
-/* $OpenBSD: jobs.c,v 1.47 2015/09/17 21:39:54 nicm Exp $ */
+/* $OpenBSD: jobs.c,v 1.48 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Process and job control
*
*/
-#include "sh.h"
+#include <sys/resource.h>
#include <sys/stat.h>
-#include <sys/wait.h>
#include <sys/time.h>
-#include <sys/resource.h>
+#include <sys/wait.h>
+
+#include "sh.h"
#include "tty.h"
/* Order important! */
-/* $OpenBSD: lex.c,v 1.59 2015/10/10 22:09:23 nicm Exp $ */
+/* $OpenBSD: lex.c,v 1.60 2015/10/19 02:15:45 mmcc Exp $ */
/*
* lexical analysis and source input
*/
-#include "sh.h"
-#include <libgen.h>
#include <ctype.h>
+#include <libgen.h>
+#include "sh.h"
/*
* states while lexing word
-/* $OpenBSD: mail.c,v 1.20 2015/10/09 19:36:27 tedu Exp $ */
+/* $OpenBSD: mail.c,v 1.21 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Mailbox checking code by Robert J. Gibson, adapted for PD ksh by
* John R. MacMillan
*/
-#include "config.h"
-
-#include "sh.h"
#include <sys/stat.h>
+
#include <time.h>
+#include "config.h"
+#include "sh.h"
+
#define MBMESSAGE "you have mail in $_"
typedef struct mbox {
-/* $OpenBSD: main.c,v 1.66 2015/10/18 18:05:35 mmcc Exp $ */
+/* $OpenBSD: main.c,v 1.67 2015/10/19 02:15:45 mmcc Exp $ */
/*
* startup, main loop, environments and error handling
#define EXTERN /* define EXTERNs in sh.h */
-#include "sh.h"
#include <sys/stat.h>
-#include <pwd.h>
+
#include <paths.h>
+#include <pwd.h>
+
+#include "sh.h"
extern char **environ;
-/* $OpenBSD: misc.c,v 1.46 2015/09/22 21:50:40 millert Exp $ */
+/* $OpenBSD: misc.c,v 1.47 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Miscellaneous functions
*/
-#include "sh.h"
#include <ctype.h>
+
+#include "sh.h"
#include "charclass.h"
short ctypes [UCHAR_MAX+1]; /* type bits for unsigned char */
-/* $OpenBSD: mknod.c,v 1.2 2009/10/27 23:59:21 deraadt Exp $ */
+/* $OpenBSD: mknod.c,v 1.3 2015/10/19 02:15:45 mmcc Exp $ */
/* $NetBSD: mknod.c,v 1.8 1995/08/11 00:08:18 jtc Exp $ */
/*
#include <sys/types.h>
#include <sys/stat.h>
+
#include <errno.h>
#include "sh.h"
-/* $OpenBSD: path.c,v 1.15 2015/10/06 21:35:16 nicm Exp $ */
+/* $OpenBSD: path.c,v 1.16 2015/10/19 02:15:45 mmcc Exp $ */
-#include "sh.h"
#include <sys/stat.h>
+#include "sh.h"
+
/*
* Contains a routine to search a : separated list of
* paths (a la CDPATH) and make appropriate file names.
-/* $OpenBSD: shf.c,v 1.22 2015/09/18 07:28:24 nicm Exp $ */
+/* $OpenBSD: shf.c,v 1.23 2015/10/19 02:15:45 mmcc Exp $ */
/*
* Shell file I/O routines
*/
-#include "sh.h"
#include <sys/stat.h>
+#include "sh.h"
/* flags to shf_emptybuf() */
#define EB_READSW 0x01 /* about to switch to reading */
-/* $OpenBSD: var.c,v 1.50 2015/09/22 21:50:40 millert Exp $ */
+/* $OpenBSD: var.c,v 1.51 2015/10/19 02:15:45 mmcc Exp $ */
-#include "sh.h"
-#include <time.h>
#include <sys/stat.h>
+
#include <ctype.h>
+#include <time.h>
+
+#include "sh.h"
/*
* Variables
-/* $OpenBSD: vi.c,v 1.34 2015/10/15 19:36:50 mmcc Exp $ */
+/* $OpenBSD: vi.c,v 1.35 2015/10/19 02:15:45 mmcc Exp $ */
/*
* vi command editing
#include "config.h"
#ifdef VI
-#include "sh.h"
-#include <ctype.h>
#include <sys/stat.h> /* completion */
+
+#include <ctype.h>
+
+#include "sh.h"
#include "edit.h"
#define CMDLEN 2048