www.delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/05/25/10:27:05

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19990525143053.27540.rocketmail@web116.yahoomail.com>
Date: Tue, 25 May 1999 07:30:53 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: Re: bash history not restored
To: Mark Levedahl <mark DOT levedahl AT trw DOT com>, Ian Zimmerman <itz AT lbin DOT com>,
cygwin AT sourceware DOT cygnus DOT com
MIME-Version: 1.0

--- Mark Levedahl <mark DOT levedahl AT trw DOT com> wrote:
> --- Earnie Boyd <earnie_boyd AT yahoo DOT com> wrote:
> 
> > This is a bug in the readline/history libraries used by bash.  I
> > haven't tracked them down as yet. ...
> 
> Simple, really. Bash opens .bash_history in binary mode ONLY with emx.
> Following patch fixes things.
> 
> Mark Levedahl
> 
> diff -ur bash-2.02.1-orig/lib/readline/histfile.c
> bash-2.02.1/lib/readline/histfile.c
> --- bash-2.02.1-orig/lib/readline/histfile.c Mon Oct 06 12:45:12 1997
> +++ bash-2.02.1/lib/readline/histfile.c Tue May 25 08:56:39 1999
> @@ -54,15 +54,15 @@
>  #  include <strings.h>
>  #endif /* !HAVE_STRING_H */
> 
> -#if defined (__EMX__)
> +#if defined (__EMX__) || defined (__CYGWIN__)
>  #  ifndef O_BINARY
>  #    define O_BINARY 0
>  #  endif
> -#else /* !__EMX__ */
> +#else /* !__EMX__ && !__CYGWIN__ */
>     /* If we're not compiling for __EMX__, we don't want this at all.
> Ever. */
>  #  undef O_BINARY
>  #  define O_BINARY 0
> -#endif /* !__EMX__ */
> +#endif /* !__EMX__ && !__CYGWIN__*/

Sorry Mark,

I don't see how this will fix the problem.  All your patch is doing is making
sure that the macro O_BINARY is defined and defines it as an integer zero which
will do nothing when or'ed with the other switches.  The value of O_BINARY in
fcntl.h is:

 cygwin: 0x10000
mingw32: 0x8000

So, you're close; but not close enough to solve the problem.

===
"Earnie Boyd" <mailto:earnie_boyd AT yahoo DOT com>
CYGWIN RELATED HELP:
 DOCUMENTATION: <http://sourceware.cygnus.com/cygwin/docs.html>
       DLLHELP: <http://www.xraylith.wisc.edu/~khan/software/gnu-win32/>
ARCHIVE SEARCH: <http://www.delorie.com/archives/> OR
                <http://www.eGroups.com/list/gnu-win32/>
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


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