delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2000/08/22/16:45:09

From: "Mark E." <snowball3 AT bigfoot DOT com>
To: djgpp-workers AT delorie DOT com
Date: Tue, 22 Aug 2000 16:43:32 -0400
MIME-Version: 1.0
Subject: Re: Problems with depcomp from fileutils 4.0x & bash 2.03
Message-ID: <39A2ADB4.10320.5F727@localhost>
In-reply-to: <2427-Tue22Aug2000095531+0300-eliz@is.elta.co.il>
References: <200008220358 DOT JAA01049 AT midpec DOT com> (message from Prashant TR on Tue, 22 Aug 2000 09:28:24 +0530)
X-mailer: Pegasus Mail for Win32 (v3.12c)
Reply-To: djgpp-workers AT delorie DOT com
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp-workers AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> From what I see, Bash 2.04 has some trouble with any fragment of the
> configure script which uses <<\EOF, like this:

Turns out the problem in plain DOS is from a subtle change to the way here 
documents are handled. This test case is a simplified version of the problem:

#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <dos.h>

int main()
{
  int fd, fd2;
  const char document[]="I am a here document.";
  int document_len;

  document_len = strlen (document);

  fd = open ("here.txt", O_TRUNC | O_WRONLY | O_CREAT | O_EXCL | O_TEXT, 
0600);
  write (fd, document, document_len);

  /* _dos_commit (fd); */
  fd2 = open (document, O_RDONLY, 0600);

  close (fd);

  /* Process here document in fd2. Won't work unless _dos_commit is 
uncommented. */
  close (fd2);

  return 0;
}

Adding a call to '_dos_commit' solves the problem in Bash 2.04 for plain DOS.

Mark

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019