OSDN Git Service

Fix: invalid script can be sent
authornaru <bottle@mikage.to>
Sat, 20 Sep 2003 13:02:28 +0000 (13:02 +0000)
committernaru <bottle@mikage.to>
Sat, 20 Sep 2003 13:02:28 +0000 (13:02 +0000)
bottleclient/MainForm.pas

index 31935b1..00c026a 100755 (executable)
@@ -710,14 +710,15 @@ begin
   end;
 
   YenETrans;
-  Talk := GetScriptText;
+  Talk := StringReplace(GetScriptText, #13#10, '', [rfReplaceAll]);
   Err := DoTrans(Talk, [toWarnMessySurface, toWarnCheck]);
   if Err <> '' then begin
     MessageDlg(Err, mtWarning, [mbOk], 0);
     Exit;
   end;
 
-  if Pref.NeedConfirmBeforeSend and FScriptModified then begin
+  if Pref.NeedConfirmBeforeSend and FScriptModified then
+  begin
     MessageDlg('\91\97\90M\91O\82É\83\8d\81[\83J\83\8b\8am\94F\82µ\82Ä\82­\82¾\82³\82¢\81B', mtError, [mbOk], 0);
     Exit;
   end;
@@ -726,11 +727,10 @@ begin
     if not SendConfirmDialog(FNowChannel, cbxTargetGhost.Text) then Exit;
   end;
 
-  Command := nil;
   Ghost := '';
   if cbxTargetGhost.ItemIndex > 0 then Ghost := cbxTargetGhost.Text;
+  Command := TStringList.Create;
   try
-    Command := TStringList.Create;
     with Command do begin
       Add('Command: sendBroadcast');
       Add('Channel: ' + FNowChannel);