From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jody Subject: #include Code in Dev86 to debug Date: Mon, 08 May 2006 01:21:04 -0400 Message-ID: <445ED540.6000906@nc.rr.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: Sender: linux-8086-owner@vger.kernel.org List-Id: Content-Type: text/plain; charset="us-ascii"; format="flowed" To: ELKS I'm releasing an updated clean tarball with DOS line endings stripped and the latest patches applied. For ease in debugging the Dev86 problem here, this is the chunk of code in cpp.c from the most recent Dev86 that handles #include files. We can't have random included files being detected as non-existent when they are clearly present. If you're a C programmer, please figure out where this is going awry. It happens for both and "xxx" #include directives. I cleaned out the MS-DOS CRLF line endings that I happened upon and the problem persists. cpp.c code in question follows: -------------- static void do_proc_include() { int ch, ch1; char * p; FILE * fd; ch = get_onetok(SKIP_SPACE); if( ch == '<' || ch == '"' ) { if( ch == '"' ) ch1 = ch; else ch1 = '>'; p = curword; while(p< curword+WORDSIZE-1) { ch = pgetc(); if( ch == '\n' ) break; if( ch == ch1 ) { *p = '\0'; p = strdup(curword); do { ch1 = pgetc(); } while(ch1 == ' ' || ch1 == '\t'); unchget(ch1); do_proc_tail(); saved_files[fi_count] = curfile; saved_fname[fi_count] = c_fname; saved_lines[fi_count] = c_lineno; fd = open_include(p, "r", (ch=='"')); if( fd ) { fi_count++; curfile = fd; } else cerror("Cannot open include file"); return; } *p++ = ch; } } cerror("Bad #include command"); while(ch != '\n') ch = pgetc(); return; } --------------