|
@@ -20,6 +20,7 @@ void load_and_exec(char *filename);
|
|
|
void load_qcode_dir();
|
|
|
|
|
|
void stack_and_quit() {
|
|
|
+ puts("SIGSEGV");
|
|
|
stack_trace();
|
|
|
exit(1);
|
|
|
}
|
|
@@ -32,7 +33,7 @@ int main(int argc, char **argv) {
|
|
|
|
|
|
int i = 0;
|
|
|
|
|
|
- signal(SIGSEGV, stack_and_quit);
|
|
|
+ //signal(SIGSEGV, stack_and_quit);
|
|
|
|
|
|
/// SETUP ARGV
|
|
|
reg_acc = ATOM_NUL;
|
|
@@ -82,10 +83,19 @@ void load_qcode_dir(char *p)
|
|
|
char buf2[256] = { 0 };
|
|
|
DIR *dir;
|
|
|
struct dirent *ent;
|
|
|
+
|
|
|
+ if(!getenv("TAROTPATH")) {
|
|
|
+ puts("Please set TAROTPATH.");
|
|
|
+ exit(2);
|
|
|
+ }
|
|
|
|
|
|
strcat(buf, getenv("TAROTPATH"));
|
|
|
strcat(buf, p);
|
|
|
dir = opendir(buf);
|
|
|
+ if(!dir) {
|
|
|
+ printf("Could not open qcode directory <%s%s>. Check TAROTPATH.\n", getenv("TAROTPATH"), p);
|
|
|
+ exit(2);
|
|
|
+ }
|
|
|
while((ent = readdir(dir))) {
|
|
|
if(ent->d_type == DT_REG) {
|
|
|
strcpy(buf2, buf);
|