All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jody <jbruchon@nc.rr.com>
To: ELKS <linux-8086@vger.kernel.org>
Subject: #include Code in Dev86 to debug
Date: Mon, 08 May 2006 01:21:04 -0400	[thread overview]
Message-ID: <445ED540.6000906@nc.rr.com> (raw)

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 <xxx> 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;
}

--------------

                 reply	other threads:[~2006-05-08  5:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=445ED540.6000906@nc.rr.com \
    --to=jbruchon@nc.rr.com \
    --cc=linux-8086@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.