PERFORCE change 13123 for review

[email protected] (Chris Nandor) Mon, 19 Nov 2001 23:34:34 -0500
Newsgroups perl.perl5.changes.mac
Message-ID <p05100303b81f8d9461ba@[10.0.1.177]>
Change 13123 by pudge@pudge-mobile on 2001/11/20 03:26:32

	Fix ctrl-D handling (bug #471436), more exit fixes (bug #467732),
	remove obsolete function (bug #465225)

Affected files ...

.... //depot/maint-5.6/macperl/macos/macperl/MPConsole.cp#4 edit
.... //depot/maint-5.6/macperl/macos/macperl/MPMain.c#3 edit
.... //depot/maint-5.6/macperl/macos/macperl/MPScript.c#4 edit

Differences ...

==== //depot/maint-5.6/macperl/macos/macperl/MPConsole.cp#4 (text) ====
Index: perl/macos/macperl/MPConsole.cp
--- perl/macos/macperl/MPConsole.cp.~1~	Mon Nov 19 20:30:06 2001
+++ perl/macos/macperl/MPConsole.cp	Mon Nov 19 20:30:06 2001
@@ -5,6 +5,9 @@
 Language	:	MPW C/C++
 
 $Log: MPConsole.cp,v $
+Revision 1.7  2001/11/09 06:48:57  neeri
+Fix Ctrl-D handling (MacPerl Bug #471436)
+
 Revision 1.6  2001/11/02 22:36:17  pudge
 Sync with perforce
 
@@ -148,6 +151,7 @@
 		
 		doc->u.cons.fence = (*doc->theText)->teLength;
 		sock->eof			= true;
+		gGotEof				= nil;
 	} else 
 		while (chr-- > end)
 			if (*chr == '\n') {

==== //depot/maint-5.6/macperl/macos/macperl/MPMain.c#3 (text) ====
Index: perl/macos/macperl/MPMain.c
--- perl/macos/macperl/MPMain.c.~1~	Mon Nov 19 20:30:06 2001
+++ perl/macos/macperl/MPMain.c	Mon Nov 19 20:30:06 2001
@@ -9,6 +9,9 @@
 Language	:	MPW C
 
 $Log: MPMain.c,v $
+Revision 1.5  2001/11/08 06:01:40  neeri
+Change ExitToShell() to exit(0) to fix nasty GUSI crash (MacPerl Bug #467732)
+
 Revision 1.4  2001/10/11 05:19:31  neeri
 Fix exit code (MacPerl bug #422129)
 
@@ -1177,7 +1180,7 @@
 			Perl_die("Out of memory ! Aborting script for your own good...\n");
 		else							/* We aborted it, now buy a new goat */
 			if (!(gSacrificialGoat = NewHandle(SACRIFICE)))
-				ExitToShell();		/* Save our sorry ass. Shouldn't happen */
+				exit(0);		/* Save our sorry ass. Shouldn't happen */
 	
 	now = LMGetTicks();
 	if (spinning = busy) {
@@ -1443,7 +1446,7 @@
 	(void) SetScriptManagerVariable(smFontForce, 0);
 	
 	if (gQuitting)
-		ExitToShell();
+		exit(0);
 		
 	InitPerlEnviron();
 	
@@ -1459,5 +1462,5 @@
 		CloseTSMAwareApplication();
 	SetScriptManagerVariable(smFontForce, gSavedFontForce);
 	
-	ExitToShell();
+	exit(0);
 }

==== //depot/maint-5.6/macperl/macos/macperl/MPScript.c#4 (text) ====
Index: perl/macos/macperl/MPScript.c
--- perl/macos/macperl/MPScript.c.~1~	Mon Nov 19 20:30:06 2001
+++ perl/macos/macperl/MPScript.c	Mon Nov 19 20:30:06 2001
@@ -5,6 +5,9 @@
 Language	:	MPW C
 
 $Log: MPScript.c,v $
+Revision 1.7  2001/11/13 04:06:35  pudge
+Remov unused AddErrorDescription
+
 Revision 1.6  2001/09/26 21:51:15  pudge
 Sync with perforce maint-5.6/macperl/macos/macperl
 
@@ -886,49 +889,6 @@
 	}			
 }
 
-void AddErrorDescription(AppleEvent * reply)
-{
-#if 0
-	OSErr			err;
-	AliasHandle	file;
-	AEStream		aes;
-	AEDesc      newDesc;
-	short			line;
-
-	if (gFirstErrorLine == -1 || reply->descriptorType == typeNull) 
-		return;
-	
-	line = (short) gFirstErrorLine;
-	
-	if (NewAlias(nil, &gFirstErrorFile, &file)) 
-		return;
-		
-	HLock((Handle) file);
-	err = AEPutParamPtr(
-				reply, kOSAErrorOffendingObject, 
-				typeAlias, (Ptr) *file, GetHandleSize((Handle) file));
-	DisposeHandle((Handle) file);
-		
-	if (err)
-		return;
-		
-	if (AEStream_Open(&aes))
-		return;
-		
-	if (AEStream_OpenRecord(&aes, typeAERecord)
-	||	 AEStream_WriteKeyDesc(&aes, keyOSASourceStart, typeShortInteger, (Ptr) &line, 2)
-	||	 AEStream_WriteKeyDesc(&aes, keyOSASourceEnd, typeShortInteger, (Ptr) &line, 2)
-	||	 AEStream_CloseRecord(&aes)
-	||	 AEStream_Close(&aes, &newDesc)
-	) {
-		AEStream_Close(&aes, nil);
-	} else {
-		AEPutParamDesc(reply, kOSAErrorRange, &newDesc)	;
-		AEDisposeDesc(&newDesc);
-	}
-#endif
-}
-
 pascal OSErr DoScript(const AppleEvent *event, AppleEvent *reply, long refCon)
 {
 #if !defined(powerc) && !defined(__powerc)
@@ -1001,8 +961,6 @@
 			DisposeHandle(gMacPerl_Reply);
 			gMacPerl_Reply = nil;
 		}
-		
-		AddErrorDescription(reply);
 	}
 	
 	return ranOK ? 0 : (gMacPerl_SyntaxError ? 1 : 2);
End of Patch.