瀏覽代碼

* cmdstr is ansistring now. Running ppc386 "" could cause access of string[1] while length(string)=0

git-svn-id: trunk@19394 -
marco 14 年之前
父節點
當前提交
cf7b43948a
共有 1 個文件被更改,包括 19 次插入18 次删除
  1. 19 18
      compiler/options.pas

+ 19 - 18
compiler/options.pas

@@ -2089,24 +2089,25 @@ begin
    begin
      inc(paramindex);
      opts:=objpas.paramstr(paramindex);
-     case opts[1] of
-       '@' :
-         if not firstpass then
-         begin
-           Delete(opts,1,1);
-           Message1(option_reading_further_from,opts);
-           interpret_file(opts);
-         end;
-       '!' :
-         if not firstpass then
-         begin
-           Delete(opts,1,1);
-           Message1(option_reading_further_from,'(env) '+opts);
-           interpret_envvar(opts);
-         end;
-       else
-         interpret_option(opts,true);
-     end;
+     if length(opts)>0 then
+       case opts[1] of
+         '@' :
+           if not firstpass then
+           begin
+             Delete(opts,1,1);
+             Message1(option_reading_further_from,opts);
+             interpret_file(opts);
+           end;
+         '!' :
+           if not firstpass then
+           begin
+             Delete(opts,1,1);
+             Message1(option_reading_further_from,'(env) '+opts);
+             interpret_envvar(opts);
+           end;
+         else
+           interpret_option(opts,true);
+       end;
    end;
 end;