patch for Labels 1.1
Joe S. Chen
joec at alheka.usc.edu
Sat Feb 20 10:57:25 AEST 1988
The getcwd() function in Labels 1.1 did not exist in standard BSD Unix
systems. Below is a patch for main.c.
Joe Chen
---------------------------------------------------------------------------
Phones at work: (213) 743-5363, (213) 743-5935; at home: (818) 571-5304
University Computing Services, University of Southern California
UUCP: {sdcrdcf, uscvax}!oberon!serl!joec
ARPA: joec%serl at oberon.usc.edu, joec%alheka at oberon.usc.edu
---------------------------------------------------------------------------
-----CUT HERE----------CUT HERE----------CUT HERE----------CUT HERE-----
*** main.c.old Fri Feb 19 16:26:41 1988
--- main.c Thu Feb 11 15:49:31 1988
***************
*** 95,101 ****
#define T 1
#define F 0
! extern char *malloc(), *getcwd();
extern char *rev_date; /* supplied by Makefile */
extern FILE *yyin; /* from lex */
--- 95,101 ----
#define T 1
#define F 0
! extern char *malloc(), *getwd();
extern char *rev_date; /* supplied by Makefile */
extern FILE *yyin; /* from lex */
***************
*** 161,167 ****
DIR *dirp; /* directory pointer */
struct direct *dp; /* pointer to a directory record */
char *ext_ptr; /* extension pointer */
! char tmp[MAXNAMLEN+1], ch, *cur_dir;
int header = F;
FILE *f;
--- 161,167 ----
DIR *dirp; /* directory pointer */
struct direct *dp; /* pointer to a directory record */
char *ext_ptr; /* extension pointer */
! char tmp[MAXNAMLEN+1], ch, dirbuf[255], *cur_dir;
int header = F;
FILE *f;
***************
*** 170,176 ****
return;
}
! if ((cur_dir = getcwd(NULL, 100)) == (char *)NULL) {
fprintf(stderr,"FATAL ERROR: Insufficient Memory\n");
exit(-1);
}
--- 170,176 ----
return;
}
! if ((cur_dir = getwd(dirbuf)) == (char *)NULL) {
fprintf(stderr,"FATAL ERROR: Insufficient Memory\n");
exit(-1);
}
More information about the Comp.sources.bugs
mailing list