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: <374ABB62.767E35A7@trw.com> Date: Tue, 25 May 1999 11:01:54 -0400 From: Mark Levedahl X-Mailer: Mozilla 4.51 [en] (Win95; U) X-Accept-Language: en MIME-Version: 1.0 To: earnie_boyd AT yahoo DOT com CC: Ian Zimmerman , cygwin AT sourceware DOT cygnus DOT com Subject: Re: bash history not restored References: <19990525143249 DOT 26677 DOT rocketmail AT web118 DOT yahoomail DOT com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This same patch applies for gdb and octave, which both use readline. I presume there are others. I also don't understand why the check for which system. I would think a simpler construct of #ifndef O_BINARY #define O_BINARY 0 #endif would handle any compiler that doesn't like O_BINARY. Earnie Boyd wrote: > Oops. Too hasty with my last reply. > > I see this does solve the problem in that O_BINARY doesn't get reset to the > value zero by default. > > Sorry I misread the code. > > Earnie. > --- Mark Levedahl wrote: > > --- Earnie Boyd 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 > > #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__*/ > > > > > > > > > > > > _________________________________________________________ > 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