Update of /cvsroot/winbash/winbash
In directory usw-pr-cvs1:/tmp/cvs-serv16581
Modified Files:
.build Makefile execute_cmd.c general.c input.c jobs.c
nt_types.h print_cmd.c shell.c shell.h subst.c trap.c
variables.c version.h
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: .build
===================================================================
RCS file: /cvsroot/winbash/winbash/.build,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- .build 14 Mar 2002 02:30:39 -0000 1.11
+++ .build 20 Mar 2002 02:09:54 -0000 1.12
@@ -1 +1 @@
-9
+24
Index: Makefile
===================================================================
RCS file: /cvsroot/winbash/winbash/Makefile,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- Makefile 16 Mar 2002 02:36:07 -0000 1.9
+++ Makefile 20 Mar 2002 02:09:54 -0000 1.10
@@ -177,13 +177,17 @@
# Define all your symbols before here
#--------------------------------------------------------------------------
-all : bash.exe sh.exe
+all : sh.exe
-bash.exe : builtins/builtins.lib $(BASH-OBJS)
- link.exe $(LDFLAGS) -out:$@ $^ $(LDLIBS)
+test :
+ cd tests ; $(MAKE)
sh.exe : bash.exe
cp $^ $@
+
+bash.exe : builtins/builtins.lib $(BASH-OBJS)
+ link.exe $(LDFLAGS) -out:$@ $^ $(LDLIBS)
+
builtins/builtins.lib: $(BUILTIN_SRCS)
cd builtins ; $(MAKE)
Index: execute_cmd.c
===================================================================
RCS file: /cvsroot/winbash/winbash/execute_cmd.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- execute_cmd.c 11 Mar 2002 14:32:12 -0000 1.6
+++ execute_cmd.c 20 Mar 2002 02:09:54 -0000 1.7
@@ -23,7 +23,6 @@
#if defined (__NT_VC__)
#include <windows.h>
#include <malloc.h>
-//const char *find_hashed_filename_nt (const char *);
#endif /* __NT_VC__ */
#include <stdio.h>
@@ -149,16 +148,23 @@
int return_catch_value;
jmp_buf return_catch;
+/* The value returned by the last synchronous command. */
+//int last_command_exit_value = 0;
+
/* The list of redirections to perform which will undo the redirections
that I made in the shell. */
-REDIRECT *redirection_undo_list = (REDIRECT *) NULL;
+REDIRECT *redirection_undo_list = (REDIRECT *)NULL;
/* The list of redirections to perform which will undo the internal
redirections performed by the `exec' builtin. These are redirections
that must be undone even when exec discards redirection_undo_list. */
-REDIRECT *exec_redirection_undo_list = (REDIRECT *) NULL;
+REDIRECT *exec_redirection_undo_list = (REDIRECT *)NULL;
-struct fd_bitmap *current_fds_to_close = (struct fd_bitmap *) NULL;
+/* Non-zero if we have just forked and are currently running in a subshell
+ environment. */
+//int subshell_environment = 0;
+
+struct fd_bitmap *current_fds_to_close = (struct fd_bitmap *)NULL;
#define FD_BITMAP_DEFAULT_SIZE 32
/* Functions to allocate and deallocate the structures used to pass
Index: general.c
===================================================================
RCS file: /cvsroot/winbash/winbash/general.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- general.c 11 Mar 2002 04:50:29 -0000 1.5
+++ general.c 20 Mar 2002 02:09:54 -0000 1.6
@@ -702,7 +702,7 @@
char *
make_absolute (string, dot_path)
char *string, *dot_path;
- {
+{
char *result;
int result_len = string ? strlen(string) : 0;
Index: input.c
===================================================================
RCS file: /cvsroot/winbash/winbash/input.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- input.c 11 Mar 2002 14:32:12 -0000 1.3
+++ input.c 20 Mar 2002 02:09:54 -0000 1.4
@@ -129,7 +129,6 @@
possible and necessary -- scripts read from stdin are still unbuffered),
allocate a new file descriptor to use for bash input, and re-initialize
the buffered stream. */
-
int
check_bash_input (fd)
int fd;
Index: jobs.c
===================================================================
RCS file: /cvsroot/winbash/winbash/jobs.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- jobs.c 11 Mar 2002 14:32:12 -0000 1.6
+++ jobs.c 20 Mar 2002 02:09:54 -0000 1.7
@@ -1583,30 +1583,6 @@
}
}
- /* If job control is enabled, the job was started with job
- control, the job was the foreground job, and it was killed
- by SIGINT, then print a newline to compensate for the kernel
- printing the ^C without a trailing newline. */
- if (job_control && (jobs[job]->flags & J_JOBCONTROL) &&
- (jobs[job]->flags & J_FOREGROUND) &&
- WIFSIGNALED (child->status) &&
- WTERMSIG (child->status) == SIGINT)
- {
- /* If SIGINT is not trapped, set the interrupt state if in a
- loop so the loop will be broken. If not in a loop, print
- the newline that the kernel does not. */
- if (signal_is_trapped (SIGINT) == 0)
- {
- if (loop_level)
- interrupt_state++;
- else
- {
- putchar ('\n');
- fflush (stdout);
- }
- }
- }
-
notify_and_cleanup ();
}
else
Index: nt_types.h
===================================================================
RCS file: /cvsroot/winbash/winbash/nt_types.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- nt_types.h 15 Mar 2002 17:14:55 -0000 1.3
+++ nt_types.h 20 Mar 2002 02:09:54 -0000 1.4
@@ -145,6 +145,8 @@
/* Thread I/O routines. */
extern int thr_printf (const char *, ...);
+#define shell_execve(c, a, e) nt_shell_execve(c, a, e);
+
#if defined (stdin)
#undef stdin
#endif /* stdin */
Index: print_cmd.c
===================================================================
RCS file: /cvsroot/winbash/winbash/print_cmd.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- print_cmd.c 10 Mar 2002 23:25:31 -0000 1.3
+++ print_cmd.c 20 Mar 2002 02:09:54 -0000 1.4
@@ -66,9 +66,9 @@
#define PRINTED_COMMAND_GROW_SIZE 1024
-/* char *the_printed_command = (char *)NULL; */
-/* int command_string_index = 0; */
+//char *the_printed_command = (char *)NULL;
__declspec (thread) static int the_printed_command_size = 0;
+//int command_string_index = 0;
/* Non-zero means the stuff being printed is inside of a function def. */
static int inside_function_def = 0;
Index: shell.c
===================================================================
RCS file: /cvsroot/winbash/winbash/shell.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- shell.c 11 Mar 2002 14:32:12 -0000 1.6
+++ shell.c 20 Mar 2002 02:09:54 -0000 1.7
@@ -125,15 +125,15 @@
-1 = login shell from "-login" flag.
-2 = both from getty, and from flag.
*/
-/* int login_shell = 0; */
+//int login_shell = 0;
/* Non-zero means that at this moment, the shell is interactive. In
general, this means that the shell is at this moment reading input
from the keyboard. */
-/* int interactive = 0; */
+//int interactive = 0;
/* Non-zero means that the shell was started as an interactive shell. */
-/* int interactive_shell = 0; */
+//int interactive_shell = 0;
/* Tells what state the shell was in when it started:
0 = non-interactive shell script
@@ -147,7 +147,7 @@
int debugging_login_shell = 0;
/* The environment that the shell passes to other commands. */
-/* char **shell_environment; */
+//char **shell_environment;
/* Non-zero when we are executing a top-level command. */
int executing = 0;
@@ -169,7 +169,7 @@
/* The number of times BASH has been executed. This is set
by initialize_variables () in variables.c. */
-/* int shell_level = 0; */
+//int shell_level = 0;
/* The name of this shell, as taken from argv[0]. */
char *shell_name = (char *)NULL;
Index: shell.h
===================================================================
RCS file: /cvsroot/winbash/winbash/shell.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- shell.h 11 Mar 2002 14:32:12 -0000 1.4
+++ shell.h 20 Mar 2002 02:09:54 -0000 1.5
@@ -105,3 +105,7 @@
};
extern struct user_info current_user;
+
+#if defined (__NT_VC__)
+#include "../nt_types.h"
+#endif
Index: subst.c
===================================================================
RCS file: /cvsroot/winbash/winbash/subst.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- subst.c 14 Mar 2002 22:05:58 -0000 1.9
+++ subst.c 20 Mar 2002 02:09:54 -0000 1.10
@@ -70,6 +70,8 @@
pid_t last_command_subst_pid = NO_PID;
/* Extern functions and variables from different files. */
+//extern int last_command_exit_value, interactive, interactive_shell;
+//extern int subshell_environment;
extern pid_t nt_make_child (enum dispatch_command_type,
COMMAND *,
WORD_LIST *,
@@ -83,14 +85,13 @@
int,
int *,
char *);
-
extern int dollar_dollar_pid, no_brace_expansion;
extern int posixly_correct;
extern int eof_encountered, eof_encountered_limit, ignoreeof;
extern char *this_command_name;
extern jmp_buf top_level;
#if defined (READLINE)
-/* extern int no_line_editing; */
+//extern int no_line_editing;
extern int hostname_list_initialized;
#endif
Index: trap.c
===================================================================
RCS file: /cvsroot/winbash/winbash/trap.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- trap.c 11 Mar 2002 14:32:12 -0000 1.6
+++ trap.c 20 Mar 2002 02:09:55 -0000 1.7
@@ -620,10 +620,10 @@
sigmodes[SIGINT] &= ~SIG_INPROGRESS;
if (sigmodes[SIGINT] & SIG_CHANGED)
- {
- free (saved_command);
- sigmodes[SIGINT] &= ~SIG_CHANGED;
- }
+ {
+ free (saved_command);
+ sigmodes[SIGINT] &= ~SIG_CHANGED;
+ }
}
}
Index: variables.c
===================================================================
RCS file: /cvsroot/winbash/winbash/variables.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- variables.c 11 Mar 2002 14:32:12 -0000 1.5
+++ variables.c 20 Mar 2002 02:09:55 -0000 1.6
@@ -555,11 +555,11 @@
list = (SHELL_VAR **)
xrealloc (list, (list_size += 20) * sizeof (SHELL_VAR *));
- list[list_index++] = var;
- list[list_index] = (SHELL_VAR *)NULL;
- }
- tlist = tlist->next;
- }
+ list[list_index++] = var;
+ list[list_index] = (SHELL_VAR *)NULL;
+ }
+ tlist = tlist->next;
+ }
}
return (list);
}
Index: version.h
===================================================================
RCS file: /cvsroot/winbash/winbash/version.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- version.h 14 Mar 2002 02:30:39 -0000 1.11
+++ version.h 20 Mar 2002 02:09:55 -0000 1.12
@@ -8,9 +8,9 @@
#define PATCHLEVEL 7
/* The last built version of this shell. */
-#define BUILDVERSION 9
+#define BUILDVERSION 24
/* A version string for use by sccs and the what command. */
-#define SCCSVERSION "@(#)Bash version 1.14.7(9) GNU"
+#define SCCSVERSION "@(#)Bash version 1.14.7(24) GNU"
|