浏览代码

Fixed error propagation

git-svn-id: https://svn-dept.inf.ethz.ch/svn/lecturers/a2/trunk@8730 8c9fc860-2736-0410-a75d-ab315db34111
negelef 6 年之前
父节点
当前提交
564f51267c
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      source/XYModem.Mod

+ 4 - 2
source/XYModem.Mod

@@ -678,7 +678,7 @@ BEGIN
 			parity := Serials.ParSpace
 			parity := Serials.ParSpace
 		ELSIF name # "no" THEN
 		ELSIF name # "no" THEN
 			context.error.String("wrong parity"); context.error.Ln();
 			context.error.String("wrong parity"); context.error.Ln();
-			RETURN FALSE
+			context.result := Commands.CommandError; RETURN FALSE;
 		END;
 		END;
 		context.arg.SkipWhitespace; context.arg.String(name);
 		context.arg.SkipWhitespace; context.arg.String(name);
 		IF name = "1.5" THEN
 		IF name = "1.5" THEN
@@ -687,7 +687,7 @@ BEGIN
 			stop := Serials.Stop2
 			stop := Serials.Stop2
 		ELSIF name # "1" THEN
 		ELSIF name # "1" THEN
 			context.error.String("wrong stop bits"); context.error.Ln();
 			context.error.String("wrong stop bits"); context.error.Ln();
-			RETURN FALSE
+			context.result := Commands.CommandError; RETURN FALSE;
 		END;
 		END;
 		context.arg.SkipWhitespace; context.arg.String(name);
 		context.arg.SkipWhitespace; context.arg.String(name);
 	END;
 	END;
@@ -716,6 +716,7 @@ BEGIN
 
 
 		IF error # "" THEN
 		IF error # "" THEN
 			context.error.String("  "); context.error.String(error);
 			context.error.String("  "); context.error.String(error);
+			context.result := Commands.CommandError;
 		ELSE
 		ELSE
 			context.out.String("  done");
 			context.out.String("  done");
 		END;
 		END;
@@ -772,6 +773,7 @@ BEGIN
 
 
 		IF error # "" THEN
 		IF error # "" THEN
 			context.error.String("  "); context.error.String(error);
 			context.error.String("  "); context.error.String(error);
+			context.result := Commands.CommandError;
 		ELSE
 		ELSE
 			Files.Register(F);
 			Files.Register(F);
 			IF awaitF THEN
 			IF awaitF THEN