Subject: Troubles with ctrl Z and intl/loadmsgcat.c
From: [email-masked] (Christine pourcelot)

29 Jan 1999 07:41:52 -0800
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
To: "[email-masked]" <[email-masked]>

Hi,

I've some (= a lots of) troubles while porting a software from
unix/linux to Windows NT. My last problem is I have to handle files that
may contain ^Z characters. Unfortunately, cygwin seems to act like MSDOS
and treats this character as an EOF :-(
I'm also using some gettext tools and I saw something that seems to me
to be wrong in src/intl/loadmsgcat.c :
the "read" system call return 0 when he meets some ctrl-Z, but ... as
you can see, when nb= 0, you'll get an endless loop :-((

***************************************************************
 if (data == (struct mo_file_header *) -1)
    {
      off_t to_read;
      char *read_ptr;
      data = (struct mo_file_header *) malloc (st.st_size);
      if (data == NULL)
	return;
      to_read = st.st_size;
      read_ptr = (char *) data;
      do
	{
	  long int nb = (long int) read (fd, read_ptr, to_read);
	  if (nb == -1)
	    {
	      close (fd);
	      return;
	    }
	  read_ptr += nb;
	  to_read -= nb;
	}
      while (to_read > 0);
      close (fd);
    }

********************************************************************

Got any Idea ???

Regards,
Christine
-- 
Christine Pourcelot
Stagiaire projet CODES
INRIA ROCQUENCOURT
tel : 01 39 63 57 70
-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".