delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/01/29/07:41:52

From: Christine DOT Pourcelot AT inria DOT fr (Christine pourcelot)
Subject: Troubles with ctrl Z and intl/loadmsgcat.c
29 Jan 1999 07:41:52 -0800 :
Message-ID: <36B1851B.53596096.cygnus.gnu-win32@inria.fr>
Mime-Version: 1.0
To: "gnu-win32 AT cygnus DOT com" <gnu-win32 AT cygnus DOT com>

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
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


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