View | Details | Raw Unified | Return to bug 6082
Collapse All | Expand All

(-)bash-2.05b.orig/bashjmp.h (+2 lines)
Lines 27-33 extern procenv_t top_level; Link Here
27
extern procenv_t	subshell_top_level;
27
extern procenv_t	subshell_top_level;
28
extern procenv_t	return_catch;	/* used by `return' builtin */
28
extern procenv_t	return_catch;	/* used by `return' builtin */
29
29
30
#ifdef INCLUDE_UNUSED
30
#define SHFUNC_RETURN()	longjmp (return_catch, 1)
31
#define SHFUNC_RETURN()	longjmp (return_catch, 1)
32
#endif
31
33
32
#define COPY_PROCENV(old, save) \
34
#define COPY_PROCENV(old, save) \
33
	xbcopy ((char *)old, (char *)save, sizeof (procenv_t));
35
	xbcopy ((char *)old, (char *)save, sizeof (procenv_t));
(-)bash-2.05b.orig/bashline.c (-3 / +3 lines)
Lines 542-548 snarf_hosts_from_file (filename) Link Here
542
  if (file == 0)
542
  if (file == 0)
543
    return;
543
    return;
544
544
545
  while (temp = fgets (buffer, 255, file))
545
  while ((temp = fgets (buffer, 255, file)))
546
    {
546
    {
547
      /* Skip to first character. */
547
      /* Skip to first character. */
548
      for (i = 0; buffer[i] && cr_whitespace (buffer[i]); i++)
548
      for (i = 0; buffer[i] && cr_whitespace (buffer[i]); i++)
Lines 1603-1609 bash_groupname_completion_function (text Link Here
1603
      setgrent ();
1603
      setgrent ();
1604
    }
1604
    }
1605
1605
1606
  while (grent = getgrent ())
1606
  while ((grent = getgrent ()))
1607
    {
1607
    {
1608
      if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen)))
1608
      if (gnamelen == 0 || (STREQN (gname, grent->gr_name, gnamelen)))
1609
        break;
1609
        break;
