You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1396 lines
47 KiB

  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.3
  4. Patch-ID: bash43-030
  5. Bug-Reported-by: Michal Zalewski <lcamtuf@coredump.cx>
  6. Bug-Reference-ID:
  7. Bug-Reference-URL:
  8. Bug-Description:
  9. A combination of nested command substitutions and function importing from
  10. the environment can cause bash to execute code appearing in the environment
  11. variable value following the function definition.
  12. Patch (apply with `patch -p0'):
  13. --- a/builtins/evalstring.c
  14. +++ b/builtins/evalstring.c
  15. @@ -308,12 +308,25 @@ parse_and_execute (string, from_file, fl
  16. {
  17. struct fd_bitmap *bitmap;
  18. - if ((flags & SEVAL_FUNCDEF) && command->type != cm_function_def)
  19. + if (flags & SEVAL_FUNCDEF)
  20. {
  21. - internal_warning ("%s: ignoring function definition attempt", from_file);
  22. - should_jump_to_top_level = 0;
  23. - last_result = last_command_exit_value = EX_BADUSAGE;
  24. - break;
  25. + char *x;
  26. +
  27. + /* If the command parses to something other than a straight
  28. + function definition, or if we have not consumed the entire
  29. + string, or if the parser has transformed the function
  30. + name (as parsing will if it begins or ends with shell
  31. + whitespace, for example), reject the attempt */
  32. + if (command->type != cm_function_def ||
  33. + ((x = parser_remaining_input ()) && *x) ||
  34. + (STREQ (from_file, command->value.Function_def->name->word) == 0))
  35. + {
  36. + internal_warning (_("%s: ignoring function definition attempt"), from_file);
  37. + should_jump_to_top_level = 0;
  38. + last_result = last_command_exit_value = EX_BADUSAGE;
  39. + reset_parser ();
  40. + break;
  41. + }
  42. }
  43. bitmap = new_fd_bitmap (FD_BITMAP_SIZE);
  44. @@ -378,7 +391,10 @@ parse_and_execute (string, from_file, fl
  45. discard_unwind_frame ("pe_dispose");
  46. if (flags & SEVAL_ONECMD)
  47. - break;
  48. + {
  49. + reset_parser ();
  50. + break;
  51. + }
  52. }
  53. }
  54. else
  55. --- a/parse.y
  56. +++ b/parse.y
  57. @@ -2538,6 +2538,16 @@ shell_ungetc (c)
  58. eol_ungetc_lookahead = c;
  59. }
  60. +char *
  61. +parser_remaining_input ()
  62. +{
  63. + if (shell_input_line == 0)
  64. + return 0;
  65. + if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
  66. + return '\0'; /* XXX */
  67. + return (shell_input_line + shell_input_line_index);
  68. +}
  69. +
  70. #ifdef INCLUDE_UNUSED
  71. /* Back the input pointer up by one, effectively `ungetting' a character. */
  72. static void
  73. @@ -4027,8 +4037,8 @@ xparse_dolparen (base, string, indp, fla
  74. reset_parser ();
  75. /* reset_parser clears shell_input_line and associated variables */
  76. restore_input_line_state (&ls);
  77. - if (interactive)
  78. - token_to_read = 0;
  79. +
  80. + token_to_read = 0;
  81. /* Need to find how many characters parse_and_execute consumed, update
  82. *indp, if flags != 0, copy the portion of the string parsed into RET
  83. --- a/shell.h
  84. +++ b/shell.h
  85. @@ -180,6 +180,8 @@ typedef struct _sh_input_line_state_t {
  86. } sh_input_line_state_t;
  87. /* Let's try declaring these here. */
  88. +extern char *parser_remaining_input __P((void));
  89. +
  90. extern sh_parser_state_t *save_parser_state __P((sh_parser_state_t *));
  91. extern void restore_parser_state __P((sh_parser_state_t *));
  92. --- a/y.tab.c
  93. +++ b/y.tab.c
  94. @@ -168,7 +168,7 @@
  95. /* Copy the first part of user declarations. */
  96. -#line 21 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  97. +#line 21 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  98. #include "config.h"
  99. @@ -497,7 +497,7 @@ static REDIRECTEE redir;
  100. #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
  101. typedef union YYSTYPE
  102. -#line 329 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  103. +#line 329 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  104. {
  105. WORD_DESC *word; /* the word that we read. */
  106. int number; /* the number that we read. */
  107. @@ -2098,7 +2098,7 @@ yyreduce:
  108. switch (yyn)
  109. {
  110. case 2:
  111. -#line 383 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  112. +#line 383 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  113. {
  114. /* Case of regular command. Discard the error
  115. safety net,and return the command just parsed. */
  116. @@ -2112,7 +2112,7 @@ yyreduce:
  117. break;
  118. case 3:
  119. -#line 394 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  120. +#line 394 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  121. {
  122. /* Case of regular command, but not a very
  123. interesting one. Return a NULL command. */
  124. @@ -2124,7 +2124,7 @@ yyreduce:
  125. break;
  126. case 4:
  127. -#line 403 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  128. +#line 403 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  129. {
  130. /* Error during parsing. Return NULL command. */
  131. global_command = (COMMAND *)NULL;
  132. @@ -2142,7 +2142,7 @@ yyreduce:
  133. break;
  134. case 5:
  135. -#line 418 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  136. +#line 418 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  137. {
  138. /* Case of EOF seen by itself. Do ignoreeof or
  139. not. */
  140. @@ -2153,17 +2153,17 @@ yyreduce:
  141. break;
  142. case 6:
  143. -#line 428 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  144. +#line 428 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  145. { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
  146. break;
  147. case 7:
  148. -#line 430 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  149. +#line 430 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  150. { (yyval.word_list) = make_word_list ((yyvsp[(2) - (2)].word), (yyvsp[(1) - (2)].word_list)); }
  151. break;
  152. case 8:
  153. -#line 434 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  154. +#line 434 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  155. {
  156. source.dest = 1;
  157. redir.filename = (yyvsp[(2) - (2)].word);
  158. @@ -2172,7 +2172,7 @@ yyreduce:
  159. break;
  160. case 9:
  161. -#line 440 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  162. +#line 440 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  163. {
  164. source.dest = 0;
  165. redir.filename = (yyvsp[(2) - (2)].word);
  166. @@ -2181,7 +2181,7 @@ yyreduce:
  167. break;
  168. case 10:
  169. -#line 446 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  170. +#line 446 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  171. {
  172. source.dest = (yyvsp[(1) - (3)].number);
  173. redir.filename = (yyvsp[(3) - (3)].word);
  174. @@ -2190,7 +2190,7 @@ yyreduce:
  175. break;
  176. case 11:
  177. -#line 452 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  178. +#line 452 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  179. {
  180. source.dest = (yyvsp[(1) - (3)].number);
  181. redir.filename = (yyvsp[(3) - (3)].word);
  182. @@ -2199,7 +2199,7 @@ yyreduce:
  183. break;
  184. case 12:
  185. -#line 458 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  186. +#line 458 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  187. {
  188. source.filename = (yyvsp[(1) - (3)].word);
  189. redir.filename = (yyvsp[(3) - (3)].word);
  190. @@ -2208,7 +2208,7 @@ yyreduce:
  191. break;
  192. case 13:
  193. -#line 464 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  194. +#line 464 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  195. {
  196. source.filename = (yyvsp[(1) - (3)].word);
  197. redir.filename = (yyvsp[(3) - (3)].word);
  198. @@ -2217,7 +2217,7 @@ yyreduce:
  199. break;
  200. case 14:
  201. -#line 470 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  202. +#line 470 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  203. {
  204. source.dest = 1;
  205. redir.filename = (yyvsp[(2) - (2)].word);
  206. @@ -2226,7 +2226,7 @@ yyreduce:
  207. break;
  208. case 15:
  209. -#line 476 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  210. +#line 476 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  211. {
  212. source.dest = (yyvsp[(1) - (3)].number);
  213. redir.filename = (yyvsp[(3) - (3)].word);
  214. @@ -2235,7 +2235,7 @@ yyreduce:
  215. break;
  216. case 16:
  217. -#line 482 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  218. +#line 482 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  219. {
  220. source.filename = (yyvsp[(1) - (3)].word);
  221. redir.filename = (yyvsp[(3) - (3)].word);
  222. @@ -2244,7 +2244,7 @@ yyreduce:
  223. break;
  224. case 17:
  225. -#line 488 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  226. +#line 488 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  227. {
  228. source.dest = 1;
  229. redir.filename = (yyvsp[(2) - (2)].word);
  230. @@ -2253,7 +2253,7 @@ yyreduce:
  231. break;
  232. case 18:
  233. -#line 494 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  234. +#line 494 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  235. {
  236. source.dest = (yyvsp[(1) - (3)].number);
  237. redir.filename = (yyvsp[(3) - (3)].word);
  238. @@ -2262,7 +2262,7 @@ yyreduce:
  239. break;
  240. case 19:
  241. -#line 500 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  242. +#line 500 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  243. {
  244. source.filename = (yyvsp[(1) - (3)].word);
  245. redir.filename = (yyvsp[(3) - (3)].word);
  246. @@ -2271,7 +2271,7 @@ yyreduce:
  247. break;
  248. case 20:
  249. -#line 506 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  250. +#line 506 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  251. {
  252. source.dest = 0;
  253. redir.filename = (yyvsp[(2) - (2)].word);
  254. @@ -2280,7 +2280,7 @@ yyreduce:
  255. break;
  256. case 21:
  257. -#line 512 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  258. +#line 512 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  259. {
  260. source.dest = (yyvsp[(1) - (3)].number);
  261. redir.filename = (yyvsp[(3) - (3)].word);
  262. @@ -2289,7 +2289,7 @@ yyreduce:
  263. break;
  264. case 22:
  265. -#line 518 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  266. +#line 518 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  267. {
  268. source.filename = (yyvsp[(1) - (3)].word);
  269. redir.filename = (yyvsp[(3) - (3)].word);
  270. @@ -2298,7 +2298,7 @@ yyreduce:
  271. break;
  272. case 23:
  273. -#line 524 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  274. +#line 524 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  275. {
  276. source.dest = 0;
  277. redir.filename = (yyvsp[(2) - (2)].word);
  278. @@ -2308,7 +2308,7 @@ yyreduce:
  279. break;
  280. case 24:
  281. -#line 531 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  282. +#line 531 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  283. {
  284. source.dest = (yyvsp[(1) - (3)].number);
  285. redir.filename = (yyvsp[(3) - (3)].word);
  286. @@ -2318,7 +2318,7 @@ yyreduce:
  287. break;
  288. case 25:
  289. -#line 538 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  290. +#line 538 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  291. {
  292. source.filename = (yyvsp[(1) - (3)].word);
  293. redir.filename = (yyvsp[(3) - (3)].word);
  294. @@ -2328,7 +2328,7 @@ yyreduce:
  295. break;
  296. case 26:
  297. -#line 545 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  298. +#line 545 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  299. {
  300. source.dest = 0;
  301. redir.filename = (yyvsp[(2) - (2)].word);
  302. @@ -2338,7 +2338,7 @@ yyreduce:
  303. break;
  304. case 27:
  305. -#line 552 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  306. +#line 552 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  307. {
  308. source.dest = (yyvsp[(1) - (3)].number);
  309. redir.filename = (yyvsp[(3) - (3)].word);
  310. @@ -2348,7 +2348,7 @@ yyreduce:
  311. break;
  312. case 28:
  313. -#line 559 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  314. +#line 559 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  315. {
  316. source.filename = (yyvsp[(1) - (3)].word);
  317. redir.filename = (yyvsp[(3) - (3)].word);
  318. @@ -2358,7 +2358,7 @@ yyreduce:
  319. break;
  320. case 29:
  321. -#line 566 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  322. +#line 566 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  323. {
  324. source.dest = 0;
  325. redir.filename = (yyvsp[(2) - (2)].word);
  326. @@ -2367,7 +2367,7 @@ yyreduce:
  327. break;
  328. case 30:
  329. -#line 572 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  330. +#line 572 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  331. {
  332. source.dest = (yyvsp[(1) - (3)].number);
  333. redir.filename = (yyvsp[(3) - (3)].word);
  334. @@ -2376,7 +2376,7 @@ yyreduce:
  335. break;
  336. case 31:
  337. -#line 578 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  338. +#line 578 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  339. {
  340. source.filename = (yyvsp[(1) - (3)].word);
  341. redir.filename = (yyvsp[(3) - (3)].word);
  342. @@ -2385,7 +2385,7 @@ yyreduce:
  343. break;
  344. case 32:
  345. -#line 584 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  346. +#line 584 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  347. {
  348. source.dest = 0;
  349. redir.dest = (yyvsp[(2) - (2)].number);
  350. @@ -2394,7 +2394,7 @@ yyreduce:
  351. break;
  352. case 33:
  353. -#line 590 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  354. +#line 590 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  355. {
  356. source.dest = (yyvsp[(1) - (3)].number);
  357. redir.dest = (yyvsp[(3) - (3)].number);
  358. @@ -2403,7 +2403,7 @@ yyreduce:
  359. break;
  360. case 34:
  361. -#line 596 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  362. +#line 596 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  363. {
  364. source.filename = (yyvsp[(1) - (3)].word);
  365. redir.dest = (yyvsp[(3) - (3)].number);
  366. @@ -2412,7 +2412,7 @@ yyreduce:
  367. break;
  368. case 35:
  369. -#line 602 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  370. +#line 602 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  371. {
  372. source.dest = 1;
  373. redir.dest = (yyvsp[(2) - (2)].number);
  374. @@ -2421,7 +2421,7 @@ yyreduce:
  375. break;
  376. case 36:
  377. -#line 608 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  378. +#line 608 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  379. {
  380. source.dest = (yyvsp[(1) - (3)].number);
  381. redir.dest = (yyvsp[(3) - (3)].number);
  382. @@ -2430,7 +2430,7 @@ yyreduce:
  383. break;
  384. case 37:
  385. -#line 614 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  386. +#line 614 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  387. {
  388. source.filename = (yyvsp[(1) - (3)].word);
  389. redir.dest = (yyvsp[(3) - (3)].number);
  390. @@ -2439,7 +2439,7 @@ yyreduce:
  391. break;
  392. case 38:
  393. -#line 620 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  394. +#line 620 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  395. {
  396. source.dest = 0;
  397. redir.filename = (yyvsp[(2) - (2)].word);
  398. @@ -2448,7 +2448,7 @@ yyreduce:
  399. break;
  400. case 39:
  401. -#line 626 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  402. +#line 626 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  403. {
  404. source.dest = (yyvsp[(1) - (3)].number);
  405. redir.filename = (yyvsp[(3) - (3)].word);
  406. @@ -2457,7 +2457,7 @@ yyreduce:
  407. break;
  408. case 40:
  409. -#line 632 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  410. +#line 632 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  411. {
  412. source.filename = (yyvsp[(1) - (3)].word);
  413. redir.filename = (yyvsp[(3) - (3)].word);
  414. @@ -2466,7 +2466,7 @@ yyreduce:
  415. break;
  416. case 41:
  417. -#line 638 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  418. +#line 638 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  419. {
  420. source.dest = 1;
  421. redir.filename = (yyvsp[(2) - (2)].word);
  422. @@ -2475,7 +2475,7 @@ yyreduce:
  423. break;
  424. case 42:
  425. -#line 644 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  426. +#line 644 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  427. {
  428. source.dest = (yyvsp[(1) - (3)].number);
  429. redir.filename = (yyvsp[(3) - (3)].word);
  430. @@ -2484,7 +2484,7 @@ yyreduce:
  431. break;
  432. case 43:
  433. -#line 650 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  434. +#line 650 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  435. {
  436. source.filename = (yyvsp[(1) - (3)].word);
  437. redir.filename = (yyvsp[(3) - (3)].word);
  438. @@ -2493,7 +2493,7 @@ yyreduce:
  439. break;
  440. case 44:
  441. -#line 656 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  442. +#line 656 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  443. {
  444. source.dest = 1;
  445. redir.dest = 0;
  446. @@ -2502,7 +2502,7 @@ yyreduce:
  447. break;
  448. case 45:
  449. -#line 662 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  450. +#line 662 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  451. {
  452. source.dest = (yyvsp[(1) - (3)].number);
  453. redir.dest = 0;
  454. @@ -2511,7 +2511,7 @@ yyreduce:
  455. break;
  456. case 46:
  457. -#line 668 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  458. +#line 668 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  459. {
  460. source.filename = (yyvsp[(1) - (3)].word);
  461. redir.dest = 0;
  462. @@ -2520,7 +2520,7 @@ yyreduce:
  463. break;
  464. case 47:
  465. -#line 674 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  466. +#line 674 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  467. {
  468. source.dest = 0;
  469. redir.dest = 0;
  470. @@ -2529,7 +2529,7 @@ yyreduce:
  471. break;
  472. case 48:
  473. -#line 680 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  474. +#line 680 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  475. {
  476. source.dest = (yyvsp[(1) - (3)].number);
  477. redir.dest = 0;
  478. @@ -2538,7 +2538,7 @@ yyreduce:
  479. break;
  480. case 49:
  481. -#line 686 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  482. +#line 686 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  483. {
  484. source.filename = (yyvsp[(1) - (3)].word);
  485. redir.dest = 0;
  486. @@ -2547,7 +2547,7 @@ yyreduce:
  487. break;
  488. case 50:
  489. -#line 692 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  490. +#line 692 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  491. {
  492. source.dest = 1;
  493. redir.filename = (yyvsp[(2) - (2)].word);
  494. @@ -2556,7 +2556,7 @@ yyreduce:
  495. break;
  496. case 51:
  497. -#line 698 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  498. +#line 698 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  499. {
  500. source.dest = 1;
  501. redir.filename = (yyvsp[(2) - (2)].word);
  502. @@ -2565,29 +2565,29 @@ yyreduce:
  503. break;
  504. case 52:
  505. -#line 706 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  506. +#line 706 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  507. { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
  508. break;
  509. case 53:
  510. -#line 708 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  511. +#line 708 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  512. { (yyval.element).word = (yyvsp[(1) - (1)].word); (yyval.element).redirect = 0; }
  513. break;
  514. case 54:
  515. -#line 710 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  516. +#line 710 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  517. { (yyval.element).redirect = (yyvsp[(1) - (1)].redirect); (yyval.element).word = 0; }
  518. break;
  519. case 55:
  520. -#line 714 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  521. +#line 714 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  522. {
  523. (yyval.redirect) = (yyvsp[(1) - (1)].redirect);
  524. }
  525. break;
  526. case 56:
  527. -#line 718 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  528. +#line 718 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  529. {
  530. register REDIRECT *t;
  531. @@ -2599,27 +2599,27 @@ yyreduce:
  532. break;
  533. case 57:
  534. -#line 729 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  535. +#line 729 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  536. { (yyval.command) = make_simple_command ((yyvsp[(1) - (1)].element), (COMMAND *)NULL); }
  537. break;
  538. case 58:
  539. -#line 731 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  540. +#line 731 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  541. { (yyval.command) = make_simple_command ((yyvsp[(2) - (2)].element), (yyvsp[(1) - (2)].command)); }
  542. break;
  543. case 59:
  544. -#line 735 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  545. +#line 735 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  546. { (yyval.command) = clean_simple_command ((yyvsp[(1) - (1)].command)); }
  547. break;
  548. case 60:
  549. -#line 737 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  550. +#line 737 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  551. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  552. break;
  553. case 61:
  554. -#line 739 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  555. +#line 739 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  556. {
  557. COMMAND *tc;
  558. @@ -2638,72 +2638,72 @@ yyreduce:
  559. break;
  560. case 62:
  561. -#line 755 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  562. +#line 755 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  563. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  564. break;
  565. case 63:
  566. -#line 757 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  567. +#line 757 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  568. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  569. break;
  570. case 64:
  571. -#line 761 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  572. +#line 761 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  573. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  574. break;
  575. case 65:
  576. -#line 763 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  577. +#line 763 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  578. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  579. break;
  580. case 66:
  581. -#line 765 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  582. +#line 765 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  583. { (yyval.command) = make_while_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
  584. break;
  585. case 67:
  586. -#line 767 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  587. +#line 767 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  588. { (yyval.command) = make_until_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command)); }
  589. break;
  590. case 68:
  591. -#line 769 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  592. +#line 769 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  593. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  594. break;
  595. case 69:
  596. -#line 771 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  597. +#line 771 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  598. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  599. break;
  600. case 70:
  601. -#line 773 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  602. +#line 773 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  603. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  604. break;
  605. case 71:
  606. -#line 775 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  607. +#line 775 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  608. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  609. break;
  610. case 72:
  611. -#line 777 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  612. +#line 777 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  613. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  614. break;
  615. case 73:
  616. -#line 779 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  617. +#line 779 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  618. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  619. break;
  620. case 74:
  621. -#line 781 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  622. +#line 781 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  623. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  624. break;
  625. case 75:
  626. -#line 785 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  627. +#line 785 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  628. {
  629. (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
  630. if (word_top > 0) word_top--;
  631. @@ -2711,7 +2711,7 @@ yyreduce:
  632. break;
  633. case 76:
  634. -#line 790 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  635. +#line 790 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  636. {
  637. (yyval.command) = make_for_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
  638. if (word_top > 0) word_top--;
  639. @@ -2719,7 +2719,7 @@ yyreduce:
  640. break;
  641. case 77:
  642. -#line 795 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  643. +#line 795 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  644. {
  645. (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
  646. if (word_top > 0) word_top--;
  647. @@ -2727,7 +2727,7 @@ yyreduce:
  648. break;
  649. case 78:
  650. -#line 800 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  651. +#line 800 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  652. {
  653. (yyval.command) = make_for_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
  654. if (word_top > 0) word_top--;
  655. @@ -2735,7 +2735,7 @@ yyreduce:
  656. break;
  657. case 79:
  658. -#line 805 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  659. +#line 805 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  660. {
  661. (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
  662. if (word_top > 0) word_top--;
  663. @@ -2743,7 +2743,7 @@ yyreduce:
  664. break;
  665. case 80:
  666. -#line 810 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  667. +#line 810 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  668. {
  669. (yyval.command) = make_for_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
  670. if (word_top > 0) word_top--;
  671. @@ -2751,7 +2751,7 @@ yyreduce:
  672. break;
  673. case 81:
  674. -#line 815 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  675. +#line 815 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  676. {
  677. (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
  678. if (word_top > 0) word_top--;
  679. @@ -2759,7 +2759,7 @@ yyreduce:
  680. break;
  681. case 82:
  682. -#line 820 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  683. +#line 820 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  684. {
  685. (yyval.command) = make_for_command ((yyvsp[(2) - (9)].word), (WORD_LIST *)NULL, (yyvsp[(8) - (9)].command), word_lineno[word_top]);
  686. if (word_top > 0) word_top--;
  687. @@ -2767,7 +2767,7 @@ yyreduce:
  688. break;
  689. case 83:
  690. -#line 827 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  691. +#line 827 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  692. {
  693. (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
  694. if (word_top > 0) word_top--;
  695. @@ -2775,7 +2775,7 @@ yyreduce:
  696. break;
  697. case 84:
  698. -#line 832 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  699. +#line 832 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  700. {
  701. (yyval.command) = make_arith_for_command ((yyvsp[(2) - (7)].word_list), (yyvsp[(6) - (7)].command), arith_for_lineno);
  702. if (word_top > 0) word_top--;
  703. @@ -2783,7 +2783,7 @@ yyreduce:
  704. break;
  705. case 85:
  706. -#line 837 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  707. +#line 837 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  708. {
  709. (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
  710. if (word_top > 0) word_top--;
  711. @@ -2791,7 +2791,7 @@ yyreduce:
  712. break;
  713. case 86:
  714. -#line 842 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  715. +#line 842 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  716. {
  717. (yyval.command) = make_arith_for_command ((yyvsp[(2) - (5)].word_list), (yyvsp[(4) - (5)].command), arith_for_lineno);
  718. if (word_top > 0) word_top--;
  719. @@ -2799,7 +2799,7 @@ yyreduce:
  720. break;
  721. case 87:
  722. -#line 849 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  723. +#line 849 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  724. {
  725. (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
  726. if (word_top > 0) word_top--;
  727. @@ -2807,7 +2807,7 @@ yyreduce:
  728. break;
  729. case 88:
  730. -#line 854 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  731. +#line 854 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  732. {
  733. (yyval.command) = make_select_command ((yyvsp[(2) - (6)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(5) - (6)].command), word_lineno[word_top]);
  734. if (word_top > 0) word_top--;
  735. @@ -2815,7 +2815,7 @@ yyreduce:
  736. break;
  737. case 89:
  738. -#line 859 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  739. +#line 859 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  740. {
  741. (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
  742. if (word_top > 0) word_top--;
  743. @@ -2823,7 +2823,7 @@ yyreduce:
  744. break;
  745. case 90:
  746. -#line 864 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  747. +#line 864 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  748. {
  749. (yyval.command) = make_select_command ((yyvsp[(2) - (7)].word), add_string_to_list ("\"$@\"", (WORD_LIST *)NULL), (yyvsp[(6) - (7)].command), word_lineno[word_top]);
  750. if (word_top > 0) word_top--;
  751. @@ -2831,7 +2831,7 @@ yyreduce:
  752. break;
  753. case 91:
  754. -#line 869 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  755. +#line 869 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  756. {
  757. (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
  758. if (word_top > 0) word_top--;
  759. @@ -2839,7 +2839,7 @@ yyreduce:
  760. break;
  761. case 92:
  762. -#line 874 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  763. +#line 874 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  764. {
  765. (yyval.command) = make_select_command ((yyvsp[(2) - (10)].word), REVERSE_LIST ((yyvsp[(5) - (10)].word_list), WORD_LIST *), (yyvsp[(9) - (10)].command), word_lineno[word_top]);
  766. if (word_top > 0) word_top--;
  767. @@ -2847,7 +2847,7 @@ yyreduce:
  768. break;
  769. case 93:
  770. -#line 881 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  771. +#line 881 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  772. {
  773. (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (PATTERN_LIST *)NULL, word_lineno[word_top]);
  774. if (word_top > 0) word_top--;
  775. @@ -2855,7 +2855,7 @@ yyreduce:
  776. break;
  777. case 94:
  778. -#line 886 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  779. +#line 886 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  780. {
  781. (yyval.command) = make_case_command ((yyvsp[(2) - (7)].word), (yyvsp[(5) - (7)].pattern), word_lineno[word_top]);
  782. if (word_top > 0) word_top--;
  783. @@ -2863,7 +2863,7 @@ yyreduce:
  784. break;
  785. case 95:
  786. -#line 891 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  787. +#line 891 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  788. {
  789. (yyval.command) = make_case_command ((yyvsp[(2) - (6)].word), (yyvsp[(5) - (6)].pattern), word_lineno[word_top]);
  790. if (word_top > 0) word_top--;
  791. @@ -2871,27 +2871,27 @@ yyreduce:
  792. break;
  793. case 96:
  794. -#line 898 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  795. +#line 898 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  796. { (yyval.command) = make_function_def ((yyvsp[(1) - (5)].word), (yyvsp[(5) - (5)].command), function_dstart, function_bstart); }
  797. break;
  798. case 97:
  799. -#line 901 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  800. +#line 901 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  801. { (yyval.command) = make_function_def ((yyvsp[(2) - (6)].word), (yyvsp[(6) - (6)].command), function_dstart, function_bstart); }
  802. break;
  803. case 98:
  804. -#line 904 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  805. +#line 904 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  806. { (yyval.command) = make_function_def ((yyvsp[(2) - (4)].word), (yyvsp[(4) - (4)].command), function_dstart, function_bstart); }
  807. break;
  808. case 99:
  809. -#line 908 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  810. +#line 908 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  811. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  812. break;
  813. case 100:
  814. -#line 910 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  815. +#line 910 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  816. {
  817. COMMAND *tc;
  818. @@ -2923,7 +2923,7 @@ yyreduce:
  819. break;
  820. case 101:
  821. -#line 941 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  822. +#line 941 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  823. {
  824. (yyval.command) = make_subshell_command ((yyvsp[(2) - (3)].command));
  825. (yyval.command)->flags |= CMD_WANT_SUBSHELL;
  826. @@ -2931,7 +2931,7 @@ yyreduce:
  827. break;
  828. case 102:
  829. -#line 948 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  830. +#line 948 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  831. {
  832. (yyval.command) = make_coproc_command ("COPROC", (yyvsp[(2) - (2)].command));
  833. (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
  834. @@ -2939,7 +2939,7 @@ yyreduce:
  835. break;
  836. case 103:
  837. -#line 953 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  838. +#line 953 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  839. {
  840. COMMAND *tc;
  841. @@ -2959,7 +2959,7 @@ yyreduce:
  842. break;
  843. case 104:
  844. -#line 970 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  845. +#line 970 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  846. {
  847. (yyval.command) = make_coproc_command ((yyvsp[(2) - (3)].word)->word, (yyvsp[(3) - (3)].command));
  848. (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
  849. @@ -2967,7 +2967,7 @@ yyreduce:
  850. break;
  851. case 105:
  852. -#line 975 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  853. +#line 975 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  854. {
  855. COMMAND *tc;
  856. @@ -2987,7 +2987,7 @@ yyreduce:
  857. break;
  858. case 106:
  859. -#line 992 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  860. +#line 992 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  861. {
  862. (yyval.command) = make_coproc_command ("COPROC", clean_simple_command ((yyvsp[(2) - (2)].command)));
  863. (yyval.command)->flags |= CMD_WANT_SUBSHELL|CMD_COPROC_SUBSHELL;
  864. @@ -2995,117 +2995,117 @@ yyreduce:
  865. break;
  866. case 107:
  867. -#line 999 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  868. +#line 999 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  869. { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (COMMAND *)NULL); }
  870. break;
  871. case 108:
  872. -#line 1001 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  873. +#line 1001 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  874. { (yyval.command) = make_if_command ((yyvsp[(2) - (7)].command), (yyvsp[(4) - (7)].command), (yyvsp[(6) - (7)].command)); }
  875. break;
  876. case 109:
  877. -#line 1003 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  878. +#line 1003 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  879. { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(5) - (6)].command)); }
  880. break;
  881. case 110:
  882. -#line 1008 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  883. +#line 1008 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  884. { (yyval.command) = make_group_command ((yyvsp[(2) - (3)].command)); }
  885. break;
  886. case 111:
  887. -#line 1012 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  888. +#line 1012 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  889. { (yyval.command) = make_arith_command ((yyvsp[(1) - (1)].word_list)); }
  890. break;
  891. case 112:
  892. -#line 1016 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  893. +#line 1016 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  894. { (yyval.command) = (yyvsp[(2) - (3)].command); }
  895. break;
  896. case 113:
  897. -#line 1020 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  898. +#line 1020 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  899. { (yyval.command) = make_if_command ((yyvsp[(2) - (4)].command), (yyvsp[(4) - (4)].command), (COMMAND *)NULL); }
  900. break;
  901. case 114:
  902. -#line 1022 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  903. +#line 1022 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  904. { (yyval.command) = make_if_command ((yyvsp[(2) - (6)].command), (yyvsp[(4) - (6)].command), (yyvsp[(6) - (6)].command)); }
  905. break;
  906. case 115:
  907. -#line 1024 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  908. +#line 1024 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  909. { (yyval.command) = make_if_command ((yyvsp[(2) - (5)].command), (yyvsp[(4) - (5)].command), (yyvsp[(5) - (5)].command)); }
  910. break;
  911. case 117:
  912. -#line 1029 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  913. +#line 1029 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  914. { (yyvsp[(2) - (2)].pattern)->next = (yyvsp[(1) - (2)].pattern); (yyval.pattern) = (yyvsp[(2) - (2)].pattern); }
  915. break;
  916. case 118:
  917. -#line 1033 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  918. +#line 1033 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  919. { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (yyvsp[(4) - (4)].command)); }
  920. break;
  921. case 119:
  922. -#line 1035 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  923. +#line 1035 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  924. { (yyval.pattern) = make_pattern_list ((yyvsp[(2) - (4)].word_list), (COMMAND *)NULL); }
  925. break;
  926. case 120:
  927. -#line 1037 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  928. +#line 1037 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  929. { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (yyvsp[(5) - (5)].command)); }
  930. break;
  931. case 121:
  932. -#line 1039 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  933. +#line 1039 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  934. { (yyval.pattern) = make_pattern_list ((yyvsp[(3) - (5)].word_list), (COMMAND *)NULL); }
  935. break;
  936. case 122:
  937. -#line 1043 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  938. +#line 1043 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  939. { (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
  940. break;
  941. case 123:
  942. -#line 1045 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  943. +#line 1045 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  944. { (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
  945. break;
  946. case 124:
  947. -#line 1047 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  948. +#line 1047 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  949. { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
  950. break;
  951. case 125:
  952. -#line 1049 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  953. +#line 1049 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  954. { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_FALLTHROUGH; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
  955. break;
  956. case 126:
  957. -#line 1051 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  958. +#line 1051 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  959. { (yyvsp[(1) - (2)].pattern)->flags |= CASEPAT_TESTNEXT; (yyval.pattern) = (yyvsp[(1) - (2)].pattern); }
  960. break;
  961. case 127:
  962. -#line 1053 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  963. +#line 1053 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  964. { (yyvsp[(2) - (3)].pattern)->flags |= CASEPAT_TESTNEXT; (yyvsp[(2) - (3)].pattern)->next = (yyvsp[(1) - (3)].pattern); (yyval.pattern) = (yyvsp[(2) - (3)].pattern); }
  965. break;
  966. case 128:
  967. -#line 1057 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  968. +#line 1057 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  969. { (yyval.word_list) = make_word_list ((yyvsp[(1) - (1)].word), (WORD_LIST *)NULL); }
  970. break;
  971. case 129:
  972. -#line 1059 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  973. +#line 1059 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  974. { (yyval.word_list) = make_word_list ((yyvsp[(3) - (3)].word), (yyvsp[(1) - (3)].word_list)); }
  975. break;
  976. case 130:
  977. -#line 1068 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  978. +#line 1068 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  979. {
  980. (yyval.command) = (yyvsp[(2) - (2)].command);
  981. if (need_here_doc)
  982. @@ -3114,14 +3114,14 @@ yyreduce:
  983. break;
  984. case 132:
  985. -#line 1077 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  986. +#line 1077 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  987. {
  988. (yyval.command) = (yyvsp[(2) - (2)].command);
  989. }
  990. break;
  991. case 134:
  992. -#line 1084 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  993. +#line 1084 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  994. {
  995. if ((yyvsp[(1) - (3)].command)->type == cm_connection)
  996. (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (COMMAND *)NULL, '&');
  997. @@ -3131,17 +3131,17 @@ yyreduce:
  998. break;
  999. case 136:
  1000. -#line 1095 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1001. +#line 1095 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1002. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
  1003. break;
  1004. case 137:
  1005. -#line 1097 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1006. +#line 1097 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1007. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
  1008. break;
  1009. case 138:
  1010. -#line 1099 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1011. +#line 1099 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1012. {
  1013. if ((yyvsp[(1) - (4)].command)->type == cm_connection)
  1014. (yyval.command) = connect_async_list ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '&');
  1015. @@ -3151,37 +3151,37 @@ yyreduce:
  1016. break;
  1017. case 139:
  1018. -#line 1106 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1019. +#line 1106 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1020. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
  1021. break;
  1022. case 140:
  1023. -#line 1108 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1024. +#line 1108 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1025. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), ';'); }
  1026. break;
  1027. case 141:
  1028. -#line 1110 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1029. +#line 1110 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1030. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  1031. break;
  1032. case 144:
  1033. -#line 1118 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1034. +#line 1118 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1035. { (yyval.number) = '\n'; }
  1036. break;
  1037. case 145:
  1038. -#line 1120 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1039. +#line 1120 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1040. { (yyval.number) = ';'; }
  1041. break;
  1042. case 146:
  1043. -#line 1122 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1044. +#line 1122 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1045. { (yyval.number) = yacc_EOF; }
  1046. break;
  1047. case 149:
  1048. -#line 1136 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1049. +#line 1136 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1050. {
  1051. (yyval.command) = (yyvsp[(1) - (1)].command);
  1052. if (need_here_doc)
  1053. @@ -3197,7 +3197,7 @@ yyreduce:
  1054. break;
  1055. case 150:
  1056. -#line 1149 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1057. +#line 1149 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1058. {
  1059. if ((yyvsp[(1) - (2)].command)->type == cm_connection)
  1060. (yyval.command) = connect_async_list ((yyvsp[(1) - (2)].command), (COMMAND *)NULL, '&');
  1061. @@ -3216,7 +3216,7 @@ yyreduce:
  1062. break;
  1063. case 151:
  1064. -#line 1165 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1065. +#line 1165 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1066. {
  1067. (yyval.command) = (yyvsp[(1) - (2)].command);
  1068. if (need_here_doc)
  1069. @@ -3232,17 +3232,17 @@ yyreduce:
  1070. break;
  1071. case 152:
  1072. -#line 1180 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1073. +#line 1180 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1074. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), AND_AND); }
  1075. break;
  1076. case 153:
  1077. -#line 1182 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1078. +#line 1182 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1079. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), OR_OR); }
  1080. break;
  1081. case 154:
  1082. -#line 1184 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1083. +#line 1184 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1084. {
  1085. if ((yyvsp[(1) - (3)].command)->type == cm_connection)
  1086. (yyval.command) = connect_async_list ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), '&');
  1087. @@ -3252,22 +3252,22 @@ yyreduce:
  1088. break;
  1089. case 155:
  1090. -#line 1191 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1091. +#line 1191 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1092. { (yyval.command) = command_connect ((yyvsp[(1) - (3)].command), (yyvsp[(3) - (3)].command), ';'); }
  1093. break;
  1094. case 156:
  1095. -#line 1194 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1096. +#line 1194 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1097. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  1098. break;
  1099. case 157:
  1100. -#line 1198 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1101. +#line 1198 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1102. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  1103. break;
  1104. case 158:
  1105. -#line 1200 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1106. +#line 1200 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1107. {
  1108. if ((yyvsp[(2) - (2)].command))
  1109. (yyvsp[(2) - (2)].command)->flags ^= CMD_INVERT_RETURN; /* toggle */
  1110. @@ -3276,7 +3276,7 @@ yyreduce:
  1111. break;
  1112. case 159:
  1113. -#line 1206 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1114. +#line 1206 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1115. {
  1116. if ((yyvsp[(2) - (2)].command))
  1117. (yyvsp[(2) - (2)].command)->flags |= (yyvsp[(1) - (2)].number);
  1118. @@ -3285,7 +3285,7 @@ yyreduce:
  1119. break;
  1120. case 160:
  1121. -#line 1212 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1122. +#line 1212 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1123. {
  1124. ELEMENT x;
  1125. @@ -3305,7 +3305,7 @@ yyreduce:
  1126. break;
  1127. case 161:
  1128. -#line 1229 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1129. +#line 1229 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1130. {
  1131. ELEMENT x;
  1132. @@ -3326,12 +3326,12 @@ yyreduce:
  1133. break;
  1134. case 162:
  1135. -#line 1249 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1136. +#line 1249 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1137. { (yyval.command) = command_connect ((yyvsp[(1) - (4)].command), (yyvsp[(4) - (4)].command), '|'); }
  1138. break;
  1139. case 163:
  1140. -#line 1251 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1141. +#line 1251 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1142. {
  1143. /* Make cmd1 |& cmd2 equivalent to cmd1 2>&1 | cmd2 */
  1144. COMMAND *tc;
  1145. @@ -3357,22 +3357,22 @@ yyreduce:
  1146. break;
  1147. case 164:
  1148. -#line 1274 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1149. +#line 1274 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1150. { (yyval.command) = (yyvsp[(1) - (1)].command); }
  1151. break;
  1152. case 165:
  1153. -#line 1278 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1154. +#line 1278 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1155. { (yyval.number) = CMD_TIME_PIPELINE; }
  1156. break;
  1157. case 166:
  1158. -#line 1280 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1159. +#line 1280 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1160. { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
  1161. break;
  1162. case 167:
  1163. -#line 1282 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1164. +#line 1282 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1165. { (yyval.number) = CMD_TIME_PIPELINE|CMD_TIME_POSIX; }
  1166. break;
  1167. @@ -3592,7 +3592,7 @@ yyreturn:
  1168. }
  1169. -#line 1284 "/usr/src/local/chet/src/bash/bash-4.3.28/parse.y"
  1170. +#line 1284 "/usr/src/local/bash/bash-4.3-patched/parse.y"
  1171. /* Initial size to allocate for tokens, and the
  1172. @@ -4850,6 +4850,16 @@ shell_ungetc (c)
  1173. eol_ungetc_lookahead = c;
  1174. }
  1175. +char *
  1176. +parser_remaining_input ()
  1177. +{
  1178. + if (shell_input_line == 0)
  1179. + return 0;
  1180. + if (shell_input_line_index < 0 || shell_input_line_index >= shell_input_line_len)
  1181. + return '\0'; /* XXX */
  1182. + return (shell_input_line + shell_input_line_index);
  1183. +}
  1184. +
  1185. #ifdef INCLUDE_UNUSED
  1186. /* Back the input pointer up by one, effectively `ungetting' a character. */
  1187. static void
  1188. @@ -6339,8 +6349,8 @@ xparse_dolparen (base, string, indp, fla
  1189. reset_parser ();
  1190. /* reset_parser clears shell_input_line and associated variables */
  1191. restore_input_line_state (&ls);
  1192. - if (interactive)
  1193. - token_to_read = 0;
  1194. +
  1195. + token_to_read = 0;
  1196. /* Need to find how many characters parse_and_execute consumed, update
  1197. *indp, if flags != 0, copy the portion of the string parsed into RET
  1198. --- a/patchlevel.h
  1199. +++ b/patchlevel.h
  1200. @@ -25,6 +25,6 @@
  1201. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  1202. looks for to find the patch level (for the sccs version string). */
  1203. -#define PATCHLEVEL 29
  1204. +#define PATCHLEVEL 30
  1205. #endif /* _PATCHLEVEL_H_ */