home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Gold Fish 2
/
goldfish_vol2_cd1.bin
/
files
/
dev
/
c
/
yacc
/
src
/
main.c.diff
< prev
next >
Wrap
Text File
|
1993-07-11
|
2KB
|
93 lines
*** main.c.orig Fri Jul 09 15:13:40 1993
--- main.c Sat Jul 10 18:32:18 1993
***************
*** 230,241 ****
--- 230,250 ----
char *tmpdir;
tmpdir = getenv("TMPDIR");
+ #ifndef AMIGA
if (tmpdir == 0) tmpdir = "/tmp";
+ else
+ if (tmpdir == 0) tmpdir = "T:";
+ #endif
len = strlen(tmpdir);
i = len + 13;
+ #ifndef AMIGA
if (len && tmpdir[len-1] != '/')
++i;
+ #else
+ if (len && tmpdir[len-1] != '/' && tmpdir[len-1] != ':')
+ ++i;
+ #endif
action_file_name = MALLOC(i);
if (action_file_name == 0) no_space();
***************
*** 248,253 ****
--- 257,263 ----
strcpy(text_file_name, tmpdir);
strcpy(union_file_name, tmpdir);
+ #ifndef AMIGA
if (len && tmpdir[len - 1] != '/')
{
action_file_name[len] = '/';
***************
*** 255,260 ****
--- 265,279 ----
union_file_name[len] = '/';
++len;
}
+ #else
+ if (len && tmpdir[len - 1] != '/' && tmpdir[len - 1] != ':')
+ {
+ action_file_name[len] = '/';
+ text_file_name[len] = '/';
+ union_file_name[len] = '/';
+ ++len;
+ }
+ #endif
strcpy(action_file_name + len, temp_form);
strcpy(text_file_name + len, temp_form);
***************
*** 375,377 ****
--- 394,428 ----
done(0);
/*NOTREACHED*/
}
+
+
+
+ #ifdef AMIGA
+ extern char *strchr();
+ #define getpid(x) ((int)FindTask(NULL))
+
+ const char amiga_version_string[] = "\0$VER: Berkeley yacc 1.9";
+
+
+ char *
+ mktemp(name)
+ char *name;
+ {
+ static int cnt;
+ char *p, *q;
+ int len;
+ char buf[10];
+
+ p = strchr(name, 'X');
+ if( p ) {
+ for( q = p+1; *q == 'X'; q++ )
+ ;
+ len = q - p;
+ sprintf(buf, "%2x.%6x", cnt, getpid());
+ strncpy(p, buf, len);
+ cnt++;
+ }
+ return name;
+ }
+ #endif
+