1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-28 01:06:17 +00:00

Fix a segmentation fault on the Alpha.

As shown with this script :

	m(){ if [ $1 -eq 1 ];then echo $2 $3;else m $(($1-1)) $2 $4 $3;m 1 $2 \
	$3 $4;m $(($1-1)) $4 $3 $2;fi;};if [ $# -eq 3 ]&&[ $3 -ge 1 -a $1 -le \
	3 -a $1 -ge 1 -a $2 -le 3 -a $2 -ge 1 -a $1 -ne $2 ];then m $3 $1 $2 $\
	((6-$1-$2)); else echo Usage: /bin/sh hanoi.sh from to num; fi #by rhb

$ bash2 hanoi.sh 1 2 3
1 2
1 3
Segmentation fault (core dumped)

Submitted by:	Christian Weisgerber <naddy@mips.inka.de>
This commit is contained in:
David E. O'Brien 2001-03-17 01:24:32 +00:00
parent cac480016d
commit 7f8208f177
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=39943
3 changed files with 60 additions and 0 deletions

View File

@ -0,0 +1,20 @@
--- execute_cmd.c.shellfunc Tue Jan 25 11:29:11 2000
+++ execute_cmd.c Tue May 2 21:26:24 2000
@@ -2762,6 +2762,8 @@
if (tc && (flags & CMD_IGNORE_RETURN))
tc->flags |= CMD_IGNORE_RETURN;
+ old_shell_function = this_shell_function;
+
if (subshell == 0)
{
begin_unwind_frame ("function_calling");
@@ -2843,6 +2845,8 @@
if (variable_context == 0 || this_shell_function == 0)
make_funcname_visible (0);
+
+ this_shell_function = old_shell_function;
return (result);
}

View File

@ -0,0 +1,20 @@
--- execute_cmd.c.shellfunc Tue Jan 25 11:29:11 2000
+++ execute_cmd.c Tue May 2 21:26:24 2000
@@ -2762,6 +2762,8 @@
if (tc && (flags & CMD_IGNORE_RETURN))
tc->flags |= CMD_IGNORE_RETURN;
+ old_shell_function = this_shell_function;
+
if (subshell == 0)
{
begin_unwind_frame ("function_calling");
@@ -2843,6 +2845,8 @@
if (variable_context == 0 || this_shell_function == 0)
make_funcname_visible (0);
+
+ this_shell_function = old_shell_function;
return (result);
}

View File

@ -0,0 +1,20 @@
--- execute_cmd.c.shellfunc Tue Jan 25 11:29:11 2000
+++ execute_cmd.c Tue May 2 21:26:24 2000
@@ -2762,6 +2762,8 @@
if (tc && (flags & CMD_IGNORE_RETURN))
tc->flags |= CMD_IGNORE_RETURN;
+ old_shell_function = this_shell_function;
+
if (subshell == 0)
{
begin_unwind_frame ("function_calling");
@@ -2843,6 +2845,8 @@
if (variable_context == 0 || this_shell_function == 0)
make_funcname_visible (0);
+
+ this_shell_function = old_shell_function;
return (result);
}