[m-dev.] Re: trivial diff: fix cut-and-paste bug in init_grade_options.sh-subr

Fergus Henderson fjh at cs.mu.OZ.AU
Mon Feb 12 01:53:25 AEDT 2001


On 12-Feb-2001, Fergus Henderson <fjh at cs.mu.oz.au> wrote:
> On 11-Feb-2001, Fergus Henderson <fjh at cs.mu.oz.au> wrote:
> > 
> > scripts/init_grade_options.sh-subr:
> > 	Fix a cut-and-paste error: change the second "0)" case to "*)".
> > 	This broke the default grade setting.
> 
> And another one...
> 
> scripts/parse_grade_options.sh-subr:
> 	Fix another cut-and-paste error: change the second "case 0)" to
> 	"case *)".

Both of those fixes were correct, but they exposed some additional bugs.
So here's some more fixes (again for both main and release branches).

----------

Estimated hours taken: 0.5

scripts/init_grade_options.sh-subr:
scripts/parse_grade_options.sh-subr:
	Fix some more bugs in the handling of `DEFAULT_GRADE' and the
	`-s<grade>' option.  Obviously this code had never been exercised.

Workspace: /mnt/roy/fjh/traveller/mercury
Index: scripts/init_grade_options.sh-subr
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/init_grade_options.sh-subr,v
retrieving revision 1.15
diff -u -d -r1.15 init_grade_options.sh-subr
--- scripts/init_grade_options.sh-subr	2001/02/11 12:47:40	1.15
+++ scripts/init_grade_options.sh-subr	2001/02/11 14:46:28
@@ -69,8 +69,8 @@
 require_tracing=false
 
 case $# in
-	0) set - "--grade $DEFAULT_GRADE" ;;
-	*) set - "--grade $DEFAULT_GRADE" "$@" ;;
+	0) set - --grade "$DEFAULT_GRADE" ;;
+	*) set - --grade "$DEFAULT_GRADE" "$@" ;;
 esac
 
 #---------------------------------------------------------------------------#
Index: scripts/parse_grade_options.sh-subr
===================================================================
RCS file: /home/mercury1/repository/mercury/scripts/parse_grade_options.sh-subr,v
retrieving revision 1.20
diff -u -d -r1.20 parse_grade_options.sh-subr
--- scripts/parse_grade_options.sh-subr	2001/02/11 14:20:44	1.20
+++ scripts/parse_grade_options.sh-subr	2001/02/11 14:46:15
@@ -395,9 +395,10 @@
 	-s*)
 		grade="` expr $1 : '-s\(.*\)' `"
 		# just insert it as `--grade $grade' and then reparse it
+		shift
 		case $# in
-			0) set - "x --grade $grade" ;;
-			*) set - "x --grade $grade" "$@" ;;
+			0) set - x --grade "$grade" ;;
+			*) set - x --grade "$grade" "$@" ;;
 		esac
 		;;
 
-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list