Update of /cvsroot/winbash/winbash/builtins
In directory usw-pr-cvs1:/tmp/cvs-serv16581/builtins
Modified Files:
Makefile alias.def bind.def cd.def command.def common.c
declare.def echo.def enable.def exec.def exit.def fc.def
getopts.def hash.def help.def history.def read.def return.def
set.def setattr.def source.def times.def trap.def type.def
ulimit.def umask.def
Log Message:
Added test target to top level Makefile. Aligned code (especially in
builtins) to closely resemble the GNU bash 1.14.7 source files. A lot
more work needs to be done to clean the source up to make some sense
out of this mess. I am confident we'll get there sooner or later :)
Index: Makefile
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/Makefile,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Makefile 10 Mar 2002 15:54:10 -0000 1.3
+++ Makefile 20 Mar 2002 02:09:55 -0000 1.4
@@ -10,7 +10,7 @@
RM = rm -f
CP = cp
-CPPDEFS = -DWIN32 -D_WINDOWS -D__NT_VC__ -DHAVE_STRING_H
+CPPDEFS = -DWIN32 -D_WINDOWS -D__NT_VC__ -DHAVE_STRING_H -DBrainDeath
CPPFLAGS += -I.
CPPFLAGS += -I../lib
CPPFLAGS += -I../dum_inc
Index: alias.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/alias.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- alias.def 10 Mar 2002 21:45:13 -0000 1.3
+++ alias.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -37,9 +37,9 @@
# include <stdio.h>
# include "../shell.h"
# include "../alias.h"
-# include "nt_types.h"
# include "common.h"
+//extern int interactive;
static void print_alias ();
/* Hack the alias command in a Korn shell way. */
Index: bind.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/bind.def,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- bind.def 11 Mar 2002 14:32:13 -0000 1.6
+++ bind.def 20 Mar 2002 02:09:55 -0000 1.7
@@ -52,14 +52,10 @@
#include <readline/history.h>
#include "bashgetopt.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
static int query_bindings ();
extern int bash_readline_initialized;
-/*extern int no_line_editing;*/
+//extern int no_line_editing;
#define BIND_RETURN(x) do { return_code = x; goto bind_exit; } while (0)
Index: cd.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/cd.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cd.def 9 Mar 2002 04:20:36 -0000 1.2
+++ cd.def 20 Mar 2002 02:09:55 -0000 1.3
@@ -37,7 +37,6 @@
#include "../flags.h"
#include "../maxpath.h"
#include "common.h"
-#include "../nt_types.h"
#include <windows.h>
#include <wincon.h>
Index: command.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/command.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- command.def 10 Mar 2002 21:45:14 -0000 1.3
+++ command.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -39,8 +39,9 @@
#endif /* !HAVE_STRING_H */
#include "../shell.h"
-#include "../nt_types.h"
#include "bashgetopt.h"
+
+//extern int subshell_environment;
static void restore_path ();
static char *get_standard_path ();
Index: common.c
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/common.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- common.c 11 Mar 2002 14:32:13 -0000 1.5
+++ common.c 20 Mar 2002 02:09:55 -0000 1.6
@@ -36,7 +36,6 @@
#include "../builtins.h"
#include "../input.h"
#include "../execute_cmd.h"
-#include "../nt_types.h"
#include "hashcom.h"
#include "common.h"
#include <tilde/tilde.h>
Index: declare.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/declare.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- declare.def 11 Mar 2002 01:47:04 -0000 1.4
+++ declare.def 20 Mar 2002 02:09:55 -0000 1.5
@@ -56,7 +56,6 @@
#endif /* !HAVE_STRING_H */
#include "../shell.h"
-#include "../nt_types.h"
extern int array_needs_making;
Index: echo.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/echo.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- echo.def 10 Mar 2002 15:54:11 -0000 1.3
+++ echo.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -58,10 +58,6 @@
# define VALID_ECHO_OPTIONS "n"
#endif /* !V9_ECHO */
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
/* Print the words in LIST to standard output. If the first word is
`-n', then don't print a trailing newline. We also support the
echo syntax from Version 9 unix systems. */
Index: enable.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/enable.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- enable.def 10 Mar 2002 15:54:11 -0000 1.3
+++ enable.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -35,10 +35,6 @@
#include "../builtins.h"
#include "common.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
#define ENABLED 1
#define DISABLED 2
Index: exec.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/exec.def,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- exec.def 11 Mar 2002 14:32:13 -0000 1.5
+++ exec.def 20 Mar 2002 02:09:55 -0000 1.6
@@ -41,7 +41,6 @@
#include "../execute_cmd.h"
#include "common.h"
#include "../flags.h"
-#include "../nt_types.h"
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
@@ -132,11 +131,7 @@
end_job_control ();
#endif /* JOB_CONTROL */
-#if defined (__NT_VC__)
- nt_shell_execve (command, args, export_env);
-#else /* !__NT_VC__ */
shell_execve (command, args, export_env);
-#endif /* !__NT_VC__ */
adjust_shell_level (1);
Index: exit.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/exit.def,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- exit.def 14 Mar 2002 00:52:38 -0000 1.6
+++ exit.def 20 Mar 2002 02:09:55 -0000 1.7
@@ -32,9 +32,11 @@
#include <sys/types.h>
#include "../shell.h"
#include "../jobs.h"
-#include "../nt_types.h"
#include "builtext.h" /* for jobs_builtin */
+
+//extern int interactive, login_shell;
+//extern int last_command_exit_value;
static int exit_or_logout ();
static int sourced_logout = 0;
Index: fc.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/fc.def,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- fc.def 11 Mar 2002 04:50:29 -0000 1.5
+++ fc.def 20 Mar 2002 02:09:55 -0000 1.6
@@ -62,10 +62,6 @@
#include <readline/history.h>
#include "bashgetopt.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
extern int errno;
Index: getopts.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/getopts.def,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- getopts.def 11 Mar 2002 14:32:14 -0000 1.6
+++ getopts.def 20 Mar 2002 02:09:55 -0000 1.7
@@ -66,7 +66,6 @@
#endif /* !HAVE_STRING_H */
#include "../shell.h"
-#include "../nt_types.h"
#if defined (GETOPTS_BUILTIN)
#include "getopt.h"
Index: hash.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/hash.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- hash.def 10 Mar 2002 15:54:11 -0000 1.3
+++ hash.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -48,10 +48,6 @@
#include "common.h"
#include "../execute_cmd.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
extern int dot_found_in_search;
void
Index: help.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/help.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- help.def 10 Mar 2002 15:54:11 -0000 1.3
+++ help.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -39,10 +39,6 @@
# define FNM_NOMATCH 1
#endif /* USE_GLOB_LIBRARY */
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
/* Print out a list of the known functions in the shell, and what they do.
If LIST is supplied, print out the list which matches for each pattern
specified. */
Index: history.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/history.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- history.def 10 Mar 2002 15:54:11 -0000 1.3
+++ history.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -44,10 +44,6 @@
#include "../bashhist.h"
#include <readline/history.h>
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
/* History. Arg of -w FILENAME means write file, arg of -r FILENAME
means read file. Arg of N means only display that many items. */
Index: read.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/read.def,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- read.def 11 Mar 2002 14:32:14 -0000 1.5
+++ read.def 20 Mar 2002 02:09:55 -0000 1.6
@@ -34,7 +34,6 @@
#include <stdio.h>
#include "../shell.h"
-#include "nt_types.h"
#include "common.h"
#define issep(c) (strchr (ifs_chars, (c)) != (char *)0)
@@ -131,7 +130,7 @@
#endif
{
if (i + 2 >= size)
- input_string = xrealloc (input_string, size += 128);
+ input_string = xrealloc (input_string, size += 128);
/* If the next character is to be accepted verbatim, a backslash
newline pair still disappears from the input. */
@@ -154,16 +153,19 @@
}
if (c == '\n')
- {
+ {
#if defined (__NT_VC__)
- if (input_string[i-1] == '\r')
- i--;
+ if (input_string[i-1] == '\r')
+ i--;
#endif
- break;
- }
+ break;
+ }
if (c == CTLESC || c == CTLNUL)
- input_string[i++] = CTLESC;
+ {
+ saw_escape++;
+ input_string[i++] = CTLESC;
+ }
input_string[i++] = c;
}
@@ -173,8 +175,7 @@
discard_unwind_frame ("read_builtin");
#if !defined (__NT_VC__)
- FCLOSE (input_stream);
- close (fildes);
+ fclose (input_stream);
#endif
if (c == EOF)
Index: return.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/return.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- return.def 14 Mar 2002 00:52:38 -0000 1.4
+++ return.def 20 Mar 2002 02:09:55 -0000 1.5
@@ -30,8 +30,8 @@
$END
#include "../shell.h"
-#include "../nt_types.h"
+//extern int last_command_exit_value;
extern int return_catch_flag, return_catch_value;
extern jmp_buf return_catch;
Index: set.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/set.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- set.def 11 Mar 2002 14:32:14 -0000 1.4
+++ set.def 20 Mar 2002 02:09:55 -0000 1.5
@@ -24,10 +24,10 @@
#include <stdio.h>
#include "../shell.h"
#include "../flags.h"
-#include "../nt_types.h"
#include "bashgetopt.h"
+//extern int interactive;
extern int noclobber, no_brace_expansion, posixly_correct;
#if defined (READLINE)
extern int rl_editing_mode; //, no_line_editing;
Index: setattr.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/setattr.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- setattr.def 10 Mar 2002 15:54:11 -0000 1.4
+++ setattr.def 20 Mar 2002 02:09:55 -0000 1.5
@@ -25,10 +25,6 @@
#include "common.h"
#include "bashgetopt.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
extern int array_needs_making;
extern char *this_command_name;
Index: source.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/source.def,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- source.def 14 Mar 2002 00:52:38 -0000 1.6
+++ source.def 20 Mar 2002 02:09:55 -0000 1.7
@@ -50,7 +50,6 @@
#include "../posixstat.h"
#include "../filecntl.h"
#include "../execute_cmd.h"
-#include "../nt_types.h"
/* Not all systems declare ERRNO in errno.h... and some systems #define it! */
#if !defined (errno)
@@ -61,6 +60,7 @@
extern int return_catch_flag, return_catch_value;
extern jmp_buf return_catch;
extern int posixly_correct;
+//extern int interactive, interactive_shell, last_command_exit_value;
/* How many `levels' of sourced files we have. */
int sourcelevel = 0;
Index: times.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/times.def,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- times.def 9 Mar 2002 04:20:36 -0000 1.2
+++ times.def 20 Mar 2002 02:09:55 -0000 1.3
@@ -64,7 +64,7 @@
putchar ('\n');
#else /* _POSIX_VERSION || !HAVE_RESOURCE || !RUSAGE_SELF */
-# if !defined (BrainDeath) && !defined (__NT_VC__)
+# if !defined (BrainDeath)
struct tms t;
times (&t);
Index: trap.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/trap.def,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- trap.def 11 Mar 2002 14:32:14 -0000 1.4
+++ trap.def 20 Mar 2002 02:09:55 -0000 1.5
@@ -40,7 +40,6 @@
#include <signal.h>
#include "../shell.h"
#include "../trap.h"
-#include "../nt_types.h"
#include "common.h"
/* The trap command:
@@ -61,6 +60,7 @@
#define REVERT 1 /* Revert to this signals original value. */
#define IGNORE 2 /* Ignore this signal. */
+//extern int interactive;
trap_builtin (list)
WORD_LIST *list;
Index: type.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/type.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- type.def 10 Mar 2002 15:54:11 -0000 1.3
+++ type.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -52,10 +52,6 @@
#include "common.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
extern STRING_INT_ALIST word_token_alist[];
/* For each word in LIST, find out what the shell is going to do with
Index: ulimit.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/ulimit.def,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- ulimit.def 11 Mar 2002 14:32:14 -0000 1.5
+++ ulimit.def 20 Mar 2002 02:09:55 -0000 1.6
@@ -69,12 +69,12 @@
# include <sys/times.h>
#endif
-#if defined (_POSIX_VERSION)
-# include <limits.h>
+#if defined (HAVE_UNISTD_H)
+# include <unistd.h>
#endif
-#if defined (__NT_VC__)
-#include "../nt_types.h"
+#if defined (HAVE_LIMITS_H)
+# include <limits.h>
#endif
/* Check for the most basic symbols. If they aren't present, this
Index: umask.def
===================================================================
RCS file: /cvsroot/winbash/winbash/builtins/umask.def,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- umask.def 10 Mar 2002 15:54:11 -0000 1.3
+++ umask.def 20 Mar 2002 02:09:55 -0000 1.4
@@ -38,10 +38,6 @@
#include "../posixstat.h"
#include "common.h"
-#if defined (__NT_VC__)
-#include "../nt_types.h"
-#endif
-
/* **************************************************************** */
/* */
/* UMASK Builtin and Helpers */
|