Lines 2757-2763 isolate_sequence (string, ind, need_dquo Link Here
2757
  if (startp)
2757
  if (startp)
2758
    *startp = delim ? ++i : i;
2758
    *startp = delim ? ++i : i;
2759
2759
2760
  for (passc = 0; c = string[i]; i++)
2760
  for (passc = 0; (c = string[i]); i++)
2761
    {
2761
    {
2762
      if (passc)
2762
      if (passc)
2763
	{
2763
	{
(-)bash-2.05b.orig/braces.c (-1 / +1 lines)
Lines 260-266 brace_gobbler (text, tlen, indx, satisfy Link Here
260
  level = quoted = pass_next = 0;
260
  level = quoted = pass_next = 0;
261
261
262
  i = *indx;
262
  i = *indx;
263
  while (c = text[i])
263
  while ((c = text[i]))
264
    {
264
    {
265
      if (pass_next)
265
      if (pass_next)
266
	{
266
	{
(-)bash-2.05b.orig/builtins/bind.def (+2 lines)
Lines 123-128 bind_builtin (list) Link Here
123
123
124
  rl_outstream = stdout;
124
  rl_outstream = stdout;
125
125
126
  cmd_seq = NULL; /* never used */
127
126
  reset_internal_getopt ();  
128
  reset_internal_getopt ();  
127
  while ((opt = internal_getopt (list, "lvpVPsSf:q:u:m:r:x:")) != EOF)
129
  while ((opt = internal_getopt (list, "lvpVPsSf:q:u:m:r:x:")) != EOF)
128
    {
130
    {
(-)bash-2.05b.orig/builtins/cd.def (-2 / +2 lines)
Lines 203-215 cd_builtin (list) Link Here
203
    }
203
    }
204
  else if (absolute_pathname (list->word->word))
204
  else if (absolute_pathname (list->word->word))
205
    dirname = list->word->word;
205
    dirname = list->word->word;
206
  else if (cdpath = get_string_value ("CDPATH"))
206
  else if ((cdpath = get_string_value ("CDPATH")))
207
    {
207
    {
208
      dirname = list->word->word;
208
      dirname = list->word->word;
209
209
210
      /* Find directory in $CDPATH. */
210
      /* Find directory in $CDPATH. */
211
      path_index = 0;
211
      path_index = 0;
212
      while (path = extract_colon_unit (cdpath, &path_index))
212
      while ((path = extract_colon_unit (cdpath, &path_index)))
213
	{
213
	{
214
	  /* OPT is 1 if the path element is non-empty */
214
	  /* OPT is 1 if the path element is non-empty */
215
	  opt = path[0] != '\0';
215
	  opt = path[0] != '\0';
(-)bash-2.05b.orig/builtins/common.c (-1 / +1 lines)
Lines 244-250 sh_nojobs (s) Link Here
244
     char *s;
244
     char *s;
245
{
245
{
246
  if (s)
246
  if (s)
247
    builtin_error ("%s: no job control");
247
    builtin_error ("%s: no job control", s);
248
  else
248
  else
249
    builtin_error ("no job control");
249
    builtin_error ("no job control");
250
}
250
}
(-)bash-2.05b.orig/builtins/declare.def (-1 / +1 lines)
Lines 238-244 declare_internal (list, local_var) Link Here
238
#if defined (ARRAY_VARS)
238
#if defined (ARRAY_VARS)
239
      compound_array_assign = simple_array_assign = 0;
239
      compound_array_assign = simple_array_assign = 0;
240
      subscript_start = (char *)NULL;
240
      subscript_start = (char *)NULL;
241
      if (t = strchr (name, '['))	/* ] */
241
      if ((t = strchr (name, '[')))	/* ] */
242
	{
242
	{
243
	  subscript_start = t;
243
	  subscript_start = t;
244
	  *t = '\0';
244
	  *t = '\0';
(-)bash-2.05b.orig/builtins/echo.def (-1 / +1 lines)
Lines 110-116 echo_builtin (list) Link Here
110
110
111
      /* All of the options in TEMP are valid options to ECHO.
111
      /* All of the options in TEMP are valid options to ECHO.
112
	 Handle them. */
112
	 Handle them. */
113
      while (i = *temp++)
113
      while ((i = *temp++))
114
	{
114
	{
115
	  switch (i)
115
	  switch (i)
116
	    {
116
	    {
(-)bash-2.05b.orig/builtins/enable.def (-1 / +3 lines)
Lines 95-100 enable_builtin (list) Link Here
95
  int opt, filter;
95
  int opt, filter;
96
#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM)
96
#if defined (HAVE_DLOPEN) && defined (HAVE_DLSYM)
97
  char *filename;
97
  char *filename;
98
99
  filename = NULL;
98
#endif
100
#endif
99
101
100
  result = EXECUTION_SUCCESS;
102
  result = EXECUTION_SUCCESS;
Lines 334-340 dyn_load_builtin (list, flags, filename) Link Here
334
	b->flags |= SPECIAL_BUILTIN;
336
	b->flags |= SPECIAL_BUILTIN;
335
      b->handle = handle;
337
      b->handle = handle;
336
338
337
      if (old_builtin = builtin_address_internal (name, 1))
339
      if ((old_builtin = builtin_address_internal (name, 1)))
338
	{
340
	{
339
	  replaced++;
341
	  replaced++;
340
	  FASTCOPY ((char *)b, (char *)old_builtin, sizeof (struct builtin));
342
	  FASTCOPY ((char *)b, (char *)old_builtin, sizeof (struct builtin));
(-)bash-2.05b.orig/builtins/evalstring.c (-3 / +4 lines)
Lines 52-57 Link Here
52
extern int errno;
52
extern int errno;
53
#endif
53
#endif
54
54
55
extern int zcatfd (int fd, int ofd, const char *fn);
56
55
#define IS_BUILTIN(s)	(builtin_address_internal(s, 0) != (struct builtin *)NULL)
57
#define IS_BUILTIN(s)	(builtin_address_internal(s, 0) != (struct builtin *)NULL)
56
58
57
extern int indirection_level, startup_state, subshell_environment;
59
extern int indirection_level, startup_state, subshell_environment;
Lines 200-206 parse_and_execute (string, from_file, fl Link Here
200
	      dispose_command (global_command);
202
	      dispose_command (global_command);
201
	      global_command = (COMMAND *)NULL;
203
	      global_command = (COMMAND *)NULL;
202
	    }
204
	    }
203
	  else if (command = global_command)
205
	  else if ((command = global_command))
204
	    {
206
	    {
205
	      struct fd_bitmap *bitmap;
207
	      struct fd_bitmap *bitmap;
206
208
Lines 293-301 static int Link Here
293
cat_file (r)
295
cat_file (r)
294
     REDIRECT *r;
296
     REDIRECT *r;
295
{
297
{
296
  char lbuf[128], *fn;
298
  char *fn;
297
  int fd, rval;
299
  int fd, rval;
298
  ssize_t nr;
299
300
300
  if (r->instruction != r_input_direction)
301
  if (r->instruction != r_input_direction)
301
    return -1;
302
    return -1;
(-)bash-2.05b.orig/builtins/fg_bg.def (-4 / +2 lines)
Lines 132-142 fg_bg (list, foreground) Link Here
132
      goto failure;
132
      goto failure;
133
    }
133
    }
134
134
135
  old_async_pid = last_asynchronous_pid;
135
  if (foreground == 0)
136
  if (foreground == 0)
136
    {
137
    last_asynchronous_pid = jobs[job]->pgrp;	/* As per Posix.2 5.4.2 */
137
      old_async_pid = last_asynchronous_pid;
138
      last_asynchronous_pid = jobs[job]->pgrp;	/* As per Posix.2 5.4.2 */
139
    }
140
138
141
  status = start_job (job, foreground);
139
  status = start_job (job, foreground);
142
140
(-)bash-2.05b.orig/builtins/getopt.c (-1 / +1 lines)
Lines 177-183 sh_getopt (argc, argv, optstring) Link Here
177
      nextchar = (char *)NULL;
177
      nextchar = (char *)NULL;
178
    }
178
    }
179
179
180
  if (sh_badopt = (temp == NULL || c == ':'))
180
  if ((sh_badopt = (temp == NULL || c == ':')))
181
    {
181
    {
182
      if (sh_opterr)
182
      if (sh_opterr)
183
	BADOPT (c);
183
	BADOPT (c);
(-)bash-2.05b.orig/builtins/getopts.def (-1 / +1 lines)
Lines 164-172 dogetopts (argc, argv) Link Here
164
164
165
  special_error = optstr[0] == ':';
165
  special_error = optstr[0] == ':';
166
166
167
  old_opterr = sh_opterr;
167
  if (special_error)
168
  if (special_error)
168
    {
169
    {
169
      old_opterr = sh_opterr;
170
      optstr++;
170
      optstr++;
171
      sh_opterr = 0;		/* suppress diagnostic messages */
171
      sh_opterr = 0;		/* suppress diagnostic messages */
172
    }
172
    }
(-)bash-2.05b.orig/builtins/help.def (-1 / +3 lines)
Lines 61-66 $END Link Here
61
extern int errno;
61
extern int errno;
62
#endif
62
#endif
63
63
64
extern int zcatfd (int fd, int ofd, const char *fn);
65
64
static void show_builtin_command_help __P((void));
66
static void show_builtin_command_help __P((void));
65
static void show_longdoc __P((int));
67
static void show_longdoc __P((int));
66
68
Lines 112-118 help_builtin (list) Link Here
112
      pattern = list->word->word;
114
      pattern = list->word->word;
113
      plen = strlen (pattern);
115
      plen = strlen (pattern);
114
116
115
      for (i = 0; name = shell_builtins[i].name; i++)
117
      for (i = 0; (name = shell_builtins[i].name); i++)
116
	{
118
	{
117
	  QUIT;
119
	  QUIT;
118
	  if ((strncmp (pattern, name, plen) == 0) ||
120
	  if ((strncmp (pattern, name, plen) == 0) ||
(-)bash-2.05b.orig/builtins/history.def (+2 lines)
Lines 95-100 history_builtin (list) Link Here
95
  char *filename, *delete_arg;
95
  char *filename, *delete_arg;
96
  intmax_t delete_offset;
96
  intmax_t delete_offset;
97
97
98
  delete_arg = NULL; /* never used */
99
98
  flags = 0;
100
  flags = 0;
99
  reset_internal_getopt ();
101
  reset_internal_getopt ();
100
  while ((opt = internal_getopt (list, "acd:npsrw")) != -1)
102
  while ((opt = internal_getopt (list, "acd:npsrw")) != -1)
(-)bash-2.05b.orig/builtins/mkbuiltins.c (-3 / +3 lines)
Lines 524-530 extract_info (filename, structfile, exte Link Here
524
  output_cpp_line_info = 1;
524
  output_cpp_line_info = 1;
525
525
526
  /* Process each line in the array. */
526
  /* Process each line in the array. */
527
  for (i = 0; line = defs->lines->array[i]; i++)
527
  for (i = 0; (line = defs->lines->array[i]); i++)
528
    {
528
    {
529
      defs->line_number = i;
529
      defs->line_number = i;
530
530
Lines 640-646 free_defs (defs) Link Here
640
640
641
  if (defs->builtins)
641
  if (defs->builtins)
642
    {
642
    {
643
      for (i = 0; builtin = (BUILTIN_DESC *)defs->builtins->array[i]; i++)
643
      for (i = 0; (builtin = (BUILTIN_DESC *)defs->builtins->array[i]); i++)
644
	{
644
	{
645
	  free_builtin (builtin);
645
	  free_builtin (builtin);
646
	  free (builtin);
646
	  free (builtin);
Lines 1357-1363 write_documentation (stream, documentati Link Here
1357
  if (string_array)
1357
  if (string_array)
1358
    fprintf (stream, " {\n#if defined (HELP_BUILTIN)\n");
1358
    fprintf (stream, " {\n#if defined (HELP_BUILTIN)\n");
1359
1359
1360
  for (i = 0, texinfo = (flags & TEXINFO); line = documentation[i]; i++)
1360
  for (i = 0, texinfo = (flags & TEXINFO); (line = documentation[i]); i++)
1361
    {
1361
    {
1362
      /* Allow #ifdef's to be written out verbatim. */
1362
      /* Allow #ifdef's to be written out verbatim. */
1363
      if (*line == '#')
1363
      if (*line == '#')
(-)bash-2.05b.orig/builtins/read.def (+1 lines)
Lines 53-58 $END Link Here
53
#include "posixstat.h"
53
#include "posixstat.h"
54
54
55
#include <stdio.h>
55
#include <stdio.h>
56
#include <stdlib.h>
56
57
57
#if defined (HAVE_UNISTD_H)
58
#if defined (HAVE_UNISTD_H)
58
#  include <unistd.h>
59
#  include <unistd.h>
(-)bash-2.05b.orig/builtins/setattr.def (-1 / +1 lines)
Lines 248-254 set_or_show_attributes (list, attribute, Link Here
248
248
249
      if (variable_list)
249
      if (variable_list)
250
	{
250
	{
251
	  for (i = 0; var = variable_list[i]; i++)
251
	  for (i = 0; (var = variable_list[i]); i++)
252
	    {
252
	    {
253
#if defined (ARRAY_VARS)
253
#if defined (ARRAY_VARS)
254
	      if (arrays_only && array_p (var) == 0)
254
	      if (arrays_only && array_p (var) == 0)
(-)bash-2.05b.orig/builtins/set.def (-3 / +4 lines)
Lines 512-518 parse_shellopts (value) Link Here
512
  int vptr;
512
  int vptr;
513
513
514
  vptr = 0;
514
  vptr = 0;
515
  while (vname = extract_colon_unit (value, &vptr))
515
  while ((vname = extract_colon_unit (value, &vptr)))
516
    {
516
    {
517
      set_minus_o_option (FLAG_ON, vname);
517
      set_minus_o_option (FLAG_ON, vname);
518
      free (vname);
518
      free (vname);
Lines 565-571 set_builtin (list) Link Here
565
     WORD_LIST *list;
565
     WORD_LIST *list;
566
{
566
{
567
  int on_or_off, flag_name, force_assignment, opts_changed;
567
  int on_or_off, flag_name, force_assignment, opts_changed;
568
  WORD_LIST *l;
569
  register char *arg;
568
  register char *arg;
570
  char s[3];
569
  char s[3];
571
570
Lines 621-627 set_builtin (list) Link Here
621
620
622
      if ((on_or_off = *arg) && (on_or_off == '-' || on_or_off == '+'))
621
      if ((on_or_off = *arg) && (on_or_off == '-' || on_or_off == '+'))
623
	{
622
	{
624
	  while (flag_name = *++arg)
623
	  while ((flag_name = *++arg))
625
	    {
624
	    {
626
	      if (flag_name == '?')
625
	      if (flag_name == '?')
627
		{
626
		{
Lines 739-744 unset_builtin (list) Link Here
739
      int tem;
738
      int tem;
740
#if defined (ARRAY_VARS)
739
#if defined (ARRAY_VARS)
741
      char *t;
740
      char *t;
741
742
      t = NULL;
742
#endif
743
#endif
743
744
744
      name = list->word->word;
745
      name = list->word->word;
(-)bash-2.05b.orig/builtins/type.def (-1 / +1 lines)
Lines 328-334 describe_command (command, dflags) Link Here
328
     whether the file is present in our hash table. */
328
     whether the file is present in our hash table. */
329
  if (all == 0 || (dflags & CDESC_FORCE_PATH))
329
  if (all == 0 || (dflags & CDESC_FORCE_PATH))
330
    {
330
    {
331
      if (full_path = phash_search (command))
331
      if ((full_path = phash_search (command)))
332
	{
332
	{
333
	  if (dflags & CDESC_TYPE)
333
	  if (dflags & CDESC_TYPE)
334
	    puts ("file");
334
	    puts ("file");
(-)bash-2.05b.orig/builtins/ulimit.def (+4 lines)
Lines 175-181 static int set_limit __P((int, RLIMTYPE, Link Here
175
static void printone __P((int, RLIMTYPE, int));
175
static void printone __P((int, RLIMTYPE, int));
176
static void print_all_limits __P((int));
176
static void print_all_limits __P((int));
177
177
178
#ifdef NOTYET
178
static int set_all_limits __P((int, RLIMTYPE));
179
static int set_all_limits __P((int, RLIMTYPE));
180
#endif
179
181
180
static int filesize __P((RLIMTYPE *));
182
static int filesize __P((RLIMTYPE *));
181
static int pipesize __P((RLIMTYPE *));
183
static int pipesize __P((RLIMTYPE *));
Lines 680-685 printone (limind, curlim, pdesc) Link Here
680
    print_rlimtype ((curlim / limits[limind].block_factor), 1);
682
    print_rlimtype ((curlim / limits[limind].block_factor), 1);
681
}
683
}
682
684
685
#ifdef NOTYET
683
/* Set all limits to NEWLIM.  NEWLIM currently must be RLIM_INFINITY, which
686
/* Set all limits to NEWLIM.  NEWLIM currently must be RLIM_INFINITY, which
684
   causes all limits to be set as high as possible depending on mode (like
687
   causes all limits to be set as high as possible depending on mode (like
685
   csh `unlimit').  Returns -1 if NEWLIM is invalid, 0 if all limits
688
   csh `unlimit').  Returns -1 if NEWLIM is invalid, 0 if all limits
Lines 719-723 set_all_limits (mode, newlim) Link Here
719
      }
722
      }
720
  return retval;
723
  return retval;
721
}
724
}
725
#endif
722
726
723
#endif /* !_MINIX */
727
#endif /* !_MINIX */
(-)bash-2.05b.orig/config-bot.h (-1 / +1 lines)
Lines 88-94 Link Here
88
#  undef HAVE_STRCOLL
88
#  undef HAVE_STRCOLL
89
#endif
89
#endif
90
90
91
#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H)
91
#if defined (HAVE_SYS_SOCKET_H) && defined (HAVE_GETPEERNAME) && defined (HAVE_NETINET_IN_H) && defined (NETWORK_REDIRECTIONS)
92
#  define HAVE_NETWORK
92
#  define HAVE_NETWORK
93
#endif
93
#endif
94
94
(-)bash-2.05b.orig/error.c (-1 / +1 lines)
Lines 128-134 programming_error (format, va_alist) Link Here
128
#endif
128
#endif
129
{
129
{
130
  va_list args;
130
  va_list args;
131
  char *h;
132
131
133
#if defined (JOB_CONTROL)
132
#if defined (JOB_CONTROL)
134
  give_terminal_to (shell_pgrp, 0);
133
  give_terminal_to (shell_pgrp, 0);
Lines 143-148 programming_error (format, va_alist) Link Here
143
#if defined (HISTORY)
142
#if defined (HISTORY)
144
  if (remember_on_history)
143
  if (remember_on_history)
145
    {
144
    {
145
      char *h;
146
      h = last_history_line ();
146
      h = last_history_line ();
147
      fprintf (stderr, "last command: %s\n", h ? h : "(null)");
147
      fprintf (stderr, "last command: %s\n", h ? h : "(null)");
148
    }
148
    }
(-)bash-2.05b.orig/eval.c (-1 / +3 lines)
Lines 71-76 reader_loop () Link Here
71
    {
71
    {
72
      int code;
72
      int code;
73
73
74
      /* XXX: non-atomic update of top_level, do we allow interrupts here? */
75
      /* XXX: doesn't restore top_level on function return */
74
      code = setjmp (top_level);
76
      code = setjmp (top_level);
75
77
76
#if defined (PROCESS_SUBSTITUTION)
78
#if defined (PROCESS_SUBSTITUTION)
Lines 133-139 reader_loop () Link Here
133
	      dispose_command (global_command);
135
	      dispose_command (global_command);
134
	      global_command = (COMMAND *)NULL;
136
	      global_command = (COMMAND *)NULL;
135
	    }
137
	    }
136
	  else if (current_command = global_command)
138
	  else if ((current_command = global_command))
137
	    {
139
	    {
138
	      global_command = (COMMAND *)NULL;
140
	      global_command = (COMMAND *)NULL;
139
	      current_command_number++;
141
	      current_command_number++;
(-)bash-2.05b.orig/execute_cmd.c (-2 / +3 lines)
Lines 2295-2302 execute_cond_node (cond) Link Here
2295
    }
2295
    }
2296
  else if (cond->type == COND_BINARY)
2296
  else if (cond->type == COND_BINARY)
2297
    {
2297
    {
2298
      patmatch = ((cond->op->word[1] == '=') && (cond->op->word[2] == '\0') &&
2298
      patmatch = (((cond->op->word[1] == '=') && (cond->op->word[2] == '\0') &&
2299
		  (cond->op->word[0] == '!' || cond->op->word[0] == '=') ||
2299
		   (cond->op->word[0] == '!' || cond->op->word[0] == '=')) ||
2300
		  (cond->op->word[0] == '=' && cond->op->word[1] == '\0'));
2300
		  (cond->op->word[0] == '=' && cond->op->word[1] == '\0'));
2301
2301
2302
      arg1 = cond_expand_word (cond->left->op, 0);
2302
      arg1 = cond_expand_word (cond->left->op, 0);
Lines 3030-3035 execute_subshell_builtin_or_function (wo Link Here
3030
    {
3030
    {
3031
      /* Give builtins a place to jump back to on failure,
3031
      /* Give builtins a place to jump back to on failure,
3032
	 so we don't go back up to main(). */
3032
	 so we don't go back up to main(). */
3033
      /* XXX: non-atomic update of top_level, do we allow interrupts here? */
3033
      result = setjmp (top_level);
3034
      result = setjmp (top_level);
3034
3035
3035
      if (result == EXITPROG)
3036
      if (result == EXITPROG)
(-)bash-2.05b.orig/expr.c (-5 / +2 lines)
Lines 391-401 expassign () Link Here
391
      if (lasttok != STR)
391
      if (lasttok != STR)
392
	evalerror ("attempted assignment to non-variable");
392
	evalerror ("attempted assignment to non-variable");
393
393
394
      if (special)
394
      op = assigntok;			/* a OP= b */
395
	{
395
      lvalue = value;
396
	  op = assigntok;		/* a OP= b */
397
	  lvalue = value;
398
	}
399
396
400
      lhs = savestring (tokstr);
397
      lhs = savestring (tokstr);
401
      readtok ();
398
      readtok ();
(-)bash-2.05b.orig/findcmd.c (-1 / +2 lines)
Lines 205-211 _find_user_command_internal (name, flags Link Here
205
205
206
  /* Search for the value of PATH in both the temporary environments and
206
  /* Search for the value of PATH in both the temporary environments and
207
     in the regular list of variables. */
207
     in the regular list of variables. */
208
  if (var = find_variable_internal ("PATH", 1))	/* XXX could be array? */
208
  if ((var = find_variable_internal ("PATH", 1))) /* XXX could be array? */
209
    path_list = value_cell (var);
209
    path_list = value_cell (var);
210
  else
210
  else
211
    path_list = (char *)NULL;
211
    path_list = (char *)NULL;
Lines 362-367 user_command_matches (name, flags, state Link Here
362
	  match_list[0] = find_absolute_program (name, flags);
362
	  match_list[0] = find_absolute_program (name, flags);
363
	  match_list[1] = (char *)NULL;
363
	  match_list[1] = (char *)NULL;
364
	  path_list = (char *)NULL;
364
	  path_list = (char *)NULL;
365
	  name_len = 0; /* never used */
365
	}
366
	}
366
      else
367
      else
367
	{
368
	{
(-)bash-2.05b.orig/general.c (-1 / +1 lines)
Lines 250-256 assignment (string) Link Here
250
  if (legal_variable_starter (c) == 0)
250
  if (legal_variable_starter (c) == 0)
251
    return (0);
251
    return (0);
252
252
253
  while (c = string[indx])
253
  while ((c = string[indx]))
254
    {
254
    {
255
      /* The following is safe.  Note that '=' at the start of a word
255
      /* The following is safe.  Note that '=' at the start of a word
256
	 is not an assignment statement. */
256
	 is not an assignment statement. */
(-)bash-2.05b.orig/hashlib.c (+1 lines)
Lines 81-86 copy_bucket_array (ba, cpdata) Link Here
81
  if (ba == 0)
81
  if (ba == 0)
82
    return ((BUCKET_CONTENTS *)0);
82
    return ((BUCKET_CONTENTS *)0);
83
83
84
  new_bucket = NULL;
84
  for (n = (BUCKET_CONTENTS *)0, e = ba; e; e = e->next)
85
  for (n = (BUCKET_CONTENTS *)0, e = ba; e; e = e->next)
85
    {
86
    {
86
      if (n == 0)
87
      if (n == 0)
(-)bash-2.05b.orig/jobs.c (-1 / +1 lines)
Lines 707-713 nohup_job (job_index) Link Here
707
  if (job_slots == 0)
707
  if (job_slots == 0)
708
    return;
708
    return;
709
709
710
  if (temp = jobs[job_index])
710
  if ((temp = jobs[job_index]))
711
    temp->flags |= J_NOHUP;
711
    temp->flags |= J_NOHUP;
712
}
712
}
713
713
(-)bash-2.05b.orig/lib/glob/glob.c (+1 lines)
Lines 365-370 glob_vector (pat, dir, flags) Link Here
365
365
366
  lastlink = 0;
366
  lastlink = 0;
367
  count = lose = skip = 0;
367
  count = lose = skip = 0;
368
  name_vector = NULL;
368
369
369
  /* If PAT is empty, skip the loop, but return one (empty) filename. */
370
  /* If PAT is empty, skip the loop, but return one (empty) filename. */
370
  if (pat == 0 || *pat == '\0')
371
  if (pat == 0 || *pat == '\0')
(-)bash-2.05b.orig/lib/glob/smatch.c (-1 lines)
Lines 245-251 rangecmp_wc (c1, c2) Link Here
245
{
245
{
246
  static wchar_t s1[2] = { L' ', L'\0' };
246
  static wchar_t s1[2] = { L' ', L'\0' };
247
  static wchar_t s2[2] = { L' ', L'\0' };
247
  static wchar_t s2[2] = { L' ', L'\0' };
248
  int ret;
249
248
250
  if (c1 == c2)
249
  if (c1 == c2)
251
    return 0;
250
    return 0;
(-)bash-2.05b.orig/lib/glob/sm_loop.c (-3 / +3 lines)
Lines 288-294 BRACKMATCH (p, test, flags) Link Here
288
     circumflex (`^') in its role in a `nonmatching list'.  A bracket
288
     circumflex (`^') in its role in a `nonmatching list'.  A bracket
289
     expression starting with an unquoted circumflex character produces
289
     expression starting with an unquoted circumflex character produces
290
     unspecified results.  This implementation treats the two identically. */
290
     unspecified results.  This implementation treats the two identically. */
291
  if (not = (*p == L('!') || *p == L('^')))
291
  if ((not = (*p == L('!') || *p == L('^'))))
292
    ++p;
292
    ++p;
293
293
294
  c = *p++;
294
  c = *p++;
Lines 516-522 PATSCAN (string, end, delim) Link Here
516
  cchar = 0;
516
  cchar = 0;
517
  bfirst = NULL;
517
  bfirst = NULL;
518
518
519
  for (s = string; c = *s; s++)
519
  for (s = string; (c = *s); s++)
520
    {
520
    {
521
      if (s >= end)
521
      if (s >= end)
522
	return (s);
522
	return (s);
Lines 698-704 fprintf(stderr, "extmatch: p = %s; pe = Link Here
698
	    {
698
	    {
699
	      pnext = PATSCAN (psub, pe, L('|'));
699
	      pnext = PATSCAN (psub, pe, L('|'));
700
	      /* If one of the patterns matches, just bail immediately. */
700
	      /* If one of the patterns matches, just bail immediately. */
701
	      if (m1 = (GMATCH (s, srest, psub, pnext - 1, flags) == 0))
701
	      if ((m1 = (GMATCH (s, srest, psub, pnext - 1, flags) == 0)))
702
		break;
702
		break;
703
	      if (pnext == prest)
703
	      if (pnext == prest)
704
		break;
704
		break;
(-)bash-2.05b.orig/lib/malloc/malloc.c (+6 lines)
Lines 595-605 morecore_done: Link Here
595
    unblock_signals (&set, &oset);
595
    unblock_signals (&set, &oset);
596
}
596
}
597
597
598
#ifdef INCLUDE_UNUSED
598
static void
599
static void
599
malloc_debug_dummy ()
600
malloc_debug_dummy ()
600
{
601
{
601
  write (1, "malloc_debug_dummy\n", 19);
602
  write (1, "malloc_debug_dummy\n", 19);
602
}
603
}
604
#endif
603
605
604
#define PREPOP_BIN	2
606
#define PREPOP_BIN	2
605
#define PREPOP_SIZE	32
607
#define PREPOP_SIZE	32
Lines 788-794 internal_free (mem, file, line, flags) Link Here
788
  register char *ap, *z;
790
  register char *ap, *z;
789
  register int nunits;
791
  register int nunits;
790
  register unsigned int nbytes;
792
  register unsigned int nbytes;
793
#if defined (MALLOC_TRACE) || defined (MALLOC_REGISTER)
791
  int ubytes;		/* caller-requested size */
794
  int ubytes;		/* caller-requested size */
795
#endif
792
  mguard_t mg;
796
  mguard_t mg;
793
797
794
  if ((ap = (char *)mem) == 0)
798
  if ((ap = (char *)mem) == 0)
Lines 901-906 free_return: Link Here
901
  if (_malloc_nwatch > 0)
905
  if (_malloc_nwatch > 0)
902
    _malloc_ckwatch (mem, file, line, W_FREE, ubytes);
906
    _malloc_ckwatch (mem, file, line, W_FREE, ubytes);
903
#endif
907
#endif
908
909
  return;
904
}
910
}
905
911
906
static PTR_T
912
static PTR_T
(-)bash-2.05b.orig/lib/malloc/watch.c (-1 / +3 lines)
Lines 83-89 PTR_T Link Here
83
malloc_watch (addr)
83
malloc_watch (addr)
84
     PTR_T addr;
84
     PTR_T addr;
85
{
85
{
86
#ifdef MALLOC_WATCH
86
  register int i;
87
  register int i;
88
#endif /* MALLOC_WATCH */
87
  PTR_T ret;
89
  PTR_T ret;
88
90
89
  if (addr == 0)
91
  if (addr == 0)
Lines 107-113 malloc_watch (addr) Link Here
107
	}
109
	}
108
      _malloc_watch_list[_malloc_nwatch++] = addr;
110
      _malloc_watch_list[_malloc_nwatch++] = addr;
109
    }
111
    }
110
#endif
112
#endif /* MALLOC_WATCH */
111
113
112
  return ret;  
114
  return ret;  
113
}
115
}
(-)bash-2.05b.orig/lib/sh/makepath.c (-1 / +1 lines)
Lines 110-116 sh_makepath (path, dir, flags) Link Here
110
  if (s[-1] != '/')
110
  if (s[-1] != '/')
111
    *r++ = '/';      
111
    *r++ = '/';      
112
  s = xdir;
112
  s = xdir;
113
  while (*r++ = *s++)
113
  while ((*r++ = *s++))
114
    ;
114
    ;
115
  if (xpath != path)
115
  if (xpath != path)
116
    free (xpath);
116
    free (xpath);
(-)bash-2.05b.orig/lib/sh/netopen.c (-2 / +8 lines)
Lines 31-37 Link Here
31
#  include <unistd.h>
31
#  include <unistd.h>
32
#endif
32
#endif
33
33
34
#include <stdio.h> 
34
#include <stdio.h>
35
#include <unistd.h>
35
#include <sys/types.h>
36
#include <sys/types.h>
36
37
37
#if defined (HAVE_SYS_SOCKET_H)
38
#if defined (HAVE_SYS_SOCKET_H)
Lines 55-60 Link Here
55
56
56
#include <shell.h>
57
#include <shell.h>
57
#include <xmalloc.h>
58
#include <xmalloc.h>
59
#include "general.h"
60
#include "error.h"
58
61
59
#ifndef errno
62
#ifndef errno
60
extern int errno;
63
extern int errno;
Lines 201-207 _netopen6 (host, serv, typ) Link Here
201
     char *host, *serv;
204
     char *host, *serv;
202
     int typ;
205
     int typ;
203
{
206
{
204
  int s, e;
207
  int s = -1;
205
  struct addrinfo hints, *res, *res0;
208
  struct addrinfo hints, *res, *res0;
206
  int gerr;
209
  int gerr;
207
210
Lines 237-242 _netopen6 (host, serv, typ) Link Here
237
	}
240
	}
238
      if (connect (s, res->ai_addr, res->ai_addrlen) < 0)
241
      if (connect (s, res->ai_addr, res->ai_addrlen) < 0)
239
	{
242
	{
243
	  int e;
240
	  if (res->ai_next)
244
	  if (res->ai_next)
241
	    {
245
	    {
242
	      close (s);
246
	      close (s);
Lines 327-332 udpopen (host, serv) Link Here
327
331
328
#else /* !HAVE_NETWORK */
332
#else /* !HAVE_NETWORK */
329
333
334
#include "error.h"
335
330
int
336
int
331
netopen (path)
337
netopen (path)
332
     char *path;
338
     char *path;
(-)bash-2.05b.orig/lib/sh/pathcanon.c (-1 / +2 lines)
Lines 107-113 sh_canonpath (path, flags) Link Here
107
107
108
  /* POSIX.2 says to leave a leading `//' alone.  On cygwin, we skip over any
108
  /* POSIX.2 says to leave a leading `//' alone.  On cygwin, we skip over any
109
     leading `x:' (dos drive name). */
109
     leading `x:' (dos drive name). */
110
  if (rooted = ROOTEDPATH(path))
110
  double_slash_path = 0;
111
  if ((rooted = ROOTEDPATH(path)))
111
    {
112
    {
112
      stub_char = DIRSEP;
113
      stub_char = DIRSEP;
113
#if defined (__CYGWIN__)
114
#if defined (__CYGWIN__)
(-)bash-2.05b.orig/lib/sh/shquote.c (+1 lines)
Lines 26-31 Link Here
26
#endif
26
#endif
27
27
28
#include <stdio.h>
28
#include <stdio.h>
29
#include <string.h>
29
30
30
#include "syntax.h"
31
#include "syntax.h"
31
#include <xmalloc.h>
32
#include <xmalloc.h>
(-)bash-2.05b.orig/lib/sh/spell.c (-1 / +1 lines)
Lines 95-101 spname(oldname, newname) Link Here
95
      /*
95
      /*
96
       *  Add to end of newname
96
       *  Add to end of newname
97
       */
97
       */
98
      for (p = best; *np = *p++; np++)
98
      for (p = best; (*np = *p++); np++)
99
	;
99
	;
100
    }
100
    }
101
}
101
}
(-)bash-2.05b.orig/lib/sh/stringlist.c (+2 lines)
Lines 141-146 strlist_copy (sl) Link Here
141
  return new;
141
  return new;
142
}
142
}
143
143
144
#ifdef INCLUDE_UNUSED
144
/* Return a new STRINGLIST with everything from M1 and M2. */
145
/* Return a new STRINGLIST with everything from M1 and M2. */
145
146
146
STRINGLIST *
147
STRINGLIST *
Lines 162-167 strlist_merge (m1, m2) Link Here
162
  sl->list[n] = (char *)NULL;
163
  sl->list[n] = (char *)NULL;
163
  return (sl);
164
  return (sl);
164
}
165
}
166
#endif
165
167
166
/* Make STRINGLIST M1 contain everything in M1 and M2. */
168
/* Make STRINGLIST M1 contain everything in M1 and M2. */
167
STRINGLIST *
169
STRINGLIST *
(-)bash-2.05b.orig/lib/sh/strtrans.c (-2 / +2 lines)
Lines 145-151 ansic_quote (str, flags, rlen) Link Here
145
     int flags, *rlen;
145
     int flags, *rlen;
146
{
146
{
147
  char *r, *ret, *s;
147
  char *r, *ret, *s;
148
  int l, rsize, t;
148
  int l, rsize;
149
  unsigned char c;
149
  unsigned char c;
150
150
151
  if (str == 0 || *str == 0)
151
  if (str == 0 || *str == 0)
Lines 216-222 ansic_shouldquote (string) Link Here
216
  if (string == 0)
216
  if (string == 0)
217
    return 0;
217
    return 0;
218
218
219
  for (s = string; c = *s; s++)
219
  for (s = string; (c = *s); s++)
220
    if (ISPRINT (c) == 0)
220
    if (ISPRINT (c) == 0)
221
      return 1;
221
      return 1;
222
222
(-)bash-2.05b.orig/lib/sh/zcatfd.c (-1 / +1 lines)
Lines 40-46 extern int zwrite __P((int, char *, ssiz Link Here
40
int
40
int
41
zcatfd (fd, ofd, fn)
41
zcatfd (fd, ofd, fn)
42
     int fd, ofd;
42
     int fd, ofd;
43
     char *fn;
43
     const char *fn;
44
{
44
{
45
  ssize_t nr;
45
  ssize_t nr;
46
  int rval;
46
  int rval;
(-)bash-2.05b.orig/lib/tilde/tilde.c (-1 / +1 lines)
Lines 190-196 tilde_expand (string) Link Here
190
  int result_size, result_index;
190
  int result_size, result_index;
191
191
192
  result_index = result_size = 0;
192
  result_index = result_size = 0;
193
  if (result = strchr (string, '~'))
193
  if ((result = strchr (string, '~')))
194
    result = (char *)xmalloc (result_size = (strlen (string) + 16));
194
    result = (char *)xmalloc (result_size = (strlen (string) + 16));
195
  else
195
  else
196
    result = (char *)xmalloc (result_size = (strlen (string) + 1));
196
    result = (char *)xmalloc (result_size = (strlen (string) + 1));
(-)bash-2.05b.orig/mailcheck.c (-2 / +2 lines)
Lines 326-332 remember_mail_dates () Link Here
326
      return;
326
      return;
327
    }
327
    }
328
328
329
  while (mailfile = extract_colon_unit (mailpaths, &i))
329
  while ((mailfile = extract_colon_unit (mailpaths, &i)))
330
    {
330
    {
331
      mp = parse_mailpath_spec (mailfile);
331
      mp = parse_mailpath_spec (mailfile);
332
      if (mp && *mp)
332
      if (mp && *mp)
Lines 400-406 check_mail () Link Here
400
#undef atime
400
#undef atime
401
#undef mtime
401
#undef mtime
402
402
403
	  if (temp = expand_string_to_string (message, Q_DOUBLE_QUOTES))
403
	  if ((temp = expand_string_to_string (message, Q_DOUBLE_QUOTES)))
404
	    {
404
	    {
405
	      puts (temp);
405
	      puts (temp);
406
	      free (temp);
406
	      free (temp);
(-)bash-2.05b.orig/make_cmd.c (-1 / +1 lines)
Lines 580-586 make_here_document (temp) Link Here
580
     be read verbatim from the input.  If it was not quoted, we
580
     be read verbatim from the input.  If it was not quoted, we
581
     need to perform backslash-quoted newline removal. */
581
     need to perform backslash-quoted newline removal. */
582
  delim_unquoted = (temp->redirectee.filename->flags & W_QUOTED) == 0;
582
  delim_unquoted = (temp->redirectee.filename->flags & W_QUOTED) == 0;
583
  while (full_line = read_secondary_line (delim_unquoted))
583
  while ((full_line = read_secondary_line (delim_unquoted)))
584
    {
584
    {
585
      register char *line;
585
      register char *line;
586
      int len;
586
      int len;
(-)bash-2.05b.orig/parse.y (-15 / +20 lines)
Lines 162-168 static char *read_a_line __P((int)); Link Here
162
static int reserved_word_acceptable __P((int));
162
static int reserved_word_acceptable __P((int));
163
static int yylex __P((void));
163
static int yylex __P((void));
164
static int alias_expand_token __P((char *));
164
static int alias_expand_token __P((char *));
165
#if defined (COMMAND_TIMING)
165
static int time_command_acceptable __P((void));
166
static int time_command_acceptable __P((void));
167
#endif
166
static int special_case_tokens __P((char *));
168
static int special_case_tokens __P((char *));
167
static int read_token __P((int));
169
static int read_token __P((int));
168
static char *parse_matched_pair __P((int, int, int, int *, int));
170
static char *parse_matched_pair __P((int, int, int, int *, int));
Lines 187-193 static int token_is_assignment __P((char Link Here
187
static int token_is_ident __P((char *, int));
189
static int token_is_ident __P((char *, int));
188
#endif
190
#endif
189
static int read_token_word __P((int));
191
static int read_token_word __P((int));
192
#ifdef INCLUDE_UNUSED
190
static void discard_parser_constructs __P((int));
193
static void discard_parser_constructs __P((int));
194
#endif
191
195
192
static char *error_token_from_token __P((int));
196
static char *error_token_from_token __P((int));
193
static char *error_token_from_text __P((void));
197
static char *error_token_from_text __P((void));
Lines 2187-2196 alias_expand_token (tokstr) Link Here
2187
}
2191
}
2188
#endif /* ALIAS */
2192
#endif /* ALIAS */
2189
2193
2194
#if defined (COMMAND_TIMING)
2190
static int
2195
static int
2191
time_command_acceptable ()
2196
time_command_acceptable ()
2192
{
2197
{
2193
#if defined (COMMAND_TIMING)
2194
  switch (last_read_token)
2198
  switch (last_read_token)
2195
    {
2199
    {
2196
    case 0:
2200
    case 0:
Lines 2208-2217 time_command_acceptable () Link Here
2208
    default:
2212
    default:
2209
      return 0;
2213
      return 0;
2210
    }
2214
    }
2211
#else
2212
  return 0;
2213
#endif /* COMMAND_TIMING */
2214
}
2215
}
2216
#endif /* COMMAND_TIMING */
2215
2217
2216
/* Handle special cases of token recognition:
2218
/* Handle special cases of token recognition:
2217
	IN is recognized if the last token was WORD and the token
2219
	IN is recognized if the last token was WORD and the token
Lines 2721-2726 parse_matched_pair (qc, open, close, len Link Here
2721
	{
2723
	{
2722
	  if (open == ch)	/* undo previous increment */
2724
	  if (open == ch)	/* undo previous increment */
2723
	    count--;
2725
	    count--;
2726
	  nestret = '\0'; /* never used */
2724
	  if (ch == '(')		/* ) */
2727
	  if (ch == '(')		/* ) */
2725
	    nestret = parse_matched_pair (0, '(', ')', &nestlen, 0);
2728
	    nestret = parse_matched_pair (0, '(', ')', &nestlen, 0);
2726
	  else if (ch == '{')		/* } */
2729
	  else if (ch == '{')		/* } */
Lines 2864-2876 parse_arith_cmd (ep) Link Here
2864
static void
2867
static void
2865
cond_error ()
2868
cond_error ()
2866
{
2869
{
2867
  char *etext;
2868
2869
  if (EOF_Reached && cond_token != COND_ERROR)		/* [[ */
2870
  if (EOF_Reached && cond_token != COND_ERROR)		/* [[ */
2870
    parser_error (cond_lineno, "unexpected EOF while looking for `]]'");
2871
    parser_error (cond_lineno, "unexpected EOF while looking for `]]'");
2871
  else if (cond_token != COND_ERROR)
2872
  else if (cond_token != COND_ERROR)
2872
    {
2873
    {
2873
      if (etext = error_token_from_token (cond_token))
2874
      char *etext = error_token_from_token (cond_token);
2875
2876
      if (etext)
2874
	{
2877
	{
2875
	  parser_error (cond_lineno, "syntax error in conditional expression: unexpected token `%s'", etext);
2878
	  parser_error (cond_lineno, "syntax error in conditional expression: unexpected token `%s'", etext);
2876
	  free (etext);
2879
	  free (etext);
Lines 2952-2958 cond_term () Link Here
2952
	{
2955
	{
2953
	  if (term)
2956
	  if (term)
2954
	    dispose_cond_node (term);		/* ( */
2957
	    dispose_cond_node (term);		/* ( */
2955
	  if (etext = error_token_from_token (cond_token))
2958
	  if ((etext = error_token_from_token (cond_token)))
2956
	    {
2959
	    {
2957
	      parser_error (lineno, "unexpected token `%s', expected `)'", etext);
2960
	      parser_error (lineno, "unexpected token `%s', expected `)'", etext);
2958
	      free (etext);
2961
	      free (etext);
Lines 2984-2990 cond_term () Link Here
2984
      else
2987
      else
2985
	{
2988
	{
2986
	  dispose_word (op);
2989
	  dispose_word (op);
2987
	  if (etext = error_token_from_token (tok))
2990
	  if ((etext = error_token_from_token (tok)))
2988
	    {
2991
	    {
2989
	      parser_error (line_number, "unexpected argument `%s' to conditional unary operator", etext);
2992
	      parser_error (line_number, "unexpected argument `%s' to conditional unary operator", etext);
2990
	      free (etext);
2993
	      free (etext);
Lines 3021-3027 cond_term () Link Here
3021
	}
3024
	}
3022
      else
3025
      else
3023
	{
3026
	{
3024
	  if (etext = error_token_from_token (tok))
3027
	  if ((etext = error_token_from_token (tok)))
3025
	    {
3028
	    {
3026
	      parser_error (line_number, "unexpected token `%s', conditional binary operator expected", etext);
3029
	      parser_error (line_number, "unexpected token `%s', conditional binary operator expected", etext);
3027
	      free (etext);
3030
	      free (etext);
Lines 3041-3047 cond_term () Link Here
3041
	}
3044
	}
3042
      else
3045
      else
3043
	{
3046
	{
3044
	  if (etext = error_token_from_token (tok))
3047
	  if ((etext = error_token_from_token (tok)))
3045
	    {
3048
	    {
3046
	      parser_error (line_number, "unexpected argument `%s' to conditional binary operator", etext);
3049
	      parser_error (line_number, "unexpected argument `%s' to conditional binary operator", etext);
3047
	      free (etext);
3050
	      free (etext);
Lines 3059-3065 cond_term () Link Here
3059
    {
3062
    {
3060
      if (tok < 256)
3063
      if (tok < 256)
3061
	parser_error (line_number, "unexpected token `%c' in conditional command", tok);
3064
	parser_error (line_number, "unexpected token `%c' in conditional command", tok);
3062
      else if (etext = error_token_from_token (tok))
3065
      else if ((etext = error_token_from_token (tok)))
3063
	{
3066
	{
3064
	  parser_error (line_number, "unexpected token `%s' in conditional command", etext);
3067
	  parser_error (line_number, "unexpected token `%s' in conditional command", etext);
3065
	  free (etext);
3068
	  free (etext);
Lines 3774-3780 decode_prompt_string (string) Link Here
3774
  result[result_index = 0] = 0;
3777
  result[result_index = 0] = 0;
3775
  temp = (char *)NULL;
3778
  temp = (char *)NULL;
3776
3779
3777
  while (c = *string++)
3780
  while ((c = *string++))
3778
    {
3781
    {
3779
      if (posixly_correct && c == '!')
3782
      if (posixly_correct && c == '!')
3780
	{
3783
	{
Lines 4124-4133 error_token_from_token (token) Link Here
4124
{
4127
{
4125
  char *t;
4128
  char *t;
4126
4129
4127
  if (t = find_token_in_alist (token, word_token_alist, 0))
4130
  if ((t = find_token_in_alist (token, word_token_alist, 0)))
4128
    return t;
4131
    return t;
4129
4132
4130
  if (t = find_token_in_alist (token, other_token_alist, 0))
4133
  if ((t = find_token_in_alist (token, other_token_alist, 0)))
4131
    return t;
4134
    return t;
4132
4135
4133
  t = (char *)NULL;
4136
  t = (char *)NULL;
Lines 4279-4284 report_syntax_error (message) Link Here
4279
  last_command_exit_value = EX_USAGE;
4282
  last_command_exit_value = EX_USAGE;
4280
}
4283
}
4281
4284
4285
#ifdef INCLUDE_UNUSED
4282
/* ??? Needed function. ??? We have to be able to discard the constructs
4286
/* ??? Needed function. ??? We have to be able to discard the constructs
4283
   created during parsing.  In the case of error, we want to return
4287
   created during parsing.  In the case of error, we want to return
4284
   allocated objects to the memory pool.  In the case of no error, we want
4288
   allocated objects to the memory pool.  In the case of no error, we want
Lines 4289-4294 discard_parser_constructs (error_p) Link Here
4289
     int error_p;
4293
     int error_p;
4290
{
4294
{
4291
}
4295
}
4296
#endif
4292
4297
4293
/************************************************
4298
/************************************************
4294
 *						*
4299
 *						*
(-)bash-2.05b.orig/pathexp.c (-2 / +2 lines)
Lines 67-73 unquoted_glob_pattern_p (string) Link Here
67
  open = 0;
67
  open = 0;
68
  send = string + strlen (string);
68
  send = string + strlen (string);
69
69
70
  while (c = *string++)
70
  while ((c = *string++))
71
    {
71
    {
72
      switch (c)
72
      switch (c)
73
	{
73
	{
Lines 419-425 setup_ignore_patterns (ivp) Link Here
419
419
420
  numitems = maxitems = ptr = 0;
420
  numitems = maxitems = ptr = 0;
421
421
422
  while (colon_bit = extract_colon_unit (this_ignoreval, &ptr))
422
  while ((colon_bit = extract_colon_unit (this_ignoreval, &ptr)))
423
    {
423
    {
424
      if (numitems + 1 >= maxitems)
424
      if (numitems + 1 >= maxitems)
425
	{
425
	{
(-)bash-2.05b.orig/pcomplete.c (+1 lines)
Lines 509-514 it_init_joblist (itp, jstate) Link Here
509
  char *s, *t;
509
  char *s, *t;
510
  JOB_STATE js;
510
  JOB_STATE js;
511
511
512
  js = -1;
512
  if (jstate == 0)
513
  if (jstate == 0)
513
    js = JRUNNING;
514
    js = JRUNNING;
514
  else if (jstate == 1)
515
  else if (jstate == 1)
(-)bash-2.05b.orig/print_cmd.c (-1 / +1 lines)
Lines 143-149 make_command_string_internal (command) Link Here
143
     COMMAND *command;
143
     COMMAND *command;
144
{
144
{
145
  if (command == 0)
145
  if (command == 0)
146
    cprintf ("");
146
    cprintf ("%s", "");
147
  else
147
  else
148
    {
148
    {
149
      if (skip_this_indent)
149
      if (skip_this_indent)
(-)bash-2.05b.orig/redir.c (+6 lines)
Lines 116-121 redirection_error (temp, error) Link Here
116
#endif
116
#endif
117
  else if (expandable_redirection_filename (temp))
117
  else if (expandable_redirection_filename (temp))
118
    {
118
    {
119
      oflags = 0; /* never used */
119
      if (posixly_correct && interactive_shell == 0)
120
      if (posixly_correct && interactive_shell == 0)
120
	{
121
	{
121
	  oflags = temp->redirectee.filename->flags;
122
	  oflags = temp->redirectee.filename->flags;
Lines 656-661 do_redirection_internal (redirect, for_r Link Here
656
	    case r_move_output_word:
657
	    case r_move_output_word:
657
	      new_redirect = make_redirection (redirector, r_move_output, rd);
658
	      new_redirect = make_redirection (redirector, r_move_output, rd);
658
	      break;
659
	      break;
660
	    default:
661
		break;
659
	    }
662
	    }
660
	}
663
	}
661
      else if (ri == r_duplicating_output_word && redirector == 1)
664
      else if (ri == r_duplicating_output_word && redirector == 1)
Lines 710-715 do_redirection_internal (redirect, for_r Link Here
710
    case r_err_and_out:		/* command &>filename */
712
    case r_err_and_out:		/* command &>filename */
711
    case r_input_output:
713
    case r_input_output:
712
    case r_output_force:
714
    case r_output_force:
715
      oflags = 0; /* never used */
713
      if (posixly_correct && interactive_shell == 0)
716
      if (posixly_correct && interactive_shell == 0)
714
	{
717
	{
715
	  oflags = redirectee->flags;
718
	  oflags = redirectee->flags;
Lines 1027-1032 stdin_redirection (ri, redirector) Link Here
1027
    case r_output_force:
1030
    case r_output_force:
1028
    case r_duplicating_output_word:
1031
    case r_duplicating_output_word:
1029
      return (0);
1032
      return (0);
1033
    default:
1034
	break;
1030
    }
1035
    }
1031
  return (0);
1036
  return (0);
1032
}
1037
}
(-)bash-2.05b.orig/shell.c (-1 / +6 lines)
Lines 531-536 main (argc, argv, env) Link Here
531
  /* Give this shell a place to longjmp to before executing the
531
  /* Give this shell a place to longjmp to before executing the
532
     startup files.  This allows users to press C-c to abort the
532
     startup files.  This allows users to press C-c to abort the
533
     lengthy startup. */
533
     lengthy startup. */
534
  /* XXX: non-atomic update of top_level with nothing preventing its use */
534
  code = setjmp (top_level);
535
  code = setjmp (top_level);
535
  if (code)
536
  if (code)
536
    {
537
    {
Lines 762-768 parse_shell_options (argv, arg_start, ar Link Here
762
763
763
      i = 1;
764
      i = 1;
764
      on_or_off = arg_string[0];
765
      on_or_off = arg_string[0];
765
      while (arg_character = arg_string[i++])
766
      while ((arg_character = arg_string[i++]))
766
	{
767
	{
767
	  switch (arg_character)
768
	  switch (arg_character)
768
	    {
769
	    {
Lines 1135-1140 run_wordexp (words) Link Here
1135
  int code, nw, nb;
1136
  int code, nw, nb;
1136
  WORD_LIST *wl, *result;
1137
  WORD_LIST *wl, *result;
1137
1138
1139
  /* XXX: non-atomic update of top_level with nothing preventing its use */
1140
  /* XXX: doesn't restore top_level on function return (but will exit soon) */
1138
  code = setjmp (top_level);
1141
  code = setjmp (top_level);
1139
1142
1140
  if (code != NOT_JUMPED)
1143
  if (code != NOT_JUMPED)
Lines 1205-1210 run_one_command (command) Link Here
1205
{
1208
{
1206
  int code;
1209
  int code;
1207
1210
1211
  /* XXX: non-atomic update of top_level with nothing preventing its use */
1212
  /* XXX: doesn't restore top_level on function return (but will exit soon) */
1208
  code = setjmp (top_level);
1213
  code = setjmp (top_level);
1209
1214
1210
  if (code != NOT_JUMPED)
1215
  if (code != NOT_JUMPED)
(-)bash-2.05b.orig/sig.c (+2 lines)
Lines 445-450 sigint_sighandler (sig) Link Here
445
  if (interrupt_immediately)
445
  if (interrupt_immediately)
446
    {
446
    {
447
      interrupt_immediately = 0;
447
      interrupt_immediately = 0;
448
      /* XXX: may interrupt non-reentrant library functions and cause
449
       * re-entry with invalid (internal) state. */
448
      throw_to_top_level ();
450
      throw_to_top_level ();
449
    }
451
    }
450
452
(-)bash-2.05b.orig/subst.c (-20 / +27 lines)
Lines 164-171 WORD_LIST *subst_assign_varlist = (WORD_ Link Here
164
   without any leading variable assignments. */
164
   without any leading variable assignments. */
165
static WORD_LIST *garglist = (WORD_LIST *)NULL;
165
static WORD_LIST *garglist = (WORD_LIST *)NULL;
166
166
167
#ifdef INCLUDE_UNUSED
167
static char *quoted_substring __P((char *, int, int));
168
static char *quoted_substring __P((char *, int, int));
168
static int quoted_strlen __P((char *));
169
static int quoted_strlen __P((char *));
170
#endif
169
static char *quoted_strchr __P((char *, int, int));
171
static char *quoted_strchr __P((char *, int, int));
170
172
171
static char *expand_string_if_necessary __P((char *, int, EXPFUNC *));
173
static char *expand_string_if_necessary __P((char *, int, EXPFUNC *));
Lines 204-210 static int match_pattern_char __P((char Link Here
204
static int match_pattern __P((char *, char *, int, char **, char **));
206
static int match_pattern __P((char *, char *, int, char **, char **));
205
static int getpatspec __P((int, char *));
207
static int getpatspec __P((int, char *));
206
static char *getpattern __P((char *, int, int));
208
static char *getpattern __P((char *, int, int));
209
#ifdef INCLUDE_UNUSED
207
static char *variable_remove_pattern __P((char *, char *, int, int));
210
static char *variable_remove_pattern __P((char *, char *, int, int));
211
#endif
208
static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int));
212
static char *list_remove_pattern __P((WORD_LIST *, char *, int, int, int));
209
static char *parameter_list_remove_pattern __P((int, char *, int, int));
213
static char *parameter_list_remove_pattern __P((int, char *, int, int));
210
#ifdef ARRAY_VARS
214
#ifdef ARRAY_VARS
Lines 366-372 unquoted_member (character, string) Link Here
366
370
367
  slen = strlen (string);
371
  slen = strlen (string);
368
  sindex = 0;
372
  sindex = 0;
369
  while (c = string[sindex])
373
  while ((c = string[sindex]))
370
    {
374
    {
371
      if (c == character)
375
      if (c == character)
372
	return (1);
376
	return (1);
Lines 409-415 unquoted_substring (substr, string) Link Here
409
413
410
  slen = strlen (string);
414
  slen = strlen (string);
411
  sublen = strlen (substr);
415
  sublen = strlen (substr);
412
  for (sindex = 0; c = string[sindex]; )
416
  for (sindex = 0; (c = string[sindex]); )
413
    {
417
    {
414
      if (STREQN (string + sindex, substr, sublen))
418
      if (STREQN (string + sindex, substr, sublen))
415
	return (1);
419
	return (1);
Lines 516-522 string_extract (string, sindex, charlist Link Here
516
520
517
  slen = strlen (string + *sindex) + *sindex;
521
  slen = strlen (string + *sindex) + *sindex;
518
  i = *sindex;
522
  i = *sindex;
519
  while (c = string[i])
523
  while ((c = string[i]))
520
    {
524
    {
521
      if (c == '\\')
525
      if (c == '\\')
522
	{
526
	{
Lines 575-581 string_extract_double_quoted (string, si Link Here
575
579
576
  j = 0;
580
  j = 0;
577
  i = *sindex;
581
  i = *sindex;
578
  while (c = string[i])
582
  while ((c = string[i]))
579
    {
583
    {
580
      /* Process a character that was quoted by a backslash. */
584
      /* Process a character that was quoted by a backslash. */
581
      if (pass_next)
585
      if (pass_next)
Lines 704-710 skip_double_quoted (string, slen, sind) Link Here
704
708
705
  pass_next = backquote = 0;
709
  pass_next = backquote = 0;
706
  i = sind;
710
  i = sind;
707
  while (c = string[i])
711
  while ((c = string[i]))
708
    {
712
    {
709
      if (pass_next)
713
      if (pass_next)
710
	{
714
	{
Lines 822-828 string_extract_verbatim (string, sindex, Link Here
822
      return temp;
826
      return temp;
823
    }
827
    }
824
828
825
  for (i = *sindex; c = string[i]; i++)
829
  for (i = *sindex; (c = string[i]); i++)
826
    {
830
    {
827
      if (c == CTLESC)
831
      if (c == CTLESC)
828
	{
832
	{
Lines 1034-1040 extract_dollar_brace_string (string, sin Link Here
1034
  slen = strlen (string + *sindex) + *sindex;
1038
  slen = strlen (string + *sindex) + *sindex;
1035
1039
1036
  i = *sindex;
1040
  i = *sindex;
1037
  while (c = string[i])
1041
  while ((c = string[i]))
1038
    {
1042
    {
1039
      if (pass_character)
1043
      if (pass_character)
1040
	{
1044
	{
Lines 1295-1301 skip_to_delim (string, start, delims) Link Here
1295
  no_longjmp_on_fatal_error = 1;
1299
  no_longjmp_on_fatal_error = 1;
1296
  i = start;
1300
  i = start;
1297
  pass_next = backq = 0;
1301
  pass_next = backq = 0;
1298
  while (c = string[i])
1302
  while ((c = string[i]))
1299
    {
1303
    {
1300
      if (pass_next)
1304
      if (pass_next)
1301
	{
1305
	{
Lines 1973-1979 do_assignment_internal (string, expand) Link Here
1973
#define ASSIGN_RETURN(r)	do { FREE (value); free (name); return (r); } while (0)
1977
#define ASSIGN_RETURN(r)	do { FREE (value); free (name); return (r); } while (0)
1974
1978
1975
#if defined (ARRAY_VARS)
1979
#if defined (ARRAY_VARS)
1976
  if (t = xstrchr (name, '['))	/*]*/
1980
  if ((t = xstrchr (name, '[')))	/*]*/
1977
    {
1981
    {
1978
      if (assign_list)
1982
      if (assign_list)
1979
	{
1983
	{
Lines 2891-2897 match_pattern_char (pat, string) Link Here
2891
  if (*string == 0)
2895
  if (*string == 0)
2892
    return (0);
2896
    return (0);
2893
2897
2894
  switch (c = *pat++)
2898
  switch ((c = *pat++))
2895
    {
2899
    {
2896
    default:
2900
    default:
2897
      return (*string == c);
2901
      return (*string == c);
Lines 3011-3017 getpattern (value, quoted, expandpat) Link Here
3011
{
3015
{
3012
  char *pat, *tword;
3016
  char *pat, *tword;
3013
  WORD_LIST *l;
3017
  WORD_LIST *l;
3014
  int i;
3015
3018
3016
  tword = xstrchr (value, '~') ? bash_tilde_expand (value, 0) : savestring (value);
3019
  tword = xstrchr (value, '~') ? bash_tilde_expand (value, 0) : savestring (value);
3017
3020
Lines 3023-3029 getpattern (value, quoted, expandpat) Link Here
3023
#if 0
3026
#if 0
3024
  if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword)
3027
  if (expandpat && (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && *tword)
3025
    {
3028
    {
3026
      i = 0;
3029
      int i = 0;
3027
      pat = string_extract_double_quoted (tword, &i, 1);
3030
      pat = string_extract_double_quoted (tword, &i, 1);
3028
      free (tword);
3031
      free (tword);
3029
      tword = pat;
3032
      tword = pat;
Lines 3626-3631 read_comsub (fd, quoted) Link Here
3626
3629
3627
  istring = (char *)NULL;
3630
  istring = (char *)NULL;
3628
  istring_index = istring_size = bufn = 0;
3631
  istring_index = istring_size = bufn = 0;
3632
  bufp = buf; /* redundant */
3629
3633
3630
#ifdef __CYGWIN__
3634
#ifdef __CYGWIN__
3631
  setmode (fd, O_TEXT);		/* we don't want CR/LF, we want Unix-style */
3635
  setmode (fd, O_TEXT);		/* we don't want CR/LF, we want Unix-style */
Lines 4007-4013 parameter_brace_expand_word (name, var_i Link Here
4007
	temp = quote_escapes (temp);
4011
	temp = quote_escapes (temp);
4008
    }
4012
    }
4009
#endif
4013
#endif
4010
  else if (var = find_variable (name))
4014
  else if ((var = find_variable (name)))
4011
    {
4015
    {
4012
      if (var_isset (var) && invisible_p (var) == 0)
4016
      if (var_isset (var) && invisible_p (var) == 0)
4013
	{
4017
	{
Lines 4185-4190 parameter_brace_expand_length (name) Link Here
4185
  SHELL_VAR *var;
4189
  SHELL_VAR *var;
4186
#endif
4190
#endif
4187
4191
4192
  t = NULL;
4188
  if (name[1] == '\0')			/* ${#} */
4193
  if (name[1] == '\0')			/* ${#} */
4189
    number = number_of_args ();
4194
    number = number_of_args ();
4190
  else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0')	/* ${#@}, ${#*} */
4195
  else if ((name[1] == '@' || name[1] == '*') && name[2] == '\0')	/* ${#@}, ${#*} */
Lines 4489-4494 parameter_brace_substring (varname, valu Link Here
4489
  if (r <= 0)
4494
  if (r <= 0)
4490
    return ((r == 0) ? &expand_param_error : (char *)NULL);
4495
    return ((r == 0) ? &expand_param_error : (char *)NULL);
4491
4496
4497
  temp = NULL;
4492
  switch (vtype)
4498
  switch (vtype)
4493
    {
4499
    {
4494
    case VT_VARIABLE:
4500
    case VT_VARIABLE:
Lines 4576-4582 pat_subst (string, pat, rep, mflags) Link Here
4576
  ret = (char *)xmalloc (rsize = 64);
4582
  ret = (char *)xmalloc (rsize = 64);
4577
  ret[0] = '\0';
4583
  ret[0] = '\0';
4578
4584
4579
  for (replen = STRLEN (rep), rptr = 0, str = string;;)
4585
  for (replen = STRLEN (rep), rptr = 0, (str = string);;)
4580
    {
4586
    {
4581
      if (match_pattern (str, pat, mtype, &s, &e) == 0)
4587
      if (match_pattern (str, pat, mtype, &s, &e) == 0)
4582
	break;
4588
	break;
Lines 4624-4630 pos_params_pat_subst (string, pat, rep, Link Here
4624
{
4630
{
4625
  WORD_LIST *save, *params;
4631
  WORD_LIST *save, *params;
4626
  WORD_DESC *w;
4632
  WORD_DESC *w;
4627
  char *ret, *tt;
4633
  char *ret;
4628
4634
4629
  save = params = list_rest_of_args ();
4635
  save = params = list_rest_of_args ();
4630
  if (save == 0)
4636
  if (save == 0)
Lines 4681-4687 parameter_brace_patsub (varname, value, Link Here
4681
  if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
4687
  if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES))
4682
    mflags |= MATCH_QUOTED;
4688
    mflags |= MATCH_QUOTED;
4683
4689
4684
  if (rep = quoted_strchr (lpatsub, '/', ST_BACKSL))
4690
  if ((rep = quoted_strchr (lpatsub, '/', ST_BACKSL)))
4685
    *rep++ = '\0';
4691
    *rep++ = '\0';
4686
  else
4692
  else
4687
    rep = (char *)NULL;
4693
    rep = (char *)NULL;
Lines 4727-4732 parameter_brace_patsub (varname, value, Link Here
4727
     other cases if QUOTED == 0, since the posparams and arrays
4733
     other cases if QUOTED == 0, since the posparams and arrays
4728
     indexed by * or @ do special things when QUOTED != 0. */
4734
     indexed by * or @ do special things when QUOTED != 0. */
4729
4735
4736
  temp = 0;
4730
  switch (vtype)
4737
  switch (vtype)
4731
    {
4738
    {
4732
    case VT_VARIABLE:
4739
    case VT_VARIABLE:
Lines 4828-4834 parameter_brace_expand (string, indexp, Link Here
4828
4835
4829
  /* Find out what character ended the variable name.  Then
4836
  /* Find out what character ended the variable name.  Then
4830
     do the appropriate thing. */
4837
     do the appropriate thing. */
4831
  if (c = string[sindex])
4838
  if ((c = string[sindex]))
4832
    sindex++;
4839
    sindex++;
4833
4840
4834
  /* If c is followed by one of the valid parameter expansion
4841
  /* If c is followed by one of the valid parameter expansion
Lines 4838-4844 parameter_brace_expand (string, indexp, Link Here
4838
  if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex]))
4845
  if (c == ':' && VALID_PARAM_EXPAND_CHAR (string[sindex]))
4839
    {
4846
    {
4840
      check_nullness++;
4847
      check_nullness++;
4841
      if (c = string[sindex])
4848
      if ((c = string[sindex]))
4842
	sindex++;
4849
	sindex++;
4843
    }
4850
    }
4844
  else if (c == ':' && string[sindex] != RBRACE)
4851
  else if (c == ':' && string[sindex] != RBRACE)
Lines 6068-6074 string_quote_removal (string, quoted) Link Here
6068
6075
6069
  r = result_string = (char *)xmalloc (slen + 1);
6076
  r = result_string = (char *)xmalloc (slen + 1);
6070
6077
6071
  for (dquote = sindex = 0; c = string[sindex];)
6078
  for (dquote = sindex = 0; (c = string[sindex]);)
6072
    {
6079
    {
6073
      switch (c)
6080
      switch (c)
6074
	{
6081
	{
Lines 6498-6504 brace_expand_word_list (tlist, eflags) Link Here
6498
	{
6505
	{
6499
	  expansions = brace_expand (tlist->word->word);
6506
	  expansions = brace_expand (tlist->word->word);
6500
6507
6501
	  for (eindex = 0; temp_string = expansions[eindex]; eindex++)
6508
	  for (eindex = 0; (temp_string = expansions[eindex]); eindex++)
6502
	    {
6509
	    {
6503
	      w = make_word (temp_string);
6510
	      w = make_word (temp_string);
6504
	      /* If brace expansion didn't change the word, preserve
6511
	      /* If brace expansion didn't change the word, preserve
(-)bash-2.05b.orig/test.c (-1 / +5 lines)
Lines 30-35 Link Here
30
30
31
#include <stdio.h>
31
#include <stdio.h>
32
32
33
#include "stdc.h"
34
33
#include "bashtypes.h"
35
#include "bashtypes.h"
34
36
35
#if !defined (HAVE_LIMITS_H)
37
#if !defined (HAVE_LIMITS_H)
Lines 134-140 static int filecomp __P((char *, char *, Link Here
134
static int arithcomp __P((char *, char *, int, int));
136
static int arithcomp __P((char *, char *, int, int));
135
static int patcomp __P((char *, char *, int));
137
static int patcomp __P((char *, char *, int));
136
138
137
static void
139
static void __attribute__((__noreturn__))
138
test_syntax_error (format, arg)
140
test_syntax_error (format, arg)
139
     char *format, *arg;
141
     char *format, *arg;
140
{
142
{
Lines 749-754 test_binop (op) Link Here
749
      else
751
      else
750
	return (0);
752
	return (0);
751
    }
753
    }
754
755
    return 0;
752
}
756
}
753
757
754
/* Return non-zero if OP is one of the test command's unary operators. */
758
/* Return non-zero if OP is one of the test command's unary operators. */
(-)bash-2.05b.orig/unwind_prot.c (-2 / +2 lines)
Lines 235-241 unwind_frame_discard_internal (tag, igno Link Here
235
{
235
{
236
  UNWIND_ELT *elt;
236
  UNWIND_ELT *elt;
237
237
238
  while (elt = unwind_protect_list)
238
  while ((elt = unwind_protect_list))
239
    {
239
    {
240
      unwind_protect_list = unwind_protect_list->head.next;
240
      unwind_protect_list = unwind_protect_list->head.next;
241
      if (elt->head.cleanup == 0 && (STREQ (elt->arg.v, tag)))
241
      if (elt->head.cleanup == 0 && (STREQ (elt->arg.v, tag)))
Lines 264-270 unwind_frame_run_internal (tag, ignore) Link Here
264
{
264
{
265
  UNWIND_ELT *elt;
265
  UNWIND_ELT *elt;
266
266
267
  while (elt = unwind_protect_list)
267
  while ((elt = unwind_protect_list))
268
    {
268
    {
269
      unwind_protect_list = elt->head.next;
269
      unwind_protect_list = elt->head.next;
270
270
(-)bash-2.05b.orig/variables.c (-8 / +8 lines)
Lines 239-245 initialize_shell_variables (env, privmod Link Here
239
  if (shell_functions == 0)
239
  if (shell_functions == 0)
240
    shell_functions = hash_create (0);
240
    shell_functions = hash_create (0);
241
241
242
  for (string_index = 0; string = env[string_index++]; )
242
  for (string_index = 0; (string = env[string_index++]); )
243
    {
243
    {
244
      char_index = 0;
244
      char_index = 0;
245
      name = string;
245
      name = string;
Lines 276-282 initialize_shell_variables (env, privmod Link Here
276
	  if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
276
	  if (name[char_index - 1] == ')' && name[char_index - 2] == '(')
277
	    name[char_index - 2] = '\0';
277
	    name[char_index - 2] = '\0';
278
278
279
	  if (temp_var = find_function (name))
279
	  if ((temp_var = find_function (name)))
280
	    {
280
	    {
281
	      VSETATTR (temp_var, (att_exported|att_imported));
281
	      VSETATTR (temp_var, (att_exported|att_imported));
282
	      array_needs_making = 1;
282
	      array_needs_making = 1;
Lines 1320-1326 var_lookup (name, vcontext) Link Here
1320
1320
1321
  v = (SHELL_VAR *)NULL;
1321
  v = (SHELL_VAR *)NULL;
1322
  for (vc = vcontext; vc; vc = vc->down)
1322
  for (vc = vcontext; vc; vc = vc->down)
1323
    if (v = hash_lookup (name, vc->table))
1323
    if ((v = hash_lookup (name, vc->table)))
1324
      break;
1324
      break;
1325
1325
1326
  return v;
1326
  return v;
Lines 1442-1448 make_local_variable (name) Link Here
1442
  SHELL_VAR *new_var, *old_var;
1442
  SHELL_VAR *new_var, *old_var;
1443
  VAR_CONTEXT *vc;
1443
  VAR_CONTEXT *vc;
1444
  int was_tmpvar;
1444
  int was_tmpvar;
1445
  char *tmp_value;
1445
  char *tmp_value = 0;
1446
1446
1447
  /* local foo; local foo;  is a no-op. */
1447
  /* local foo; local foo;  is a no-op. */
1448
  old_var = find_variable (name);
1448
  old_var = find_variable (name);
Lines 1788-1794 bind_int_variable (lhs, rhs) Link Here
1788
1788
1789
  isint = isarr = 0;
1789
  isint = isarr = 0;
1790
#if defined (ARRAY_VARS)
1790
#if defined (ARRAY_VARS)
1791
  if (t = xstrchr (lhs, '['))	/*]*/
1791
  if ((t = xstrchr (lhs, '[')))	/*]*/
1792
    {
1792
    {
1793
      isarr = 1;
1793
      isarr = 1;
1794
      v = array_variable_part (lhs, (char **)0, (int *)0);
1794
      v = array_variable_part (lhs, (char **)0, (int *)0);
Lines 2077-2083 makunbound (name, vc) Link Here
2077
  char *t;
2077
  char *t;
2078
2078
2079
  for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down)
2079
  for (elt = (BUCKET_CONTENTS *)NULL, v = vc; v; v = v->down)
2080
    if (elt = hash_remove (name, v->table, 0))
2080
    if ((elt = hash_remove (name, v->table, 0)))
2081
      break;
2081
      break;
2082
2082
2083
  if (elt == 0)
2083
  if (elt == 0)
Lines 2750-2756 make_env_array_from_var_list (vars) Link Here
2750
2750
2751
#define USE_EXPORTSTR (value == var->exportstr)
2751
#define USE_EXPORTSTR (value == var->exportstr)
2752
2752
2753
  for (i = 0, list_index = 0; var = vars[i]; i++)
2753
  for (i = 0, list_index = 0; (var = vars[i]); i++)
2754
    {
2754
    {
2755
#if defined (__CYGWIN__)
2755
#if defined (__CYGWIN__)
2756
      /* We don't use the exportstr stuff on Cygwin at all. */
2756
      /* We don't use the exportstr stuff on Cygwin at all. */
Lines 3160-3166 pop_var_context () Link Here
3160
      return;
3160
      return;
3161
    }
3161
    }
3162
3162
3163
  if (ret = vcxt->down)
3163
  if ((ret = vcxt->down))
3164
    {
3164
    {
3165
      ret->up = (VAR_CONTEXT *)NULL;
3165
      ret->up = (VAR_CONTEXT *)NULL;
3166
      shell_variables = ret;
3166
      shell_variables = ret;

Return to bug 6082