source:
patches/bash-4.2-branch_update-2.patch@
489286f
Last change on this file since 489286f was b369f3c, checked in by , 14 years ago | |
---|---|
|
|
File size: 13.8 KB |
-
builtins/fc.def
Submitted By: Jonathan Norman (jonathan at bluesquarelinux.co.uk) Date: 2011-05-16 Initial Package Version: 4.2 Origin: Upstream Upstream Status: Applied Description: Contains all upstream patches up to 4.2-010 diff -Naur bash-4.2.orig/builtins/fc.def bash-4.2/builtins/fc.def
old new 304 304 last_hist = i - rh - hist_last_line_added; 305 305 306 306 /* XXX */ 307 if ( saved_command_line_count > 0 &&i == last_hist && hlist[last_hist] == 0)307 if (i == last_hist && hlist[last_hist] == 0) 308 308 while (last_hist >= 0 && hlist[last_hist] == 0) 309 309 last_hist--; 310 310 if (last_hist < 0) … … 475 475 HIST_ENTRY **hlist; 476 476 { 477 477 int sign, n, clen, rh; 478 register int i, j ;478 register int i, j, last_hist; 479 479 register char *s; 480 480 481 481 sign = 1; … … 495 495 has been enabled (interactive or not) should use it in the last_hist 496 496 calculation as if it were on. */ 497 497 rh = remember_on_history || ((subshell_environment & SUBSHELL_COMSUB) && enable_history_list); 498 i -= rh + hist_last_line_added; 498 last_hist = i - rh - hist_last_line_added; 499 500 if (i == last_hist && hlist[last_hist] == 0) 501 while (last_hist >= 0 && hlist[last_hist] == 0) 502 last_hist--; 503 if (last_hist < 0) 504 return (-1); 505 506 i = last_hist; 499 507 500 508 /* No specification defaults to most recent command. */ 501 509 if (command == NULL) -
builtins/printf.def
diff -Naur bash-4.2.orig/builtins/printf.def bash-4.2/builtins/printf.def
old new 465 465 secs = shell_start_time; /* roughly $SECONDS */ 466 466 else 467 467 secs = arg; 468 #if defined (HAVE_TZSET) 469 sv_tz ("TZ"); /* XXX -- just make sure */ 470 #endif 468 471 tm = localtime (&secs); 469 472 n = strftime (timebuf, sizeof (timebuf), timefmt, tm); 470 473 free (timefmt); -
lib/glob/gmisc.c
diff -Naur bash-4.2.orig/lib/glob/gmisc.c bash-4.2/lib/glob/gmisc.c
old new 77 77 wchar_t *wpat; 78 78 size_t wmax; 79 79 { 80 wchar_t wc , *wbrack;81 int matlen, t, in_cclass, in_collsym, in_equiv;80 wchar_t wc; 81 int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; 82 82 83 83 if (*wpat == 0) 84 84 return (0); … … 118 118 break; 119 119 case L'[': 120 120 /* scan for ending `]', skipping over embedded [:...:] */ 121 wbrack = wpat;121 bracklen = 1; 122 122 wc = *wpat++; 123 123 do 124 124 { 125 125 if (wc == 0) 126 126 { 127 matlen += wpat - wbrack - 1; /* incremented below */ 128 break; 127 wpat--; /* back up to NUL */ 128 matlen += bracklen; 129 goto bad_bracket; 129 130 } 130 131 else if (wc == L'\\') 131 132 { 132 wc = *wpat++; 133 if (*wpat == 0) 134 break; 133 /* *wpat == backslash-escaped character */ 134 bracklen++; 135 /* If the backslash or backslash-escape ends the string, 136 bail. The ++wpat skips over the backslash escape */ 137 if (*wpat == 0 || *++wpat == 0) 138 { 139 matlen += bracklen; 140 goto bad_bracket; 141 } 135 142 } 136 143 else if (wc == L'[' && *wpat == L':') /* character class */ 137 144 { 138 145 wpat++; 146 bracklen++; 139 147 in_cclass = 1; 140 148 } 141 149 else if (in_cclass && wc == L':' && *wpat == L']') 142 150 { 143 151 wpat++; 152 bracklen++; 144 153 in_cclass = 0; 145 154 } 146 155 else if (wc == L'[' && *wpat == L'.') /* collating symbol */ 147 156 { 148 157 wpat++; 158 bracklen++; 149 159 if (*wpat == L']') /* right bracket can appear as collating symbol */ 150 wpat++; 160 { 161 wpat++; 162 bracklen++; 163 } 151 164 in_collsym = 1; 152 165 } 153 166 else if (in_collsym && wc == L'.' && *wpat == L']') 154 167 { 155 168 wpat++; 169 bracklen++; 156 170 in_collsym = 0; 157 171 } 158 172 else if (wc == L'[' && *wpat == L'=') /* equivalence class */ 159 173 { 160 174 wpat++; 175 bracklen++; 161 176 if (*wpat == L']') /* right bracket can appear as equivalence class */ 162 wpat++; 177 { 178 wpat++; 179 bracklen++; 180 } 163 181 in_equiv = 1; 164 182 } 165 183 else if (in_equiv && wc == L'=' && *wpat == L']') 166 184 { 167 185 wpat++; 186 bracklen++; 168 187 in_equiv = 0; 169 188 } 189 else 190 bracklen++; 170 191 } 171 192 while ((wc = *wpat++) != L']'); 172 193 matlen++; /* bracket expression can only match one char */ 194 bad_bracket: 173 195 break; 174 196 } 175 197 } … … 213 235 char *pat; 214 236 size_t max; 215 237 { 216 char c , *brack;217 int matlen, t, in_cclass, in_collsym, in_equiv;238 char c; 239 int matlen, bracklen, t, in_cclass, in_collsym, in_equiv; 218 240 219 241 if (*pat == 0) 220 242 return (0); … … 254 276 break; 255 277 case '[': 256 278 /* scan for ending `]', skipping over embedded [:...:] */ 257 brack = pat;279 bracklen = 1; 258 280 c = *pat++; 259 281 do 260 282 { 261 283 if (c == 0) 262 284 { 263 matlen += pat - brack - 1; /* incremented below */ 264 break; 285 pat--; /* back up to NUL */ 286 matlen += bracklen; 287 goto bad_bracket; 265 288 } 266 289 else if (c == '\\') 267 290 { 268 c = *pat++; 269 if (*pat == 0) 270 break; 291 /* *pat == backslash-escaped character */ 292 bracklen++; 293 /* If the backslash or backslash-escape ends the string, 294 bail. The ++pat skips over the backslash escape */ 295 if (*pat == 0 || *++pat == 0) 296 { 297 matlen += bracklen; 298 goto bad_bracket; 299 } 271 300 } 272 301 else if (c == '[' && *pat == ':') /* character class */ 273 302 { 274 303 pat++; 304 bracklen++; 275 305 in_cclass = 1; 276 306 } 277 307 else if (in_cclass && c == ':' && *pat == ']') 278 308 { 279 309 pat++; 310 bracklen++; 280 311 in_cclass = 0; 281 312 } 282 313 else if (c == '[' && *pat == '.') /* collating symbol */ 283 314 { 284 315 pat++; 316 bracklen++; 285 317 if (*pat == ']') /* right bracket can appear as collating symbol */ 286 pat++; 318 { 319 pat++; 320 bracklen++; 321 } 287 322 in_collsym = 1; 288 323 } 289 324 else if (in_collsym && c == '.' && *pat == ']') 290 325 { 291 326 pat++; 327 bracklen++; 292 328 in_collsym = 0; 293 329 } 294 330 else if (c == '[' && *pat == '=') /* equivalence class */ 295 331 { 296 332 pat++; 333 bracklen++; 297 334 if (*pat == ']') /* right bracket can appear as equivalence class */ 298 pat++; 335 { 336 pat++; 337 bracklen++; 338 } 299 339 in_equiv = 1; 300 340 } 301 341 else if (in_equiv && c == '=' && *pat == ']') 302 342 { 303 343 pat++; 344 bracklen++; 304 345 in_equiv = 0; 305 346 } 347 else 348 bracklen++; 306 349 } 307 350 while ((c = *pat++) != ']'); 308 351 matlen++; /* bracket expression can only match one char */ 352 bad_bracket: 309 353 break; 310 354 } 311 355 } -
lib/readline/callback.c
diff -Naur bash-4.2.orig/lib/readline/callback.c bash-4.2/lib/readline/callback.c
old new 148 148 eof = _rl_vi_domove_callback (_rl_vimvcxt); 149 149 /* Should handle everything, including cleanup, numeric arguments, 150 150 and turning off RL_STATE_VIMOTION */ 151 if (RL_ISSTATE (RL_STATE_NUMERICARG) == 0) 152 _rl_internal_char_cleanup (); 153 151 154 return; 152 155 } 153 156 #endif -
lib/readline/vi_mode.c
diff -Naur bash-4.2.orig/lib/readline/vi_mode.c bash-4.2/lib/readline/vi_mode.c
old new 1114 1114 rl_beg_of_line (1, c); 1115 1115 _rl_vi_last_motion = c; 1116 1116 RL_UNSETSTATE (RL_STATE_VIMOTION); 1117 return ( 0);1117 return (vidomove_dispatch (m)); 1118 1118 } 1119 1119 #if defined (READLINE_CALLBACKS) 1120 1120 /* XXX - these need to handle rl_universal_argument bindings */ -
parse.y
diff -Naur bash-4.2.orig/parse.y bash-4.2/parse.y
old new 5135 5135 case 'A': 5136 5136 /* Make the current time/date into a string. */ 5137 5137 (void) time (&the_time); 5138 #if defined (HAVE_TZSET) 5139 sv_tz ("TZ"); /* XXX -- just make sure */ 5140 #endif 5138 5141 tm = localtime (&the_time); 5139 5142 5140 5143 if (c == 'd') -
patchlevel.h
diff -Naur bash-4.2.orig/patchlevel.h bash-4.2/patchlevel.h
old new 25 25 regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh 26 26 looks for to find the patch level (for the sccs version string). */ 27 27 28 #define PATCHLEVEL 028 #define PATCHLEVEL 10 29 29 30 30 #endif /* _PATCHLEVEL_H_ */ -
print_cmd.c
diff -Naur bash-4.2.orig/print_cmd.c bash-4.2/print_cmd.c
old new 315 315 cprintf ("( "); 316 316 skip_this_indent++; 317 317 make_command_string_internal (command->value.Subshell->command); 318 PRINT_DEFERRED_HEREDOCS (""); 318 319 cprintf (" )"); 319 320 break; 320 321 … … 592 593 newline ("do\n"); 593 594 indentation += indentation_amount; 594 595 make_command_string_internal (arith_for_command->action); 596 PRINT_DEFERRED_HEREDOCS (""); 595 597 semicolon (); 596 598 indentation -= indentation_amount; 597 599 newline ("done"); … … 653 655 } 654 656 655 657 make_command_string_internal (group_command->command); 658 PRINT_DEFERRED_HEREDOCS (""); 656 659 657 660 if (inside_function_def) 658 661 { -
bash-4.2
diff -Naur bash-4.2.orig/sig.c bash-4.2/sig.c
old new 46 46 47 47 #if defined (READLINE) 48 48 # include "bashline.h" 49 # include <readline/readline.h> 49 50 #endif 50 51 51 52 #if defined (HISTORY) … … 62 63 #if defined (HISTORY) 63 64 extern int history_lines_this_session; 64 65 #endif 66 extern int no_line_editing; 65 67 66 68 extern void initialize_siglist (); 67 69 … … 505 507 { 506 508 #if defined (HISTORY) 507 509 /* XXX - will inhibit history file being written */ 508 history_lines_this_session = 0; 510 # if defined (READLINE) 511 if (interactive_shell == 0 || interactive == 0 || (sig != SIGHUP && sig != SIGTERM) || no_line_editing || (RL_ISSTATE (RL_STATE_READCMD) == 0)) 512 # endif 513 history_lines_this_session = 0; 509 514 #endif 510 515 terminate_immediately = 0; 511 516 termsig_handler (sig); -
subst.c
diff -Naur bash-4.2.orig/subst.c bash-4.2/subst.c
old new 1379 1379 slen = strlen (string + *sindex) + *sindex; 1380 1380 1381 1381 /* The handling of dolbrace_state needs to agree with the code in parse.y: 1382 parse_matched_pair() */ 1383 dolbrace_state = 0; 1384 if (quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) 1385 dolbrace_state = (flags & SX_POSIXEXP) ? DOLBRACE_QUOTE : DOLBRACE_PARAM; 1382 parse_matched_pair(). The different initial value is to handle the 1383 case where this function is called to parse the word in 1384 ${param op word} (SX_WORD). */ 1385 dolbrace_state = (flags & SX_WORD) ? DOLBRACE_WORD : DOLBRACE_PARAM; 1386 if ((quoted & (Q_HERE_DOCUMENT|Q_DOUBLE_QUOTES)) && (flags & SX_POSIXEXP)) 1387 dolbrace_state = DOLBRACE_QUOTE; 1386 1388 1387 1389 i = *sindex; 1388 1390 while (c = string[i]) … … 3371 3373 if (string == 0 || *string == '\0') 3372 3374 return (WORD_LIST *)NULL; 3373 3375 3374 td.flags = 0;3376 td.flags = W_NOSPLIT2; /* no splitting, remove "" and '' */ 3375 3377 td.word = string; 3376 3378 tresult = call_expand_word_internal (&td, quoted, 1, dollar_at_p, has_dollar_at); 3377 3379 return (tresult); … … 4607 4609 if (ifs_firstc == 0) 4608 4610 #endif 4609 4611 word->flags |= W_NOSPLIT; 4612 word->flags |= W_NOSPLIT2; 4610 4613 result = call_expand_word_internal (word, quoted, 0, (int *)NULL, (int *)NULL); 4611 4614 expand_no_split_dollar_star = 0; 4612 4615 … … 7176 7179 { 7177 7180 /* Extract the contents of the ${ ... } expansion 7178 7181 according to the Posix.2 rules. */ 7179 value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' ) ? SX_POSIXEXP : 0);7182 value = extract_dollar_brace_string (string, &sindex, quoted, (c == '%' || c == '#' || c =='/' || c == '^' || c == ',' || c ==':') ? SX_POSIXEXP|SX_WORD : SX_WORD); 7180 7183 if (string[sindex] == RBRACE) 7181 7184 sindex++; 7182 7185 else -
subst.h
diff -Naur bash-4.2.orig/subst.h bash-4.2/subst.h
old new 56 56 #define SX_NOLONGJMP 0x0040 /* don't longjmp on fatal error */ 57 57 #define SX_ARITHSUB 0x0080 /* extracting $(( ... )) (currently unused) */ 58 58 #define SX_POSIXEXP 0x0100 /* extracting new Posix pattern removal expansions in extract_dollar_brace_string */ 59 #define SX_WORD 0x0200 /* extracting word in ${param op word} */ 59 60 60 61 /* Remove backslashes which are quoting backquotes from STRING. Modifies 61 62 STRING, and returns a pointer to it. */ -
variables.c
diff -Naur bash-4.2.orig/variables.c bash-4.2/variables.c
old new 3653 3653 return n; 3654 3654 } 3655 3655 3656 int 3657 chkexport (name) 3658 char *name; 3659 { 3660 SHELL_VAR *v; 3661 3662 v = find_variable (name); 3663 if (v && exported_p (v)) 3664 { 3665 array_needs_making = 1; 3666 maybe_make_export_env (); 3667 return 1; 3668 } 3669 return 0; 3670 } 3671 3656 3672 void 3657 3673 maybe_make_export_env () 3658 3674 { … … 4214 4230 { "TEXTDOMAIN", sv_locale }, 4215 4231 { "TEXTDOMAINDIR", sv_locale }, 4216 4232 4217 #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)4233 #if defined (HAVE_TZSET) 4218 4234 { "TZ", sv_tz }, 4219 4235 #endif 4220 4236 … … 4558 4574 } 4559 4575 #endif /* HISTORY */ 4560 4576 4561 #if defined (HAVE_TZSET) && defined (PROMPT_STRING_DECODE)4577 #if defined (HAVE_TZSET) 4562 4578 void 4563 4579 sv_tz (name) 4564 4580 char *name; 4565 4581 { 4566 tzset (); 4582 if (chkexport (name)) 4583 tzset (); 4567 4584 } 4568 4585 #endif 4569 4586 -
variables.h
diff -Naur bash-4.2.orig/variables.h bash-4.2/variables.h
old new 313 313 314 314 extern void sort_variables __P((SHELL_VAR **)); 315 315 316 extern int chkexport __P((char *)); 316 317 extern void maybe_make_export_env __P((void)); 317 318 extern void update_export_env_inplace __P((char *, int, char *)); 318 319 extern void put_command_name_into_env __P((char *));
Note:
See TracBrowser
for help on using the repository browser.