diff options
| author | Pixel <Pixel> | 2001-05-02 00:18:08 +0000 | 
|---|---|---|
| committer | Pixel <Pixel> | 2001-05-02 00:18:08 +0000 | 
| commit | 064a422245f2ef4e881f50350dbbf686283ae310 (patch) | |
| tree | d6043c3fd05a3f0842ac67cf6f72fa82ddb3e347 /lib/exceptions.c | |
| parent | 7dd4d0c7b11f8341fc4f7c357273c4d14f6bb237 (diff) | |
Pouet
Diffstat (limited to 'lib/exceptions.c')
| -rw-r--r-- | lib/exceptions.c | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/lib/exceptions.c b/lib/exceptions.c index 72842a4..89d15c4 100644 --- a/lib/exceptions.c +++ b/lib/exceptions.c @@ -14,6 +14,7 @@  #endif  #include "exceptions.h"  #include "pile.h" +#include "terminal.h"  char *contexts[128];  int clevel = 0; @@ -81,6 +82,10 @@ void exception(int level, char *msg)  	int i;  	switch (level) {  	case 1: +		fprintf(stderr, "Error detected. Showing context.\n"); +		for (i = 0; i < clevel; i++) { +			fprintf(stderr, " (%i) - %s\n", i, contexts[i]); +		}  		fprintf(stderr, "  Error description: %s\n", msg);  		flush_pile();  		global_error = 1; @@ -91,6 +96,7 @@ void exception(int level, char *msg)  			fprintf(stderr, " (%i) - %s\n", i, contexts[i]);  		}  		fprintf(stderr, "  Error description: %s\n", msg); +		clearterm();  		exit(1);  		break;  	}	 | 
