From cd47583be488a600699606197091077ba4cb2c1d Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 4 Oct 1993 21:20:39 +0000 Subject: [PATCH] merge with 1.8.1a --- lib/getdate.y | 6 +++++- lib/getopt.c | 6 +++++- lib/getopt1.c | 6 +++++- lib/strftime.c | 8 +++++++- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/lib/getdate.y b/lib/getdate.y index cdc2b5565..ebfb7c91a 100644 --- a/lib/getdate.y +++ b/lib/getdate.y @@ -14,8 +14,12 @@ /* SUPPRESS 288 on yyerrlab *//* Label unused */ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +#include +#else #include "config.h" #endif +#endif /* Since the code of getdate.y is not included in the Emacs executable itself, there is no need to #define static in this file. Even if @@ -115,7 +119,7 @@ static int yyerror (); #if !defined(lint) && !defined(SABER) static char RCS[] = - "$Header: str2date.y,v 2.1 90/09/06 08:15:06 cronan Exp $"; + "$Header: /w/src/cvsroot/shellutils/lib/getdate.y,v 1.5 1993/09/08 18:23:16 meyering Exp $"; #endif /* !defined(lint) && !defined(SABER) */ diff --git a/lib/getopt.c b/lib/getopt.c index 49db99856..7a4673b8d 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -21,10 +21,14 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because getopt.c was found in $srcdir). */ + (which it would do because it found this file in $srcdir). */ #include +#else +#include "config.h" +#endif #endif #ifndef __STDC__ diff --git a/lib/getopt1.c b/lib/getopt1.c index 2b93f7835..f784b5757 100644 --- a/lib/getopt1.c +++ b/lib/getopt1.c @@ -17,10 +17,14 @@ Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) /* We use instead of "config.h" so that a compilation using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h - (which it would do because getopt1.c was found in $srcdir). */ + (which it would do because it found this file in $srcdir). */ #include +#else +#include "config.h" +#endif #endif #include "getopt.h" diff --git a/lib/strftime.c b/lib/strftime.c index a07571750..cfd41adbe 100644 --- a/lib/strftime.c +++ b/lib/strftime.c @@ -104,7 +104,13 @@ static char const * const months[] = /* Add character C to STRING and increment LENGTH, unless LENGTH would exceed MAX. */ -#define add_char(c) (length + 1 <= max) && (string[length++] = (c)) +#define add_char(c) \ + do \ + { \ + if (length + 1 <= max) \ + string[length++] = (c); \ + } \ + while (0) /* Add a 2 digit number to STRING, padding if specified. Return the number of characters added, up to MAX. */ -- 2.11.0