From: pv AT cs DOT montana DOT edu (Paul Peavyhouse) Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP inconsistencies? Date: Thu, 13 Mar 97 13:44:53 GMT Organization: Montana State University Lines: 51 Message-ID: <5g9p1b$fac@netra.montana.edu> References: <5g7p5i$abl AT netra DOT montana DOT edu> <01bc2fa7$9893d3c0$8c081ecb AT sly> NNTP-Posting-Host: esus.cs.montana.edu To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp In article <01bc2fa7$9893d3c0$8c081ecb AT sly>, "Sly" wrote: >Paul Peavyhouse wrote in article >> char *str; >> if ( (str = getenv("DEM_PATH")) == NULL) { >> printf("\"DEM_PATH\" environment variable not set\n"); >> exit(1); >> } >> > >That printf statement...is it a valid string in there? Shouldn't it be... >printf("DEMPATH environment variable not set\n"); >Or are you trying to put backslashes around it? Like this... >printf("\\DEMPATH\\ environment variable not set\n"); >Try these. They should work. No, my printf statement IS perfectly legal (all I'm doing is have it print quotes around the DEM_PATH...don't ask why, it just works). To prove my point I have completely commented it out, and I still have the same error. Here is a modified code: DATAFILE *terra; int main (int c, char **v) { terra = load_datafile("terra.dat"); char *str; } The funny thing is that if I write it as: DATAFILE *terra; int main (int c, char **v) { char *str; terra = load_datafile("terra.dat"); } ...IT WORKS?!?!?! I can live with writing it this way, but I want to know why the compiler pukes when I write it the other way. Can any help me here? I'd appreciate it! PV ______________________________________________________________________________ Paul Peavyhouse http://www.cs.montana.edu/~pv email: pv AT cs DOT montana DOT edu ______________________________________________________________________________