+++ /dev/null
---- SDL-1.2.10/include/SDL_endian.h.byteorder 2006-05-01 10:02:59.000000000 +0200
-+++ SDL-1.2.10/include/SDL_endian.h 2006-05-19 11:53:07.000000000 +0200
-@@ -32,6 +32,10 @@
- #define SDL_BIG_ENDIAN 4321
-
- #ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
-+#ifdef __linux__
-+#include <endian.h>
-+#define SDL_BYTEORDER __BYTE_ORDER
-+#else /* __linux __ */
- #if defined(__hppa__) || \
- defined(__m68k__) || defined(mc68000) || defined(_M_M68K) || \
- (defined(__MIPS__) && defined(__MISPEB__)) || \
-@@ -41,6 +45,7 @@
- #else
- #define SDL_BYTEORDER SDL_LIL_ENDIAN
- #endif
-+#endif /* __linux __ */
- #endif /* !SDL_BYTEORDER */
-
-
+++ /dev/null
---- SDL-1.2.10/configure.in.libdir 2006-05-17 05:16:07.000000000 +0200
-+++ SDL-1.2.10/configure.in 2006-05-19 11:05:42.000000000 +0200
-@@ -324,12 +324,13 @@
- AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
- , enable_alsa_shared=yes)
- if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
-- if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/lib $ALSA_LIBS"
-- elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
-- elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
-+ pfx=${libdir##*/}
-+ if test "x`ls /${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/local/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/local/${pfx} $ALSA_LIBS"
- fi
- fi
- alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
-@@ -480,7 +481,8 @@
- AC_ARG_ENABLE(arts-shared,
- AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
- , enable_arts_shared=yes)
-- arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
-+ pfx=${libdir##*/}
-+ arts_lib_spec="$ARTS_PREFIX/${pfx}/libartsc.so.*"
- arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
- echo "-- $arts_lib_spec -> $arts_lib"
-
---- SDL-1.2.10/configure.libdir 2006-05-17 08:53:45.000000000 +0200
-+++ SDL-1.2.10/configure 2006-05-19 11:06:08.000000000 +0200
-@@ -24063,12 +24063,13 @@
- enable_alsa_shared=yes
- fi;
- if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
-- if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/lib $ALSA_LIBS"
-- elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
-- elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
-+ pfx=${libdir##*/}
-+ if test "x`ls /${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/local/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/local/${pfx} $ALSA_LIBS"
- fi
- fi
- alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libasound.so.*/'`
-@@ -24704,7 +24705,8 @@
- else
- enable_arts_shared=yes
- fi;
-- arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
-+ pfx=${libdir##*/}
-+ arts_lib_spec="$ARTS_PREFIX/${pfx}/libartsc.so.*"
- arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
- echo "-- $arts_lib_spec -> $arts_lib"
-
+++ /dev/null
---- SDL-1.2.10/src/video/ps2gs/SDL_gsyuv.c.pagesize 2006-05-17 05:16:07.000000000 +0200
-+++ SDL-1.2.10/src/video/ps2gs/SDL_gsyuv.c 2006-05-22 16:15:46.000000000 +0200
-@@ -27,7 +27,8 @@
- #include <unistd.h>
- #include <sys/ioctl.h>
- #include <sys/mman.h>
--#include <asm/page.h> /* For definition of PAGE_SIZE */
-+/* There is no PAGE_SIZE define anymore, use sysconf from unistd.h instead */
-+#include <unistd.h>
-
- #include "SDL_video.h"
- #include "SDL_gsyuv_c.h"
-@@ -180,7 +181,7 @@
-
- /* Allocate a DMA area for pixel conversion */
- bpp = this->screen->format->BytesPerPixel;
-- map_offset = (mapped_len + (PAGE_SIZE - 1)) & ~(PAGE_SIZE - 1);
-+ map_offset = (mapped_len + ((int)sysconf(_SC_PAGE_SIZE) - 1)) & ~((int)sysconf(_SC_PAGE_SIZE) - 1);
- hwdata->dma_len = hwdata->macroblocks * (16 * 16 + 8 * 8 + 8 * 8) +
- width * height * bpp +
- hwdata->macroblocks * (16 * sizeof(long long)) +
---- SDL-1.2.10/src/video/Xext/Xxf86dga/XF86DGA.c.pagesize 2006-05-01 10:02:47.000000000 +0200
-+++ SDL-1.2.10/src/video/Xext/Xxf86dga/XF86DGA.c 2006-05-22 16:15:25.000000000 +0200
-@@ -18,7 +18,6 @@
- #define HAS_MMAP_ANON
- #include <sys/types.h>
- #include <sys/mman.h>
--#include <asm/page.h> /* PAGE_SIZE */
- #define HAS_SC_PAGESIZE /* _SC_PAGESIZE may be an enum for Linux */
- #define HAS_GETPAGESIZE
- #endif /* linux */
-@@ -491,10 +490,6 @@
- if (pagesize == -1)
- pagesize = getpagesize();
- #endif
--#ifdef PAGE_SIZE
-- if (pagesize == -1)
-- pagesize = PAGE_SIZE;
--#endif
- if (pagesize == -1)
- pagesize = 4096;
-
---- SDL-1.2.10/src/video/fbcon/SDL_fbvideo.c.pagesize 2006-05-17 05:16:07.000000000 +0200
-+++ SDL-1.2.10/src/video/fbcon/SDL_fbvideo.c 2006-05-22 16:16:05.000000000 +0200
-@@ -29,7 +29,8 @@
- #include <unistd.h>
- #include <sys/ioctl.h>
- #include <sys/mman.h>
--#include <asm/page.h> /* For definition of PAGE_SIZE */
-+/* There is no PAGE_SIZE define anymore, use sysconf from unistd.h instead */
-+#include <unistd.h>
- #include <linux/vt.h>
-
- #include "SDL_video.h"
-@@ -547,7 +548,7 @@
-
- /* Memory map the device, compensating for buggy PPC mmap() */
- mapped_offset = (((long)finfo.smem_start) -
-- (((long)finfo.smem_start)&~(PAGE_SIZE-1)));
-+ (((long)finfo.smem_start)&~((int)sysconf(_SC_PAGE_SIZE)-1)));
- mapped_memlen = finfo.smem_len+mapped_offset;
- mapped_mem = do_mmap(NULL, mapped_memlen,
- PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0);
+++ /dev/null
---- SDL-1.2.11/configure.in.dynamic-esd 2007-03-19 17:44:47.000000000 +0100
-+++ SDL-1.2.11/configure.in 2007-03-19 17:44:47.000000000 +0100
-@@ -430,6 +430,16 @@
- AC_ARG_ENABLE(esd-shared,
- AC_HELP_STRING([--enable-esd-shared], [dynamically load ESD audio support [[default=yes]]]),
- , enable_esd_shared=yes)
-+ if test "x`echo $ESD_LIBS | grep -- -L`" = "x"; then
-+ pfx=${libdir##*/}
-+ if test "x`ls /${pfx}/libesd.so.* 2> /dev/null`" != "x"; then
-+ ESD_LIBS="-L/${pfx} $ESD_LIBS"
-+ elif test "x`ls /usr/${pfx}/libesd.so.* 2> /dev/null`" != "x"; then
-+ ESD_LIBS="-L/usr/${pfx} $ESD_LIBS"
-+ elif test "x`ls /usr/local/${pfx}/libesd.so.* 2> /dev/null`" != "x"; then
-+ ESD_LIBS="-L/usr/local/${pfx} $ESD_LIBS"
-+ fi
-+ fi
- esd_lib_spec=`echo $ESD_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libesd.so.*/'`
- esd_lib=`ls -- $esd_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
- echo "-- $esd_lib_spec -> $esd_lib"
+++ /dev/null
---- SDL-1.2.11/docs/man3/SDL_ListModes.3.fixman 2007-03-19 18:01:29.000000000 +0100
-+++ SDL-1.2.11/docs/man3/SDL_ListModes.3 2007-03-19 18:01:34.000000000 +0100
-@@ -1,6 +1,6 @@
- .TH "SDL_ListModes" "3" "Tue 11 Sep 2001, 23:01" "SDL" "SDL API Reference"
- .SH "NAME"
--SDL_ListModes\- Returns a pointer to an array of available screen dimensions for the given format and video flags
-+SDL_ListModes \- Returns a pointer to an array of available screen dimensions for the given format and video flags
- .SH "SYNOPSIS"
- .PP
- \fB#include "SDL\&.h"
+++ /dev/null
-diff -up SDL-1.2.12/configure.in.disable_yasm SDL-1.2.12/configure.in
---- SDL-1.2.12/configure.in.disable_yasm 2007-08-27 18:24:44.000000000 +0200
-+++ SDL-1.2.12/configure.in 2007-08-27 18:25:04.000000000 +0200
-@@ -715,7 +715,6 @@ AC_HELP_STRING([--enable-nasm], [use nas
- esac
- fi
-
-- AC_PATH_PROG(NASM, yasm)
- echo "%ifidn __OUTPUT_FORMAT__,elf" > unquoted-sections
- echo "section .note.GNU-stack noalloc noexec nowrite progbits" >> unquoted-sections
- echo "%endif" >> unquoted-sections
+++ /dev/null
-diff -up SDL-1.2.12/sdl-config.in.multilib SDL-1.2.12/sdl-config.in
---- SDL-1.2.12/sdl-config.in.multilib 2007-07-20 07:52:45.000000000 +0200
-+++ SDL-1.2.12/sdl-config.in 2007-11-06 17:07:25.000000000 +0100
-@@ -3,7 +3,6 @@
- prefix=@prefix@
- exec_prefix=@exec_prefix@
- exec_prefix_set=no
--libdir=@libdir@
-
- @ENABLE_STATIC_FALSE@usage="\
- @ENABLE_STATIC_FALSE@Usage: sdl-config [--prefix[=DIR]] [--exec-prefix[=DIR]] [--version] [--cflags] [--libs]"
-@@ -45,11 +44,11 @@ while test $# -gt 0; do
- echo -I@includedir@/SDL @SDL_CFLAGS@
- ;;
- @ENABLE_SHARED_TRUE@ --libs)
--@ENABLE_SHARED_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
-+@ENABLE_SHARED_TRUE@ echo @SDL_RLD_FLAGS@ @SDL_LIBS@
- @ENABLE_SHARED_TRUE@ ;;
- @ENABLE_STATIC_TRUE@@ENABLE_SHARED_TRUE@ --static-libs)
- @ENABLE_STATIC_TRUE@@ENABLE_SHARED_FALSE@ --libs|--static-libs)
--@ENABLE_STATIC_TRUE@ echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@
-+@ENABLE_STATIC_TRUE@ echo @SDL_RLD_FLAGS@ @SDL_STATIC_LIBS@
- @ENABLE_STATIC_TRUE@ ;;
- *)
- echo "${usage}" 1>&2
+++ /dev/null
-diff -up SDL-1.2.12/configure.in.x11dyn64 SDL-1.2.12/configure.in
---- SDL-1.2.12/configure.in.x11dyn64 2007-08-27 18:18:28.000000000 +0200
-+++ SDL-1.2.12/configure.in 2007-08-27 18:20:48.000000000 +0200
-@@ -950,7 +950,8 @@ AC_HELP_STRING([--enable-x11-shared], [d
- ;;
- *)
- x11_lib_path=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
-- for path in $x11_lib_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do
-+ pfx=${libdir##*/}
-+ for path in $x11_lib_path /usr/${pfx} /usr/lib /usr/X11/lib /usr/X11R6/lib; do
- if test "x$x11_lib" = "x"; then
- x11_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
- if test "x$x11_lib" = "x"; then
+++ /dev/null
-diff -up SDL-1.2.13/src/audio/SDL_audio.c.audiodriver SDL-1.2.13/src/audio/SDL_audio.c
---- SDL-1.2.13/src/audio/SDL_audio.c.audiodriver 2007-12-31 05:47:59.000000000 +0100
-+++ SDL-1.2.13/src/audio/SDL_audio.c 2008-09-01 14:53:58.000000000 +0200
-@@ -36,6 +36,12 @@
-
- /* Available audio drivers */
- static AudioBootStrap *bootstrap[] = {
-+#if SDL_AUDIO_DRIVER_PULSE
-+ &PULSE_bootstrap,
-+#endif
-+#if SDL_AUDIO_DRIVER_ALSA
-+ &ALSA_bootstrap,
-+#endif
- #if SDL_AUDIO_DRIVER_BSD
- &BSD_AUDIO_bootstrap,
- #endif
-@@ -43,12 +49,6 @@ static AudioBootStrap *bootstrap[] = {
- &DSP_bootstrap,
- &DMA_bootstrap,
- #endif
--#if SDL_AUDIO_DRIVER_ALSA
-- &ALSA_bootstrap,
--#endif
--#if SDL_AUDIO_DRIVER_PULSE
-- &PULSE_bootstrap,
--#endif
- #if SDL_AUDIO_DRIVER_QNXNTO
- &QNXNTOAUDIO_bootstrap,
- #endif
+++ /dev/null
-diff -up SDL-1.2.13/configure.in.dynamic-pulse SDL-1.2.13/configure.in
---- SDL-1.2.13/configure.in.dynamic-pulse 2008-01-07 12:31:57.000000000 +0100
-+++ SDL-1.2.13/configure.in 2008-01-07 12:32:02.000000000 +0100
-@@ -500,14 +510,15 @@ AC_HELP_STRING([--enable-pulseaudio], [u
- if test x$audio_pulse = xyes; then
- AC_ARG_ENABLE(pulseaudio-shared,
- AC_HELP_STRING([--enable-pulseaudio-shared], [dynamically load PulseAudio support [[default=yes]]]),
-- , enable_pulse_shared=yes)
-+ , enable_pulseaudio_shared=yes)
- if test "x`echo $PULSE_LIBS | grep -- -L`" = "x"; then
-- if test "x`ls /lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
-- PULSE_LIBS="-L/lib $PULSE_LIBS"
-- elif test "x`ls /usr/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
-- PULSE_LIBS="-L/usr/lib $PULSE_LIBS"
-- elif test "x`ls /usr/local/lib/libpulse-simple.so.* 2> /dev/null`" != "x"; then
-- PULSE_LIBS="-L/usr/local/lib $PULSE_LIBS"
-+ pfx=${libdir##*/}
-+ if test "x`ls /${pfx}/libpulse-simple.so.* 2> /dev/null`" != "x"; then
-+ PULSE_LIBS="-L/${pfx} $PULSE_LIBS"
-+ elif test "x`ls /usr/${pfx}/libpulse-simple.so.* 2> /dev/null`" != "x"; then
-+ PULSE_LIBS="-L/usr/${pfx} $PULSE_LIBS"
-+ elif test "x`ls /usr/local/${pfx}/libpulse-simple.so.* 2> /dev/null`" != "x"; then
-+ PULSE_LIBS="-L/usr/local/${pfx} $PULSE_LIBS"
- fi
- fi
- pulse_lib_spec=`echo $PULSE_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libpulse-simple.so.*/'`
-@@ -518,11 +529,11 @@ AC_HELP_STRING([--enable-pulseaudio-shar
- SOURCES="$SOURCES $srcdir/src/audio/pulse/*.c"
- EXTRA_CFLAGS="$EXTRA_CFLAGS $PULSE_CFLAGS"
- if test x$have_loadso != xyes && \
-- test x$enable_pulse_shared = xyes; then
-+ test x$enable_pulseaudio_shared = xyes; then
- AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic PulseAudio loading])
- fi
- if test x$have_loadso = xyes && \
-- test x$enable_pulse_shared = xyes && test x$pulse_lib != x; then
-+ test x$enable_pulseaudio_shared = xyes && test x$pulse_lib != x; then
- AC_DEFINE_UNQUOTED(SDL_AUDIO_DRIVER_PULSE_DYNAMIC, "$pulse_lib")
- else
- EXTRA_LDFLAGS="$EXTRA_LDFLAGS $PULSE_LIBS"
+++ /dev/null
-diff -up SDL-1.2.13/configure.in.libdir SDL-1.2.13/configure.in
---- SDL-1.2.13/configure.in.libdir 2007-12-31 05:48:39.000000000 +0100
-+++ SDL-1.2.13/configure.in 2008-01-07 11:56:10.000000000 +0100
-@@ -348,12 +348,13 @@ AC_HELP_STRING([--enable-alsa], [support
- AC_HELP_STRING([--enable-alsa-shared], [dynamically load ALSA audio support [[default=yes]]]),
- , enable_alsa_shared=yes)
- if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
-- if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/lib $ALSA_LIBS"
-- elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
-- elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
-+ pfx=${libdir##*/}
-+ if test "x`ls /${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/local/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/local/${pfx} $ALSA_LIBS"
- fi
- fi
- alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([[^ ]]*\).*/\1\/libasound.so.*/'`
-@@ -561,7 +572,8 @@ AC_HELP_STRING([--enable-arts], [support
- AC_ARG_ENABLE(arts-shared,
- AC_HELP_STRING([--enable-arts-shared], [dynamically load aRts audio support [[default=yes]]]),
- , enable_arts_shared=yes)
-- arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
-+ pfx=${libdir##*/}
-+ arts_lib_spec="$ARTS_PREFIX/${pfx}/libartsc.so.*"
- arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
- echo "-- $arts_lib_spec -> $arts_lib"
-
-diff -up SDL-1.2.13/configure.libdir SDL-1.2.13/configure
---- SDL-1.2.13/configure.libdir 2007-12-31 06:09:39.000000000 +0100
-+++ SDL-1.2.13/configure 2008-01-07 12:01:32.000000000 +0100
-@@ -24888,12 +24888,13 @@ else
- fi
-
- if test "x`echo $ALSA_LIBS | grep -- -L`" = "x"; then
-- if test "x`ls /lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/lib $ALSA_LIBS"
-- elif test "x`ls /usr/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/lib $ALSA_LIBS"
-- elif test "x`ls /usr/local/lib/libasound.so.* 2> /dev/null`" != "x"; then
-- ALSA_LIBS="-L/usr/local/lib $ALSA_LIBS"
-+ pfx=${libdir##*/}
-+ if test "x`ls /${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/${pfx} $ALSA_LIBS"
-+ elif test "x`ls /usr/local/${pfx}/libasound.so.* 2> /dev/null`" != "x"; then
-+ ALSA_LIBS="-L/usr/local/${pfx} $ALSA_LIBS"
- fi
- fi
- alsa_lib_spec=`echo $ALSA_LIBS | sed 's/.*-L\([^ ]*\).*/\1\/libasound.so.*/'`
-@@ -25643,7 +25634,8 @@ else
- enable_arts_shared=yes
- fi
-
-- arts_lib_spec="$ARTS_PREFIX/lib/libartsc.so.*"
-+ pfx=${libdir##*/}
-+ arts_lib_spec="$ARTS_PREFIX/${pfx}/libartsc.so.*"
- arts_lib=`ls -- $arts_lib_spec | sed 's/.*\/\(.*\)/\1/; q'`
- echo "-- $arts_lib_spec -> $arts_lib"
-
+++ /dev/null
---- SDL-1.2.13/src/audio/pulse/SDL_pulseaudio.c 2007-12-31 05:47:58.000000000 +0100
-+++ SDL-1.2.13.lennart/src/audio/pulse/SDL_pulseaudio.c 2008-03-31 16:09:05.000000000 +0200
-@@ -1,3 +1,4 @@
-+/* -*- Mode: C; c-basic-offset: 8; indent-tabs-mode: t -*- */
- /*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2007 Sam Lantinga
-@@ -18,7 +19,7 @@
-
- Stéphan Kochen
- stephan@kochen.nl
--
-+
- Based on parts of the ALSA and ESounD output drivers.
- */
- #include "SDL_config.h"
-@@ -78,14 +79,14 @@ static int (*SDL_NAME(pa_simple_write))(
- pa_simple *s,
- const void *data,
- size_t length,
-- int *error
-+ int *error
- );
- static pa_channel_map* (*SDL_NAME(pa_channel_map_init_auto))(
- pa_channel_map *m,
- unsigned channels,
- pa_channel_map_def_t def
- );
--
-+
-
- static struct {
- const char *name;
-@@ -158,16 +159,16 @@ static int Audio_Available(void)
- if ( LoadPulseLibrary() < 0 ) {
- return available;
- }
--
-+
- /* Connect with a dummy format. */
- paspec.format = PA_SAMPLE_U8;
- paspec.rate = 11025;
- paspec.channels = 1;
- connection = SDL_NAME(pa_simple_new)(
-- SDL_getenv("PASERVER"), /* server */
-+ NULL, /* server */
- "Test stream", /* application name */
- PA_STREAM_PLAYBACK, /* playback mode */
-- SDL_getenv("PADEVICE"), /* device on the server */
-+ NULL, /* device on the server */
- "Simple DirectMedia Layer", /* stream description */
- &paspec, /* sample format spec */
- NULL, /* channel map */
-@@ -178,7 +179,7 @@ static int Audio_Available(void)
- available = 1;
- SDL_NAME(pa_simple_free)(connection);
- }
--
-+
- UnloadPulseLibrary();
- return(available);
- }
-@@ -233,7 +234,7 @@ static void PULSE_WaitAudio(_THIS)
- {
- /* Check to see if the thread-parent process is still alive */
- { static int cnt = 0;
-- /* Note that this only works with thread implementations
-+ /* Note that this only works with thread implementations
- that use a different process id for each thread.
- */
- if (parent && (((++cnt)%10) == 0)) { /* Check every 10 loops */
-@@ -302,7 +303,7 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
- pa_sample_spec paspec;
- pa_buffer_attr paattr;
- pa_channel_map pacmap;
--
-+
- paspec.format = PA_SAMPLE_INVALID;
- for ( test_format = SDL_FirstAudioFormat(spec->format); test_format; ) {
- switch ( test_format ) {
-@@ -324,7 +325,7 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
- return(-1);
- }
- spec->format = test_format;
--
-+
- paspec.channels = spec->channels;
- paspec.rate = spec->freq;
-
-@@ -338,25 +339,24 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
- return(-1);
- }
- SDL_memset(mixbuf, spec->silence, spec->size);
--
-+
- /* Reduced prebuffering compared to the defaults. */
-- paattr.tlength = mixlen;
-+ paattr.tlength = mixlen*2;
- paattr.minreq = mixlen;
-- paattr.fragsize = mixlen;
-- paattr.prebuf = mixlen;
-- paattr.maxlength = mixlen * 4;
--
-+ paattr.prebuf = mixlen*2;
-+ paattr.maxlength = mixlen*2;
-+
- /* The SDL ALSA output hints us that we use Windows' channel mapping */
- /* http://bugzilla.libsdl.org/show_bug.cgi?id=110 */
- SDL_NAME(pa_channel_map_init_auto)(
- &pacmap, spec->channels, PA_CHANNEL_MAP_WAVEEX);
--
-+
- /* Connect to the PulseAudio server */
- stream = SDL_NAME(pa_simple_new)(
-- SDL_getenv("PASERVER"), /* server */
-+ NULL, /* server */
- get_progname(), /* application name */
- PA_STREAM_PLAYBACK, /* playback mode */
-- SDL_getenv("PADEVICE"), /* device on the server */
-+ NULL, /* device on the server */
- "Simple DirectMedia Layer", /* stream description */
- &paspec, /* sample format spec */
- &pacmap, /* channel map */
-@@ -371,7 +371,6 @@ static int PULSE_OpenAudio(_THIS, SDL_Au
-
- /* Get the parent process id (we're the parent of the audio thread) */
- parent = getpid();
--
-+
- return(0);
- }
--
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-Name: mingw32-SDL
-Version: 1.2.13
-Release: 4%{?dist}
-Summary: MinGW Windows port of SDL cross-platform multimedia library
-
-License: LGPLv2+
-Group: Development/Libraries
-URL: http://www.libsdl.org/
-Source0: http://www.libsdl.org/release/SDL-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildArch: noarch
-
-# Patches from native version.
-Patch0: SDL-1.2.10-byteorder.patch
-Patch17: SDL-1.2.13-libdir.patch
-Patch21: SDL-1.2.12-multilib.patch
-Patch23: SDL-1.2.11-dynamic-esd.patch
-Patch24: SDL-1.2.12-x11dyn64.patch
-Patch25: SDL-1.2.12-disable_yasm.patch
-Patch26: SDL-1.2.13-dynamic-pulse.patch
-Patch27: SDL-1.2.13-pulse-rework.patch
-Patch28: SDL-1.2.13-audiodriver.patch
-
-BuildRequires: mingw32-filesystem >= 40
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-binutils
-BuildRequires: mingw32-dlfcn
-BuildRequires: mingw32-iconv
-
-Requires: pkgconfig
-
-# Not required at the moment, but SDL does contain plenty of C++ code,
-# I just haven't worked out how to enable it.
-#BuildRequires: mingw32-gcc-c++
-
-# If we have nasm in the future, then this would enable future
-# optimizations on x86-based architectures.
-#%ifarch %{ix86}
-#BuildRequires: nasm
-#%endif
-
-
-%description
-Simple DirectMedia Layer (SDL) is a cross-platform multimedia library
-designed to provide fast access to the graphics frame buffer and audio
-device.
-
-
-%prep
-%setup -q -n SDL-%{version}
-%patch0 -p1 -b .byteorder
-%patch17 -p1 -b .libdir
-%patch21 -p1 -b .multilib
-%patch23 -p1 -b .dynamic-esd
-%patch24 -p1 -b .x11dyn64
-%patch25 -p1 -b .disable_yasm
-%patch26 -p1 -b .dynamic-pulse
-%patch27 -p1 -b .pulse-rework
-%patch28 -p1 -b .audiodriver
-
-
-%build
-%{_mingw32_configure} \
- --disable-video-svga --disable-video-ggi --disable-video-aalib \
- --disable-debug \
- --enable-sdl-dlopen \
- --enable-dlopen \
- --enable-arts-shared \
- --enable-esd-shared \
- --enable-pulseaudio-shared \
- --enable-alsa \
- --disable-rpath
-
-make
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT install
-
-# Remove static libraries but DON'T remove *.dll.a files.
-rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libSDL.a
-
-# Actually libSDLmain.a seems to be required. It just contains
-# a single object file called SDL_win32_main.o.
-#rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libSDLmain.a
-
-# Delete man pages since they duplicate what is already available
-# in base Fedora package.
-rm $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/*.3*
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%doc COPYING
-%{_mingw32_bindir}/SDL.dll
-%{_mingw32_bindir}/sdl-config
-%{_mingw32_libdir}/libSDL.dll.a
-%{_mingw32_libdir}/libSDL.la
-%{_mingw32_libdir}/libSDLmain.a
-%{_mingw32_libdir}/pkgconfig/sdl.pc
-%{_mingw32_datadir}/aclocal/sdl.m4
-%{_mingw32_includedir}/SDL
-
-
-%changelog
-* Tue Jan 13 2009 Richard W.M. Jones <rjones@redhat.com> - 1.2.13-4
-- Verify we are still up to date with Fedora release.
-- Include COPYING in documentation.
-- Build with dlfcn.
-- List all BRs.
-- No need to package the man pages, don't duplicate what's in the
- base Fedora package already.
-- Requires pkgconfig.
-
-* Fri Oct 24 2008 Richard W.M. Jones <rjones@redhat.com> - 1.2.13-2
-- Initial RPM release.
+++ /dev/null
-diff -ruNp dlfcn-win32-r11/config.mak dlfcn-win32-r11.new/config.mak
---- dlfcn-win32-r11/config.mak 1969-12-31 21:00:00.000000000 -0300
-+++ dlfcn-win32-r11.new/config.mak 2009-01-02 12:08:15.000000000 -0200
-@@ -0,0 +1,9 @@
-+# Automatically generated by configure
-+PREFIX=/usr/i686-pc-mingw32/sys-root/mingw
-+libdir=/usr/i686-pc-mingw32/sys-root/mingw/lib
-+incdir=/usr/i686-pc-mingw32/sys-root/mingw/include
-+CC=i686-pc-mingw32-gcc
-+BUILD_SHARED=yes
-+BUILD_STATIC=yes
-+BUILD_MSVC=no
-+DO_STRIP=yes
-diff -ruNp dlfcn-win32-r11/configure dlfcn-win32-r11.new/configure
---- dlfcn-win32-r11/configure 2009-01-02 11:54:38.000000000 -0200
-+++ dlfcn-win32-r11.new/configure 2009-01-02 12:35:30.000000000 -0200
-@@ -97,6 +97,45 @@ for opt do
- --make=*)
- make="$optval"
- ;;
-+ --enable-shared=*)
-+ shared="$optval"
-+ ;;
-+ --enable-static=*)
-+ static="$optval"
-+ ;;
-+ --enable-strip=*)
-+ strip="$optval"
-+ ;;
-+ --cache-file=*)
-+ ;;
-+ --host=*)
-+ ;;
-+ --build=*)
-+ ;;
-+ --target=*)
-+ ;;
-+ --exec-prefix=*)
-+ ;;
-+ --bindir=*)
-+ ;;
-+ --sbindir=*)
-+ ;;
-+ --sysconfdir=*)
-+ ;;
-+ --datadir=*)
-+ ;;
-+ --includedir=*)
-+ ;;
-+ --libexecdir=*)
-+ ;;
-+ --localstatedir=*)
-+ ;;
-+ --sharedstatedir=*)
-+ ;;
-+ --mandir=*)
-+ ;;
-+ --infodir=*)
-+ ;;
- --enable-?*|--disable-?*)
- eval `echo "$opt" | sed 's/--/action=/;s/-/ option=/;s/-/_/g'`
- echo "$CMDLINE_SELECT" | grep -q "^ *$option\$" || die_unknown $opt
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-%define realname dlfcn-win32
-
-%define alphatag r11
-
-Name: mingw32-dlfcn
-Version: 0
-Release: 0.3.%{alphatag}%{?dist}
-Summary: Implements a wrapper for dlfcn (dlopen dlclose dlsym dlerror)
-
-License: LGPLv2+
-Group: Development/Libraries
-URL: http://code.google.com/p/dlfcn-win32/
-Source0: http://dlfcn-win32.googlecode.com/files/%{realname}-%{alphatag}.tar.bz2
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildArch: noarch
-
-BuildRequires: mingw32-filesystem >= 40
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-binutils
-#BuildRequires: dos2unix
-
-Patch1: dlfcn_configure.patch
-
-
-%description
-This library implements a wrapper for dlfcn, as specified in POSIX and SUS,
-around the dynamic link library functions found in the Windows API.
-
-
-%prep
-%setup -q -n %{realname}-%{alphatag}
-
-%{__sed} -i 's/\r//' configure
-%{__sed} -i 's/\r//' README
-%{__sed} -i 's/\r//' COPYING
-
-%patch1 -p1
-
-
-%build
-%{_mingw32_configure} \
- --incdir=%{_mingw32_includedir} \
- --cc=i686-pc-mingw32-gcc \
- --enable-shared=yes \
- --enable-static=no \
- --enable-strip=i686-pc-mingw32-strip
-make %{?_smp_mflags}
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT install
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%doc README COPYING
-%{_mingw32_bindir}/libdl.dll
-%{_mingw32_libdir}/libdl.dll.a
-%{_mingw32_includedir}/dlfcn.h
-
-
-%changelog
-* Wed Jan 14 2009 Richard W.M. Jones <rjones@redhat.com> - 0-0.3.r11
-- Use Version 0
- (https://www.redhat.com/archives/fedora-packaging/2009-January/msg00064.html)
-- Revert use of dos2unix for now
- (https://www.redhat.com/archives/fedora-packaging/2009-January/msg00066.html)
-- Use _smp_mflags.
-
-* Tue Jan 13 2009 Richard W.M. Jones <rjones@redhat.com> - 0.1-0.2.r11
-- Import into fedora-mingw temporary repository because there are packages
- which will depend on this.
-- Fix the version/release according to packaging guidelines.
-- Tidy up the spec file.
-- Use dos2unix and keep the timestamps.
-
-* Fri Jan 02 2009 Itamar Reis Peixoto <itamar@ispbrasil.com.br> - r11-1
-- Initial RPM release.
+++ /dev/null
-# Applications not required for mingw
-missing source: 'ft2demos-2.3.7.tar.bz2'
-# Mingw does not have multilib
-missing patch 'freetype-multilib.patch'
-# Not including demos in mingw
-missing patch 'ft2demos-2.1.9-mathlib.patch'
\ No newline at end of file
+++ /dev/null
---- freetype-2.1.10/include/freetype/config/ftoption.h.enable-ft2-bci 2005-10-12 13:50:40.000000000 -0400
-+++ freetype-2.1.10/include/freetype/config/ftoption.h 2005-10-12 14:18:50.000000000 -0400
-@@ -436,7 +436,7 @@
- /* Do not #undef this macro here, since the build system might */
- /* define it for certain configurations only. */
- /* */
--/* #define TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
-+#define TT_CONFIG_OPTION_BYTECODE_INTERPRETER
-
-
- /*************************************************************************/
+++ /dev/null
---- freetype-2.2.1/modules.cfg.orig 2006-07-07 21:01:09.000000000 -0400
-+++ freetype-2.2.1/modules.cfg 2006-07-07 21:01:54.000000000 -0400
-@@ -110,7 +110,7 @@
- AUX_MODULES += cache
-
- # TrueType GX/AAT table validation. Needs ftgxval.c below.
--# AUX_MODULES += gxvalid
-+AUX_MODULES += gxvalid
-
- # Support for streams compressed with gzip (files with suffix .gz).
- #
-@@ -124,7 +124,7 @@
-
- # OpenType table validation. Needs ftotval.c below.
- #
--# AUX_MODULES += otvalid
-+AUX_MODULES += otvalid
-
- # Auxiliary PostScript driver component to share common code.
- #
+++ /dev/null
---- freetype-2.2.1/src/psaux/psobjs.c~ 2006-04-26 16:38:17.000000000 +0200
-+++ freetype-2.2.1/src/psaux/psobjs.c 2006-09-10 15:01:13.000000000 +0200
-@@ -165,6 +165,11 @@
- return PSaux_Err_Invalid_Argument;
- }
-
-+ if ( length < 0 ) {
-+ FT_ERROR(( "ps_table_add: invalid length\n" ));
-+ return PSaux_Err_Invalid_Argument;
-+ }
-+
- /* grow the base block if needed */
- if ( table->cursor + length > table->capacity )
- {
+++ /dev/null
---- freetype-2.3.0/include/freetype/config/ftoption.h.spf 2007-01-18 14:27:34.000000000 -0500
-+++ freetype-2.3.0/include/freetype/config/ftoption.h 2007-01-18 14:27:48.000000000 -0500
-@@ -92,7 +92,7 @@
- /* This is done to allow FreeType clients to run unmodified, forcing */
- /* them to display normal gray-level anti-aliased glyphs. */
- /* */
--/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
-+#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
-
-
- /*************************************************************************/
+++ /dev/null
---- freetype-2.2.1/builds/unix/freetype-config.in.multilib 2006-07-27 18:50:40.000000000 -0400
-+++ freetype-2.2.1/builds/unix/freetype-config.in 2006-07-27 18:58:13.000000000 -0400
-@@ -9,11 +9,11 @@
- # indicate that you have read the license and understand and accept it
- # fully.
-
--prefix=@prefix@
--exec_prefix=@exec_prefix@
-+prefix=`pkg-config --variable prefix freetype2`
-+exec_prefix=`pkg-config --variable exec_prefix freetype2`
- exec_prefix_set=no
--includedir=@includedir@
--libdir=@libdir@
-+includedir=`pkg-config --variable includedir freetype2`
-+libdir=`pkg-config --variable libdir freetype2`
- enable_shared=@build_libtool_libs@
- wl=@wl@
- hardcode_libdir_flag_spec='@hardcode_libdir_flag_spec@'
+++ /dev/null
---- ft2demos-2.1.9/graph/x11/rules.mk.mathlib 2004-08-04 16:11:22.534818408 -0400
-+++ ft2demos-2.1.9/graph/x11/rules.mk 2004-08-04 16:11:35.317875088 -0400
-@@ -70,7 +70,7 @@
- ifeq ($(PLATFORM),unix)
- GRAPH_LINK += $(X11_LIB:%=-R%)
- endif
-- GRAPH_LINK += $(X11_LIB:%=-L%) -lX11
-+ GRAPH_LINK += $(X11_LIB:%=-L%) -lX11 -lm
-
- # Solaris needs a -lsocket in GRAPH_LINK.
- #
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-# Patented bytecode interpreter and patented subpixel rendering
-# disabled by default. Pass '--with bytecode_interpreter' and '--with
-# subpixel_rendering' on rpmbuild command-line to enable them.
-
-%define _with_subpixel_rendering 1}
-%define _without_subpixel_rendering 0}
-%{!?_with_bytecode_interpreter: %{!?_without_bytecode_interpreter: %define _without_bytecode_interpreter --without-bytecode_interpreter}}
-%{!?_with_subpixel_rendering: %{!?_without_subpixel_rendering: %define _without_subpixel_rendering --without-subpixel_rendering}}
-
-%define with_xfree86 0
-
-Name: mingw32-freetype
-Version: 2.3.8
-Release: 1%{?dist}
-Summary: Free and portable font rendering engine
-
-License: FTL or GPLv2+
-URL: http://www.freetype.org
-Source: http://download.savannah.gnu.org/releases/freetype/freetype-%{version}.tar.bz2
-Source1: http://download.savannah.gnu.org/releases/freetype/freetype-doc-%{version}.tar.bz2
-#Source2: http://download.savannah.gnu.org/releases/freetype/ft2demos-%{version}.tar.bz2
-Group: Development/Libraries
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-# Patches from native Fedora package.
-#Patch5: ft2demos-2.1.9-mathlib.patch
-Patch20: freetype-2.1.10-enable-ft2-bci.patch
-Patch21: freetype-2.3.0-enable-spr.patch
-Patch46: freetype-2.2.1-enable-valid.patch
-Patch88: freetype-multilib.patch
-Patch89: freetype-2.2.1-memcpy-fix.patch
-
-BuildArch: noarch
-
-BuildRequires: mingw32-filesystem >= 25
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-binutils
-BuildRequires: mingw32-zlib
-BuildRequires: mingw32-dlfcn
-
-Requires: pkgconfig
-
-
-%description
-MinGW Windows Freetype library.
-
-
-%prep
-%setup -q -n freetype-%{version} -b 1 -a 1
-
-#pushd ft2demos-%{version}
-#%patch5 -p1 -b .mathlib
-#popd
-
-%if %{?_with_bytecode_interpreter:1}%{!?_with_bytecode_interpreter:0}
-%patch20 -p1 -b .enable-ft2-bci
-%endif
-
-%if %{?_with_subpixel_rendering:1}%{!?_with_subpixel_rendering:0}
-%patch21 -p1 -b .enable-spr
-%endif
-
-%patch46 -p1 -b .enable-valid
-
-%patch88 -p1 -b .multilib
-%patch89 -p1 -b .memcpy
-
-
-%build
-%{_mingw32_configure} --disable-static
-make %{?_smp_mflags}
-
-# The ft2demos Makefile is hacky and doesn't understand
-# cross-compilation. This nearly works, but not quite, so
-# disable. it.
-#pushd ft2demos-%{version}
-#make TOP_DIR=".." PLATFORM=win32
-#popd
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-make DESTDIR=$RPM_BUILD_ROOT install
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%doc docs/LICENSE.TXT
-%{_mingw32_bindir}/freetype-config
-%{_mingw32_bindir}/libfreetype-6.dll
-%{_mingw32_includedir}/freetype2
-%{_mingw32_includedir}/ft2build.h
-%{_mingw32_libdir}/libfreetype.dll.a
-%{_mingw32_libdir}/libfreetype.la
-%{_mingw32_libdir}/pkgconfig/freetype2.pc
-%{_mingw32_datadir}/aclocal/freetype2.m4
-
-
-%changelog
-* Fri Jan 16 2009 Richard W.M. Jones <rjones@redhat.com> - 2.3.8-1
-- New upstream version 2.3.8.
-- Use the patches from the Fedora native package.
-- Disable patented code.
-- Don't build the static library.
-- Use _smp_mflags.
-- BR mingw32-dlfcn (not required, but uses it if installed).
-- Add license file to doc section.
-
-* Tue Jan 13 2009 Richard W.M. Jones <rjones@redhat.com> - 2.3.7-6
-- Requires pkgconfig.
-
-* Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 2.3.7-5
-- Rename mingw -> mingw32.
-
-* Mon Sep 22 2008 Daniel P. Berrange <berrange@redhat.com> - 2.3.7-4
-- Import patches from rawhide & add docs
-
-* Sun Sep 21 2008 Richard W.M. Jones <rjones@redhat.com> - 2.3.7-3
-- Depends on filesystem >= 25.
-
-* Wed Sep 10 2008 Richard W.M. Jones <rjones@redhat.com> - 2.3.7-2
-- Fix source URL.
-- Remove static libraries.
-
-* Tue Sep 9 2008 Daniel P. Berrange <berrange@redhat.com> - 2.3.7-1
-- Initial RPM release
+++ /dev/null
-diff -buNr gdbm-1.8.0.orig/falloc.c gdbm-1.8.0/falloc.c
---- gdbm-1.8.0.orig/falloc.c Tue May 18 20:16:06 1999
-+++ gdbm-1.8.0/falloc.c Thu Apr 25 18:20:45 2002
-@@ -180,6 +180,13 @@
- avail_block *new_blk;
- int index;
-
-+ if (dbf->header->avail.count == dbf->header->avail.size)
-+ {
-+ /* We're kind of stuck here, so we re-split the header in order to
-+ avoid crashing. Sigh. */
-+ push_avail_block(dbf);
-+ }
-+
- /* Set up variables. */
- new_el.av_adr = dbf->header->avail.next_block;
- new_el.av_size = ( ( (dbf->header->avail.size * sizeof (avail_elem)) >> 1)
-@@ -196,12 +203,24 @@
- if (num_bytes != new_el.av_size) _gdbm_fatal (dbf, "read error");
-
- /* Add the elements from the new block to the header. */
-- for (index = 0; index < new_blk->count; index++)
-+ index = 0;
-+ while (index < new_blk->count)
-+ {
-+ while(index < new_blk->count
-+ && dbf->header->avail.count < dbf->header->avail.size)
- {
- /* With luck, this will merge a lot of blocks! */
- _gdbm_put_av_elem(new_blk->av_table[index],
- dbf->header->avail.av_table,
-- &dbf->header->avail.count, dbf->coalesce_blocks);
-+ &dbf->header->avail.count, TRUE);
-+ index++;
-+ }
-+ if (dbf->header->avail.count == dbf->header->avail.size)
-+ {
-+ /* We're kind of stuck here, so we re-split the header in order to
-+ avoid crashing. Sigh. */
-+ push_avail_block(dbf);
-+ }
- }
-
- /* Fix next_block, as well. */
-@@ -210,9 +229,17 @@
- /* We changed the header. */
- dbf->header_changed = TRUE;
-
-- /* Free the previous avail block. */
-+ /* Free the previous avail block. It is possible that the header table
-+ is now FULL, which will cause us to overflow it! */
-+ if (dbf->header->avail.count == dbf->header->avail.size)
-+ {
-+ /* We're kind of stuck here, so we re-split the header in order to
-+ avoid crashing. Sigh. */
-+ push_avail_block(dbf);
-+ }
-+
- _gdbm_put_av_elem (new_el, dbf->header->avail.av_table,
-- &dbf->header->avail.count, dbf->coalesce_blocks);
-+ &dbf->header->avail.count, TRUE);
- free (new_blk);
- }
-
+++ /dev/null
---- gdbm-1.8.0/Makefile.in.cflags Tue Jun 12 19:50:21 2001
-+++ gdbm-1.8.0/Makefile.in Tue Jun 12 19:57:45 2001
-@@ -17,22 +17,23 @@
- MAKEINFO = makeinfo
- TEXI2DVI = texi2dvi
-
--DEFS =
-+DEFS = @DEFS@
-
- # Where the system [n]dbm routines are...
- LIBS = @LIBS@ -lc
-
- # SunOS 4 users might wish to add '-fpcc-struct-return' to CFLAGS. see INSTALL.
--CFLAGS = -O
--LDFLAGS =
-+CPPFLAGS = @CPPFLAGS@
-+CFLAGS = @CFLAGS@
-+LDFLAGS = @LDFLAGS@
-
- # Common prefix for installation directories
--prefix = /usr/local
-+prefix = /usr
- exec_prefix = $(prefix)
- mandir = $(prefix)/man
-
- # Directory in which to put libgdbm.a.
--libdir = $(exec_prefix)/lib
-+libdir = $(prefix)/lib
- # The include directory for gdbm.h and dbm.h.
- includedir = $(prefix)/include
- # Info and man directories.
+++ /dev/null
---- gdbm-1.8.0/Makefile.in.fhs Mon Jun 5 15:12:15 2000
-+++ gdbm-1.8.0/Makefile.in Mon Jun 5 15:16:34 2000
-@@ -14,10 +14,6 @@
- INSTALL_PROGRAM = @INSTALL_PROGRAM@
- INSTALL_DATA = @INSTALL_DATA@
-
--# File ownership and group
--BINOWN = bin
--BINGRP = bin
--
- MAKEINFO = makeinfo
- TEXI2DVI = texi2dvi
-
-@@ -33,8 +29,7 @@
- # Common prefix for installation directories
- prefix = /usr/local
- exec_prefix = $(prefix)
--binprefix = $(exec_prefix)
--manprefix = $(prefix)
-+mandir = $(prefix)/man
-
- # Directory in which to put libgdbm.a.
- libdir = $(exec_prefix)/lib
-@@ -42,7 +37,7 @@
- includedir = $(prefix)/include
- # Info and man directories.
- infodir = $(prefix)/info
--man3dir = $(prefix)/man/man3
-+man3dir = $(mandir)/man3
- manext = 3
-
- #### End of system configuration section. ####
-@@ -122,18 +117,14 @@
- install: libgdbm.la gdbm.h gdbm.info
- $(srcdir)/mkinstalldirs $(libdir) $(includedir) $(man3dir) $(infodir)
- $(LIBTOOL) install -c libgdbm.la $(libdir)/libgdbm.la
-- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) gdbm.h $(includedir)/gdbm.h
-- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.3 \
-- $(man3dir)/gdbm.3
-- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/gdbm.info \
-- $(infodir)/gdbm.info
-+ $(INSTALL_DATA) gdbm.h $(includedir)/gdbm.h
-+ $(INSTALL_DATA) $(srcdir)/gdbm.3 $(man3dir)/gdbm.3
-+ $(INSTALL_DATA) $(srcdir)/gdbm.info $(infodir)/gdbm.info
-
- install-compat:
- $(srcdir)/mkinstalldirs $(includedir)
-- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/dbm.h \
-- $(includedir)/dbm.h
-- $(INSTALL_DATA) -o $(BINOWN) -g $(BINGRP) $(srcdir)/ndbm.h \
-- $(includedir)/ndbm.h
-+ $(INSTALL_DATA) $(srcdir)/dbm.h $(includedir)/dbm.h
-+ $(INSTALL_DATA) $(srcdir)/ndbm.h $(includedir)/ndbm.h
-
- #libgdbm.a: $(OBJS) gdbm.h
- # rm -f libgdbm.a
+++ /dev/null
---- gdbm-1.8.0/gdbmopen.c.jbj Tue Aug 10 10:57:38 1999
-+++ gdbm-1.8.0/gdbmopen.c Tue Aug 10 10:59:06 1999
-@@ -214,7 +214,7 @@
- file_block_size = block_size;
-
- /* Get space for the file header. */
-- dbf->header = (gdbm_file_header *) malloc (file_block_size);
-+ dbf->header = (gdbm_file_header *) calloc (1, file_block_size);
- if (dbf->header == NULL)
- {
- gdbm_close (dbf);
+++ /dev/null
-diff -urN gdbm-1.8.0.orig/configure.in gdbm-1.8.0.flock/configure.in
---- gdbm-1.8.0.orig/configure.in 1999-05-19 01:17:02.000000000 +0100
-+++ gdbm-1.8.0.flock/configure.in 2008-10-03 16:55:30.000000000 +0100
-@@ -5,6 +5,7 @@
- AC_PROG_CC
- AC_PROG_CPP
- AC_PROG_INSTALL
-+AC_LIBTOOL_WIN32_DLL
- AM_PROG_LIBTOOL
- dnl AC_PROG_RANLIB
- dnl AC_WORDS_BIGENDIAN
-@@ -13,8 +14,8 @@
- AC_HAVE_HEADERS(memory.h)
- AC_CHECK_LIB(dbm, main)
- AC_CHECK_LIB(ndbm, main)
--AC_HAVE_FUNCS(rename ftruncate flock bcopy fsync)
--AC_REPLACE_FUNCS(getopt)
-+AC_HAVE_FUNCS(rename ftruncate bcopy)
-+AC_REPLACE_FUNCS(flock fsync getopt)
- AC_OFF_T
- AC_ST_BLKSIZE
- AC_OUTPUT(Makefile)
-diff -urN gdbm-1.8.0.orig/dbminit.c gdbm-1.8.0.flock/dbminit.c
---- gdbm-1.8.0.orig/dbminit.c 1999-05-19 01:16:05.000000000 +0100
-+++ gdbm-1.8.0.flock/dbminit.c 2008-10-03 17:07:20.000000000 +0100
-@@ -91,6 +91,7 @@
- }
- }
-
-+#if (!defined _WIN32 && !defined __WIN32__) || defined __CYGWIN__
- /* If the database is new, link "file.dir" to "file.pag". This is done
- so the time stamp on both files is the same. */
- if (stat (dir_file, &dir_stat) == 0)
-@@ -116,6 +117,7 @@
- goto done;
- }
- }
-+#endif
-
- ret = 0;
-
-diff -urN gdbm-1.8.0.orig/dbmopen.c gdbm-1.8.0.flock/dbmopen.c
---- gdbm-1.8.0.orig/dbmopen.c 1999-05-19 01:16:05.000000000 +0100
-+++ gdbm-1.8.0.flock/dbmopen.c 2008-10-03 17:07:33.000000000 +0100
-@@ -105,6 +105,7 @@
- goto done;
- }
-
-+#if (!defined _WIN32 && !defined __WIN32__) || defined __CYGWIN__
- /* If the database is new, link "file.dir" to "file.pag". This is done
- so the time stamp on both files is the same. */
- if (stat (dir_file, &dir_stat) == 0)
-@@ -130,6 +131,7 @@
- goto done;
- }
- }
-+#endif
-
- done:
- free (pag_file);
-diff -urN gdbm-1.8.0.orig/flock.c gdbm-1.8.0.flock/flock.c
---- gdbm-1.8.0.orig/flock.c 1970-01-01 01:00:00.000000000 +0100
-+++ gdbm-1.8.0.flock/flock.c 2008-10-03 17:02:01.000000000 +0100
-@@ -0,0 +1,212 @@
-+/* Emulate flock on platforms that lack it, primarily Windows and MinGW.
-+
-+ This is derived from sqlite3 sources.
-+ http://www.sqlite.org/cvstrac/rlog?f=sqlite/src/os_win.c
-+ http://www.sqlite.org/copyright.html
-+
-+ Written by Richard W.M. Jones <rjones.at.redhat.com>
-+
-+ Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+ This library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ This library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <autoconf.h>
-+#include "systems.h"
-+
-+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-+
-+/* _get_osfhandle */
-+#include <io.h>
-+
-+/* LockFileEx */
-+#define WIN32_LEAN_AND_MEAN
-+#include <windows.h>
-+
-+#include <errno.h>
-+
-+/* Determine the current size of a file. Because the other braindead
-+ * APIs we'll call need lower/upper 32 bit pairs, keep the file size
-+ * like that too.
-+ */
-+static BOOL
-+file_size (HANDLE h, DWORD * lower, DWORD * upper)
-+{
-+ *lower = GetFileSize (h, upper);
-+ return 1;
-+}
-+
-+/* LOCKFILE_FAIL_IMMEDIATELY is undefined on some Windows systems. */
-+#ifndef LOCKFILE_FAIL_IMMEDIATELY
-+# define LOCKFILE_FAIL_IMMEDIATELY 1
-+#endif
-+
-+/* Acquire a lock. */
-+static BOOL
-+do_lock (HANDLE h, int non_blocking, int exclusive)
-+{
-+ BOOL res;
-+ DWORD size_lower, size_upper;
-+ OVERLAPPED ovlp;
-+ int flags = 0;
-+
-+ /* We're going to lock the whole file, so get the file size. */
-+ res = file_size (h, &size_lower, &size_upper);
-+ if (!res)
-+ return 0;
-+
-+ /* Start offset is 0, and also zero the remaining members of this struct. */
-+ memset (&ovlp, 0, sizeof ovlp);
-+
-+ if (non_blocking)
-+ flags |= LOCKFILE_FAIL_IMMEDIATELY;
-+ if (exclusive)
-+ flags |= LOCKFILE_EXCLUSIVE_LOCK;
-+
-+ return LockFileEx (h, flags, 0, size_lower, size_upper, &ovlp);
-+}
-+
-+/* Unlock reader or exclusive lock. */
-+static BOOL
-+do_unlock (HANDLE h)
-+{
-+ int res;
-+ DWORD size_lower, size_upper;
-+
-+ res = file_size (h, &size_lower, &size_upper);
-+ if (!res)
-+ return 0;
-+
-+ return UnlockFile (h, 0, 0, size_lower, size_upper);
-+}
-+
-+/* Now our BSD-like flock operation. */
-+int
-+flock (int fd, int operation)
-+{
-+ HANDLE h = (HANDLE) _get_osfhandle (fd);
-+ DWORD res;
-+ int non_blocking;
-+
-+ if (h == INVALID_HANDLE_VALUE)
-+ {
-+ errno = EBADF;
-+ return -1;
-+ }
-+
-+ non_blocking = operation & LOCK_NB;
-+ operation &= ~LOCK_NB;
-+
-+ switch (operation)
-+ {
-+ case LOCK_SH:
-+ res = do_lock (h, non_blocking, 0);
-+ break;
-+ case LOCK_EX:
-+ res = do_lock (h, non_blocking, 1);
-+ break;
-+ case LOCK_UN:
-+ res = do_unlock (h);
-+ break;
-+ default:
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ /* Map Windows errors into Unix errnos. As usual MSDN fails to
-+ * document the permissible error codes.
-+ */
-+ if (!res)
-+ {
-+ DWORD err = GetLastError ();
-+ switch (err)
-+ {
-+ /* This means someone else is holding a lock. */
-+ case ERROR_LOCK_VIOLATION:
-+ errno = EAGAIN;
-+ break;
-+
-+ /* Out of memory. */
-+ case ERROR_NOT_ENOUGH_MEMORY:
-+ errno = ENOMEM;
-+ break;
-+
-+ case ERROR_BAD_COMMAND:
-+ errno = EINVAL;
-+ break;
-+
-+ /* Unlikely to be other errors, but at least don't lose the
-+ * error code.
-+ */
-+ default:
-+ errno = err;
-+ }
-+
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+#else /* !Windows */
-+
-+/* We know how to implement flock in terms of fcntl. */
-+
-+#ifdef HAVE_FCNTL_H
-+#include <fcntl.h>
-+#endif
-+
-+#ifdef HAVE_UNISTD_H
-+#include <unistd.h>
-+#endif
-+
-+int
-+flock (int fd, int operation)
-+{
-+ int cmd, r;
-+ struct flock fl;
-+
-+ if (operation & LOCK_NB)
-+ cmd = F_SETLK;
-+ else
-+ cmd = F_SETLKW;
-+ operation &= ~LOCK_NB;
-+
-+ memset (&fl, 0, sizeof fl);
-+ fl.l_whence = SEEK_SET;
-+ /* l_start & l_len are 0, which as a special case means "whole file". */
-+
-+ switch (operation)
-+ {
-+ case LOCK_SH:
-+ fl.l_type = F_RDLCK;
-+ break;
-+ case LOCK_EX:
-+ fl.l_type = F_WRLCK;
-+ break;
-+ case LOCK_UN:
-+ fl.l_type = F_UNLCK;
-+ break;
-+ default:
-+ errno = EINVAL;
-+ return -1;
-+ }
-+
-+ r = fcntl (fd, cmd, &fl);
-+ if (r == -1 && errno == EACCES)
-+ errno = EAGAIN;
-+
-+ return r;
-+}
-+
-+#endif /* !Windows */
-diff -urN gdbm-1.8.0.orig/fsync.c gdbm-1.8.0.flock/fsync.c
---- gdbm-1.8.0.orig/fsync.c 1970-01-01 01:00:00.000000000 +0100
-+++ gdbm-1.8.0.flock/fsync.c 2008-10-03 17:02:15.000000000 +0100
-@@ -0,0 +1,83 @@
-+/* Emulate fsync on platforms that lack it, primarily Windows and
-+ cross-compilers like MinGW.
-+
-+ This is derived from sqlite3 sources.
-+ http://www.sqlite.org/cvstrac/rlog?f=sqlite/src/os_win.c
-+ http://www.sqlite.org/copyright.html
-+
-+ Written by Richard W.M. Jones <rjones.at.redhat.com>
-+
-+ Copyright (C) 2008 Free Software Foundation, Inc.
-+
-+ This library is free software; you can redistribute it and/or
-+ modify it under the terms of the GNU Lesser General Public
-+ License as published by the Free Software Foundation; either
-+ version 2.1 of the License, or (at your option) any later version.
-+
-+ This library is distributed in the hope that it will be useful,
-+ but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-+ Lesser General Public License for more details.
-+
-+ You should have received a copy of the GNU General Public License
-+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
-+
-+#include <autoconf.h>
-+#include "systems.h"
-+#include <unistd.h>
-+
-+#if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
-+
-+/* _get_osfhandle */
-+#include <io.h>
-+
-+/* FlushFileBuffers */
-+#define WIN32_LEAN_AND_MEAN
-+#include <windows.h>
-+
-+#include <errno.h>
-+
-+int
-+fsync (int fd)
-+{
-+ HANDLE h = (HANDLE) _get_osfhandle (fd);
-+ DWORD err;
-+
-+ if (h == INVALID_HANDLE_VALUE)
-+ {
-+ errno = EBADF;
-+ return -1;
-+ }
-+
-+ if (!FlushFileBuffers (h))
-+ {
-+ /* Translate some Windows errors into rough approximations of Unix
-+ * errors. MSDN is useless as usual - in this case it doesn't
-+ * document the full range of errors.
-+ */
-+ err = GetLastError ();
-+ switch (err)
-+ {
-+ /* eg. Trying to fsync a tty. */
-+ case ERROR_INVALID_HANDLE:
-+ errno = EINVAL;
-+ break;
-+
-+ default:
-+ errno = EIO;
-+ }
-+ return -1;
-+ }
-+
-+ return 0;
-+}
-+
-+#else /* !Windows */
-+
-+int fsync (int fd)
-+{
-+ sync ();
-+ sync ();
-+}
-+
-+#endif /* !Windows */
-diff -urN gdbm-1.8.0.orig/Makefile.in gdbm-1.8.0.flock/Makefile.in
---- gdbm-1.8.0.orig/Makefile.in 2008-10-03 16:32:57.000000000 +0100
-+++ gdbm-1.8.0.flock/Makefile.in 2008-10-03 17:12:25.000000000 +0100
-@@ -20,7 +20,7 @@
- DEFS = @DEFS@
-
- # Where the system [n]dbm routines are...
--LIBS = @LIBS@ -lc
-+LIBS = @LIBS@
-
- # SunOS 4 users might wish to add '-fpcc-struct-return' to CFLAGS. see INSTALL.
- CPPFLAGS = @CPPFLAGS@
-@@ -132,10 +132,10 @@
- # ar q libgdbm.a $(OBJS)
- # $(RANLIB) libgdbm.a
-
--libgdbm.la: $(LOBJS) gdbm.h
-+libgdbm.la: $(LOBJS) @LTLIBOBJS@ gdbm.h
- rm -f libgdbm.la
- $(LIBTOOL) --mode=link $(CC) -o libgdbm.la -rpath $(libdir) \
-- -version-info $(SHLIB_VER) $(LOBJS)
-+ -version-info $(SHLIB_VER) -no-undefined $(LOBJS) @LTLIBOBJS@
-
- gdbm.h: gdbm.proto gdbmerrno.h gdbm.proto2
- rm -f gdbm.h
-@@ -146,19 +146,19 @@
- chmod -w gdbm.h
-
- testgdbm: testgdbm.o libgdbm.la @LIBOBJS@
-- $(LIBTOOL) $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o testgdbm testgdbm.o libgdbm.la @LIBOBJS@
-
- testdbm: testdbm.o libgdbm.la
-- $(LIBTOOL) $(CC) $(LDFLAGS) -o testdbm testdbm.o libgdbm.la
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o testdbm testdbm.o libgdbm.la
-
- tdbm: testdbm.o
-- $(CC) $(LDFLAGS) -o tdbm testdbm.o $(LIBS)
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o tdbm testdbm.o libgdbm.la $(LIBS)
-
- testndbm.o: testndbm.c
- $(CC) -c -I. -I$(srcdir) $(CFLAGS) $(DEFS) -DGNU $(srcdir)/testndbm.c
-
- testndbm: testndbm.o libgdbm.la
-- $(LIBTOOL) $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.la
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o testndbm testndbm.o libgdbm.la
-
- tndbm.o: testndbm.c
- cp $(srcdir)/testndbm.c ./tndbm.c
-@@ -166,10 +166,10 @@
- rm -f ./tndbm.c
-
- tndbm: tndbm.o
-- $(CC) $(LDFLAGS) -o tndbm tndbm.o $(LIBS)
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o tndbm tndbm.o libgdbm.la $(LIBS)
-
- conv2gdbm: conv2gdbm.o libgdbm.la @LIBOBJS@
-- $(LIBTOOL) $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm.la @LIBOBJS@
-+ $(LIBTOOL) --mode=link $(CC) $(LDFLAGS) -o conv2gdbm conv2gdbm.o $(LIBS) libgdbm.la @LIBOBJS@
-
- lintgdbm:
- lint $(DEFS) $(LFLAGS) $(DBM_CF) $(NDBM_CF) $(GDBM_CF) testgdbm.c
-diff -urN gdbm-1.8.0.orig/systems.h gdbm-1.8.0.flock/systems.h
---- gdbm-1.8.0.orig/systems.h 1999-05-19 03:09:46.000000000 +0100
-+++ gdbm-1.8.0.flock/systems.h 2008-10-03 16:54:09.000000000 +0100
-@@ -59,9 +59,9 @@
- #define L_SET SEEK_SET
- #endif
-
--/* Do we have flock? (BSD...) */
--
--#if HAVE_FLOCK
-+#ifndef HAVE_FLOCK
-+extern int flock (int fd, int operation);
-+#endif
-
- #ifndef LOCK_SH
- #define LOCK_SH 1
-@@ -83,36 +83,6 @@
- #define READLOCK_FILE(dbf) lock_val = flock (dbf->desc, LOCK_SH + LOCK_NB)
- #define WRITELOCK_FILE(dbf) lock_val = flock (dbf->desc, LOCK_EX + LOCK_NB)
-
--#else
--
--/* Assume it is done like System V. */
--
--#define UNLOCK_FILE(dbf) \
-- { \
-- struct flock flock; \
-- flock.l_type = F_UNLCK; \
-- flock.l_whence = SEEK_SET; \
-- flock.l_start = flock.l_len = 0L; \
-- fcntl (dbf->desc, F_SETLK, &flock); \
-- }
--#define READLOCK_FILE(dbf) \
-- { \
-- struct flock flock; \
-- flock.l_type = F_RDLCK; \
-- flock.l_whence = SEEK_SET; \
-- flock.l_start = flock.l_len = 0L; \
-- lock_val = fcntl (dbf->desc, F_SETLK, &flock); \
-- }
--#define WRITELOCK_FILE(dbf) \
-- { \
-- struct flock flock; \
-- flock.l_type = F_WRLCK; \
-- flock.l_whence = SEEK_SET; \
-- flock.l_start = flock.l_len = 0L; \
-- lock_val = fcntl (dbf->desc, F_SETLK, &flock); \
-- }
--#endif
--
- /* Do we have bcopy? */
- #if !HAVE_BCOPY
- #if HAVE_MEMORY_H
-@@ -122,9 +92,8 @@
- #define bcopy(d1, d2, n) memcpy(d2, d1, n)
- #endif
-
--/* Do we have fsync? */
--#if !HAVE_FSYNC
--#define fsync(f) {sync(); sync();}
-+#ifndef HAVE_FSYNC
-+extern int fsync (int fd);
- #endif
-
- /* Default block size. Some systems do not have blocksize in their
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-Name: mingw32-gdbm
-Version: 1.8.0
-Release: 1%{?dist}
-Summary: MinGW port of GNU database routines
-
-License: GPLv2+
-Group: Development/Libraries
-URL: http://www.gnu.org/software/gdbm/
-Source0: ftp://ftp.gnu.org/gnu/gdbm/gdbm-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Patch0: gdbm-1.8.0-jbj.patch
-Patch1: gdbm-1.8.0-fhs.patch
-Patch2: gdbm-1.8.0-cflags.patch
-Patch3: gdbm-1.8.0-64offset.patch
-
-Patch100: mingw32-gdbm-1.8.0-windows.patch
-
-BuildArch: noarch
-
-BuildRequires: mingw32-filesystem >= 26
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-binutils
-
-BuildRequires: libtool
-
-
-%description
-Gdbm is a GNU database indexing library, including routines which use
-extensible hashing. Gdbm works in a similar way to standard UNIX dbm
-routines. Gdbm is useful for developers who write C applications and
-need access to a simple and efficient database or who are building C
-applications which will use such a database.
-
-This is the MinGW Windows port of the libraries and development tools.
-
-
-%prep
-%setup -q -n gdbm-%{version}
-%patch0 -p 1 -b .jbj
-%patch1 -p 1 -b .fhs
-%patch2 -p 1 -b .cflags
-%patch3 -p1 -b .offset
-
-%patch100 -p1 -b .windows
-
-
-%build
-libtoolize --force --copy
-aclocal
-autoreconf
-%{_mingw32_configure}
-make libdir=%{_mingw32_libdir} all progs
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make prefix=$RPM_BUILD_ROOT%{_mingw32_prefix} install
-
-# Install the binaries. Arguable whether we really want these.
-install conv2gdbm.exe tdbm.exe testdbm.exe testgdbm.exe testndbm.exe tndbm.exe \
- $RPM_BUILD_ROOT%{_mingw32_bindir}
-
-# Native Fedora package seems to fluff this, but as far as I
-# can tell they are trying to create <gdbm/gdbm.h> which
-# links to <gdbm.h>.
-pushd $RPM_BUILD_ROOT%{_mingw32_includedir}
-mkdir gdbm
-cd gdbm
-ln -s ../gdbm.h
-popd
-
-# Remove the static library.
-rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libgdbm.a
-
-# Remove man page and info file which duplicate what is in native package.
-rm -r $RPM_BUILD_ROOT%{_mingw32_prefix}/man
-rm -r $RPM_BUILD_ROOT%{_mingw32_prefix}/info
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%{_mingw32_bindir}/conv2gdbm.exe
-%{_mingw32_bindir}/tdbm.exe
-%{_mingw32_bindir}/testdbm.exe
-%{_mingw32_bindir}/testgdbm.exe
-%{_mingw32_bindir}/testndbm.exe
-%{_mingw32_bindir}/tndbm.exe
-%{_mingw32_bindir}/libgdbm-2.dll
-%{_mingw32_libdir}/libgdbm.dll.a
-%{_mingw32_libdir}/libgdbm.la
-%{_mingw32_includedir}/gdbm.h
-%{_mingw32_includedir}/gdbm
-
-
-%changelog
-* Fri Oct 3 2008 Richard W.M. Jones <rjones@redhat.com> - 1.8.0-1
-- Initial RPM release.
+++ /dev/null
-See https://bugzilla.redhat.com/show_bug.cgi?id=467398#c3
-
---- ./gettext-tools/woe32dll/gettextlib-exports.c.lfarkas 2008-10-31 11:42:38.000000000 +0100
-+++ ./gettext-tools/woe32dll/gettextlib-exports.c 2008-10-31 11:43:29.000000000 +0100
-@@ -26,7 +26,7 @@
- VARIABLE(gl_array_list_implementation)
- VARIABLE(gl_linkedhash_list_implementation)
- VARIABLE(program_name)
--VARIABLE(rpl_optarg)
--VARIABLE(rpl_optind)
-+/*VARIABLE(rpl_optarg)
-+VARIABLE(rpl_optind)*/
- VARIABLE(simple_backup_suffix)
- VARIABLE(styled_ostream_typeinfo)
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-Name: mingw32-gettext
-Version: 0.17
-Release: 7%{?dist}
-Summary: GNU libraries and utilities for producing multi-lingual messages
-
-License: GPLv2+ and LGPLv2+
-Group: Development/Libraries
-URL: http://www.gnu.org/software/gettext/
-Source0: http://ftp.gnu.org/pub/gnu/gettext/gettext-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Patch0: mingw32-gettext-0.17-gnulib-optarg-symbols.patch
-
-BuildArch: noarch
-
-BuildRequires: mingw32-filesystem >= 23
-BuildRequires: mingw32-runtime >= 3.15.1
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-gcc-c++
-BuildRequires: mingw32-binutils
-BuildRequires: mingw32-iconv
-BuildRequires: mingw32-termcap >= 1.3.1-3
-
-# Possible extra BRs. These are used if available, but
-# not required just for building.
-#BuildRequires: mingw32-dlfcn
-#BuildRequires: mingw32-libxml2
-#BuildRequires: mingw32-expat
-#BuildRequires: mingw32-glib2
-
-
-%description
-MinGW Windows Gettext library
-
-
-%prep
-%setup -q -n gettext-%{version}
-
-%patch0 -p1
-
-
-%build
-%{_mingw32_configure} \
- --disable-java \
- --disable-native-java \
- --disable-csharp \
- --disable-static \
- --enable-threads=win32 \
- --without-emacs
-make %{?_smp_mflags}
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-make DESTDIR=$RPM_BUILD_ROOT install
-rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/locale/locale.alias
-rm -f $RPM_BUILD_ROOT%{_mingw32_libdir}/charset.alias
-rm -f $RPM_BUILD_ROOT%{_mingw32_datadir}/info/dir
-
-# Remove man pages, these are available in base gettext-devel.
-rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man1/
-rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}/man3/
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%doc COPYING
-%{_mingw32_bindir}/autopoint
-%{_mingw32_bindir}/envsubst.exe
-%{_mingw32_bindir}/gettext.exe
-%{_mingw32_bindir}/gettext.sh
-%{_mingw32_bindir}/gettextize
-%{_mingw32_bindir}/libasprintf-0.dll
-%{_mingw32_bindir}/libgettextlib-0-17.dll
-%{_mingw32_bindir}/libgettextpo-0.dll
-%{_mingw32_bindir}/libgettextsrc-0-17.dll
-%{_mingw32_bindir}/libintl-8.dll
-%{_mingw32_bindir}/msg*.exe
-%{_mingw32_bindir}/ngettext.exe
-%{_mingw32_bindir}/recode-sr-latin.exe
-%{_mingw32_bindir}/xgettext.exe
-
-%{_mingw32_includedir}/autosprintf.h
-%{_mingw32_includedir}/gettext-po.h
-%{_mingw32_includedir}/libintl.h
-
-%{_mingw32_libdir}/gettext
-
-%{_mingw32_libdir}/libasprintf.dll.a
-%{_mingw32_libdir}/libasprintf.la
-
-%{_mingw32_libdir}/libgettextlib.dll.a
-%{_mingw32_libdir}/libgettextlib.la
-
-%{_mingw32_libdir}/libgettextpo.dll.a
-%{_mingw32_libdir}/libgettextpo.la
-
-%{_mingw32_libdir}/libgettextsrc.dll.a
-%{_mingw32_libdir}/libgettextsrc.la
-
-%{_mingw32_libdir}/libintl.dll.a
-%{_mingw32_libdir}/libintl.la
-
-%{_mingw32_docdir}/gettext
-%{_mingw32_docdir}/libasprintf/autosprintf_all.html
-
-%{_mingw32_datadir}/gettext/
-
-%{_mingw32_datadir}/aclocal/*m4
-%{_mingw32_datadir}/info/autosprintf.info
-%{_mingw32_datadir}/info/gettext.info
-
-%{_mingw32_datadir}/locale/*/LC_MESSAGES/gettext-tools.mo
-%{_mingw32_datadir}/locale/*/LC_MESSAGES/gettext-runtime.mo
-
-
-%changelog
-* Fri Jan 16 2009 Richard W.M. Jones <rjones@redhat.com> - 0.17-7
-- Remove the manpages - already available in base Fedora gettext-devel.
-- Use _smp_mflags for build.
-- Added list of potential BRs.
-- Added license file to doc section.
-
-* Fri Oct 31 2008 Richard W.M. Jones <rjones@redhat.com> - 0.17-6
-- Add fix for undefined Gnulib symbols (Farkas Levente).
-- Rebuild against mingw32-termcap / libtermcap.
-
-* Wed Sep 24 2008 Richard W.M. Jones <rjones@redhat.com> - 0.17-5
-- Rename mingw -> mingw32.
-
-* Thu Sep 11 2008 Daniel P. Berrange <berrange@redhat.com> - 0.17-4
-- Disable emacs lisp file install
-
-* Thu Sep 10 2008 Richard W.M. Jones <rjones@redhat.com> - 0.17-3
-- Remove static libraries.
-
-* Thu Sep 4 2008 Richard W.M. Jones <rjones@redhat.com> - 0.17-2
-- Use RPM macros from mingw-filesystem.
-
-* Tue Sep 2 2008 Daniel P. Berrange <berrange@redhat.com> - 0.17-1
-- Initial RPM release, largely based on earlier work from several sources.
+++ /dev/null
---- PDCurses-3.4/win32/mingwin32.mak.orig 2008-09-25 15:30:14.000000000 +0100
-+++ PDCurses-3.4/win32/mingwin32.mak 2008-09-25 15:43:50.000000000 +0100
-@@ -30,8 +30,8 @@
-
- CFLAGS += -I$(PDCURSES_SRCDIR)
-
--BASEDEF = $(PDCURSES_SRCDIR)\exp-base.def
--WIDEDEF = $(PDCURSES_SRCDIR)\exp-wide.def
-+BASEDEF = $(PDCURSES_SRCDIR)/exp-base.def
-+WIDEDEF = $(PDCURSES_SRCDIR)/exp-wide.def
-
- DEFDEPS = $(BASEDEF)
-
-@@ -50,7 +50,7 @@
-
- ifeq ($(DLL),Y)
- CFLAGS += -DPDC_DLL_BUILD
-- LIBEXE = gcc $(DEFFILE)
-+ LIBEXE = i686-pc-mingw32-gcc $(DEFFILE)
- LIBFLAGS = -Wl,--out-implib,pdcurses.a -shared -o
- LIBCURSES = pdcurses.dll
- LIBDEPS = $(LIBOBJS) $(PDCOBJS) $(DEFFILE)
-@@ -70,24 +70,24 @@
- libs: $(LIBCURSES)
-
- clean:
-- -del *.o
-- -del *.exe
-- -del $(CLEAN)
-+ -rm *.o
-+ -rm *.exe
-+ -rm $(CLEAN)
-
- demos: $(DEMOS)
-- strip *.exe
-+ i686-pc-mingw32-strip *.exe
-
- $(DEFFILE): $(DEFDEPS)
- echo LIBRARY pdcurses > $@
- echo EXPORTS >> $@
-- type $(BASEDEF) >> $@
-+ cat $(BASEDEF) >> $@
- ifeq ($(WIDE),Y)
-- type $(WIDEDEF) >> $@
-+ cat $(WIDEDEF) >> $@
- endif
-
- $(LIBCURSES) : $(LIBDEPS)
- $(LIBEXE) $(LIBFLAGS) $@ $?
-- -copy pdcurses.a panel.a
-+ -cp pdcurses.a panel.a
-
- $(LIBOBJS) $(PDCOBJS) : $(PDCURSES_HEADERS)
- $(PDCOBJS) : $(PDCURSES_WIN_H)
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-Name: mingw32-pdcurses
-Version: 3.4
-Release: 3%{?dist}
-Summary: Curses library for MinGW
-
-License: Public Domain
-Group: Development/Libraries
-URL: http://pdcurses.sourceforge.net/
-Source0: http://dl.sourceforge.net/sourceforge/pdcurses/PDCurses-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-BuildArch: noarch
-
-Patch0: mingw32-pdcurses-3.4-build.patch
-
-BuildRequires: mingw32-filesystem >= 26
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-binutils
-
-
-%description
-PDCurses is a public domain curses library for DOS, OS/2, Win32, X11
-and SDL, implementing most of the functions available in X/Open and
-System V R4 curses. It supports many compilers for these
-platforms. The X11 port lets you recompile existing text-mode curses
-programs to produce native X11 applications.
-
-Note that ncurses is not available for MinGW / Windows. Applications
-which need curses functionality can use this package, provided they
-don't use any of the extensions specific to ncurses.
-
-
-%prep
-%setup -q -n PDCurses-%{version}
-%patch0 -p1
-
-
-%build
-pushd win32
-make -f mingwin32.mak \
- CC=%{_mingw32_cc} \
- LINK=%{_mingw32_cc} \
- WIDE=Y UTF8=Y DLL=Y
-popd
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-
-mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
-mkdir -p $RPM_BUILD_ROOT%{_mingw32_libdir}
-mkdir -p $RPM_BUILD_ROOT%{_mingw32_includedir}
-
-install win32/*.exe $RPM_BUILD_ROOT%{_mingw32_bindir}
-install win32/pdcurses.dll $RPM_BUILD_ROOT%{_mingw32_bindir}/pdcurses.dll
-install win32/pdcurses.a $RPM_BUILD_ROOT%{_mingw32_libdir}/libpdcurses.dll.a
-install -m 0644 curses.h panel.h term.h $RPM_BUILD_ROOT%{_mingw32_includedir}
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%{_mingw32_bindir}/pdcurses.dll
-%{_mingw32_libdir}/libpdcurses.dll.a
-%{_mingw32_includedir}/curses.h
-%{_mingw32_includedir}/panel.h
-%{_mingw32_includedir}/term.h
-%{_mingw32_bindir}/firework.exe
-%{_mingw32_bindir}/newdemo.exe
-%{_mingw32_bindir}/ptest.exe
-%{_mingw32_bindir}/rain.exe
-%{_mingw32_bindir}/testcurs.exe
-%{_mingw32_bindir}/tuidemo.exe
-%{_mingw32_bindir}/xmas.exe
-%{_mingw32_bindir}/worm.exe
-
-
-%changelog
-* Fri Jan 16 2009 Richard Jones <rjones@redhat.com> - 3.4-3
-- Remove +x permissions on the header files.
-
-* Sat Nov 22 2008 Richard Jones <rjones@redhat.com> - 3.4-2
-- Rename implib to libpdcurses.dll.a so that libtool can use it.
-
-* Thu Sep 25 2008 Richard Jones <rjones@redhat.com> - 3.4-1
-- Initial RPM release.
+++ /dev/null
-%define __strip %{_mingw32_strip}
-%define __objdump %{_mingw32_objdump}
-%define _use_internal_dependency_generator 0
-%define __find_requires %{_mingw32_findrequires}
-%define __find_provides %{_mingw32_findprovides}
-
-Name: mingw32-readline
-Version: 5.2
-Release: 4%{?dist}
-Summary: MinGW port of readline for editing typed command lines
-
-License: GPLv2+
-Group: System Environment/Libraries
-URL: http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html
-Source0: ftp://ftp.gnu.org/gnu/readline/readline-%{version}.tar.gz
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-Patch1: readline-5.2-shlib.patch
-Patch2: readline-5.2-001.patch
-Patch3: readline-5.2-002.patch
-Patch4: readline-5.2-003.patch
-Patch5: readline-5.2-004.patch
-Patch6: readline-5.2-005.patch
-Patch7: readline-5.2-006.patch
-Patch8: readline-5.2-007.patch
-Patch9: readline-5.2-008.patch
-Patch10: readline-5.2-009.patch
-Patch11: readline-5.2-010.patch
-Patch12: readline-5.2-011.patch
-Patch13: readline-5.2-redisplay-sigint.patch
-
-BuildArch: noarch
-
-BuildRequires: mingw32-filesystem >= 29
-BuildRequires: mingw32-gcc
-BuildRequires: mingw32-binutils
-BuildRequires: mingw32-termcap >= 1.3.1-3
-
-
-%description
-The Readline library provides a set of functions that allow users to
-edit command lines. Both Emacs and vi editing modes are available. The
-Readline library includes additional functions for maintaining a list
-of previously-entered command lines for recalling or editing those
-lines, and for performing csh-like history expansion on previous
-commands.
-
-This is a port of the library and development tools to Windows.
-
-
-%prep
-%setup -q -n readline-%{version}
-%patch1 -p1 -b .shlib
-%patch2 -p0 -b .001
-%patch3 -p0 -b .002
-%patch4 -p0 -b .003
-%patch5 -p0 -b .004
-%patch6 -p0 -b .005
-%patch7 -p0 -b .006
-%patch8 -p0 -b .007
-%patch9 -p0 -b .008
-%patch10 -p0 -b .009
-%patch11 -p0 -b .010
-%patch12 -p0 -b .011
-%patch13 -p1 -b .redisplay-sigint
-
-pushd examples
-rm -f rlfe/configure
-iconv -f iso8859-1 -t utf8 -o rl-fgets.c{_,}
-touch -r rl-fgets.c{,_}
-mv -f rl-fgets.c{_,}
-popd
-
-
-%build
-%{_mingw32_configure} --enable-shared
-make SHLIB_LIBS=-ltermcap
-
-# Rebuild the DLLs correctly and create implibs.
-pushd shlib
-%{_mingw32_cc} -shared -o readline.dll -Wl,--out-implib,libreadline.dll.a readline.so vi_mode.so funmap.so keymaps.so parens.so search.so rltty.so complete.so bind.so isearch.so display.so signals.so util.so kill.so undo.so macro.so input.so callback.so terminal.so text.so nls.so misc.so xmalloc.so history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so tilde.so compat.so -ltermcap
-%{_mingw32_cc} -shared -o history.dll -Wl,--out-implib,libhistory.dll.a history.so histexpand.so histfile.so histsearch.so shell.so mbutil.so xmalloc.so
-popd
-
-
-%install
-rm -rf $RPM_BUILD_ROOT
-make DESTDIR=$RPM_BUILD_ROOT install
-
-# Remove the fake .so files and install our DLLs and implibs.
-pushd shlib
-rm $RPM_BUILD_ROOT%{_mingw32_libdir}/lib*.so.*
-mkdir -p $RPM_BUILD_ROOT%{_mingw32_bindir}
-install readline.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
-install libreadline.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
-install history.dll $RPM_BUILD_ROOT%{_mingw32_bindir}
-install libhistory.dll.a $RPM_BUILD_ROOT%{_mingw32_libdir}
-popd
-
-# Don't want the info files or manpages which duplicate the native package.
-rm -rf $RPM_BUILD_ROOT%{_mingw32_mandir}
-rm -rf $RPM_BUILD_ROOT%{_mingw32_infodir}
-
-# Don't want the static library.
-rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libhistory.a
-rm $RPM_BUILD_ROOT%{_mingw32_libdir}/libreadline.a
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-
-%files
-%defattr(-,root,root)
-%{_mingw32_bindir}/readline.dll
-%{_mingw32_bindir}/history.dll
-%{_mingw32_libdir}/libreadline.dll.a
-%{_mingw32_libdir}/libhistory.dll.a
-%{_mingw32_includedir}/readline/
-
-
-%changelog
-* Sat Nov 22 2008 Richard W.M. Jones <rjones@redhat.com> - 5.2-4
-- Rename *.dll.a to lib*.dll.a so that libtool can use these libraries.
-
-* Wed Nov 19 2008 Richard W.M. Jones <rjones@redhat.com> - 5.2-3
-- Fix paths to mandir, infodir.
-
-* Fri Oct 31 2008 Richard W.M. Jones <rjones@redhat.com> - 5.2-2
-- Rebuild against latest termcap.
-
-* Thu Sep 25 2008 Richard W.M. Jones <rjones@redhat.com> - 5.2-1
-- Initial RPM release.
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-001
-
-Bug-Reported-by: ebb9@byu.net
-Bug-Reference-ID: <45540862.9030900@byu.net>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2006-11/msg00017.html
- http://lists.gnu.org/archive/html/bug-bash/2006-11/msg00016.html
-
-Bug-Description:
-
-In some cases, code that is intended to be used in the presence of multibyte
-characters is called when no such characters are present, leading to incorrect
-display position calculations and incorrect redisplay.
-
-Patch:
-
-*** ../readline-5.2/display.c Thu Sep 14 14:20:12 2006
---- display.c Mon Nov 13 17:55:57 2006
-***************
-*** 2381,2384 ****
---- 2409,2414 ----
- if (end <= start)
- return 0;
-+ if (MB_CUR_MAX == 1 || rl_byte_oriented)
-+ return (end - start);
-
- memset (&ps, 0, sizeof (mbstate_t));
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-002
-
-Bug-Reported-by: Magnus Svensson <msvensson@mysql.com>
-Bug-Reference-ID: <45BDC44D.80609@mysql.com>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-01/msg00002.html
-
-Bug-Description:
-
-Readline neglects to reallocate the array it uses to keep track of wrapped
-screen lines when increasing its size. This will eventually result in
-segmentation faults when given sufficiently long input.
-
-Patch:
-
-*** ../readline-5.2-patched/display.c Thu Sep 14 14:20:12 2006
---- display.c Fri Feb 2 20:23:17 2007
-***************
-*** 561,574 ****
---- 561,586 ----
- wrap_offset = prompt_invis_chars_first_line = 0;
- }
-
-+ #if defined (HANDLE_MULTIBYTE)
- #define CHECK_INV_LBREAKS() \
- do { \
- if (newlines >= (inv_lbsize - 2)) \
- { \
- inv_lbsize *= 2; \
- inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
-+ _rl_wrapped_line = (int *)xrealloc (_rl_wrapped_line, inv_lbsize * sizeof (int)); \
- } \
- } while (0)
-+ #else
-+ #define CHECK_INV_LBREAKS() \
-+ do { \
-+ if (newlines >= (inv_lbsize - 2)) \
-+ { \
-+ inv_lbsize *= 2; \
-+ inv_lbreaks = (int *)xrealloc (inv_lbreaks, inv_lbsize * sizeof (int)); \
-+ } \
-+ } while (0)
-+ #endif /* HANDLE_MULTIBYTE */
-
- #if defined (HANDLE_MULTIBYTE)
- #define CHECK_LPOS() \
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-003
-
-Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
-Bug-Reference-ID: <1171795523.8021.18.camel@localhost>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-02/msg00054.html
-
-Bug-Description:
-
-When moving the cursor, bash sometimes misplaces the cursor when the prompt
-contains two or more multibyte characters. The particular circumstance that
-uncovered the problem was having the (multibyte) current directory name in
-the prompt string.
-
-Patch:
-
-*** ../readline-5.2.2/display.c Fri Jan 19 13:34:50 2007
---- display.c Sat Mar 10 17:25:44 2007
-***************
-*** 1745,1749 ****
- {
- dpos = _rl_col_width (data, 0, new);
-! if (dpos > prompt_last_invisible) /* XXX - don't use woff here */
- {
- dpos -= woff;
---- 1745,1752 ----
- {
- dpos = _rl_col_width (data, 0, new);
-! /* Use NEW when comparing against the last invisible character in the
-! prompt string, since they're both buffer indices and DPOS is a
-! desired display position. */
-! if (new > prompt_last_invisible) /* XXX - don't use woff here */
- {
- dpos -= woff;
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-004
-
-Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
-Bug-Reference-ID: <1173636022.7039.36.camel@localhost>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00039.html
-
-Bug-Description:
-
-When restoring the original prompt after finishing an incremental search,
-bash sometimes places the cursor incorrectly if the primary prompt contains
-invisible characters.
-
-Patch:
-
-*** ../readline-5.2.3/display.c Fri Apr 20 13:30:16 2007
---- display.c Fri Apr 20 15:17:01 2007
-***************
-*** 1599,1604 ****
- if (temp > 0)
- {
- _rl_output_some_chars (nfd, temp);
-! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);;
- }
- }
---- 1599,1618 ----
- if (temp > 0)
- {
-+ /* If nfd begins at the prompt, or before the invisible
-+ characters in the prompt, we need to adjust _rl_last_c_pos
-+ in a multibyte locale to account for the wrap offset and
-+ set cpos_adjusted accordingly. */
- _rl_output_some_chars (nfd, temp);
-! if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
-! {
-! _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
-! if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
-! {
-! _rl_last_c_pos -= wrap_offset;
-! cpos_adjusted = 1;
-! }
-! }
-! else
-! _rl_last_c_pos += temp;
- }
- }
-***************
-*** 1608,1613 ****
---- 1622,1639 ----
- if (temp > 0)
- {
-+ /* If nfd begins at the prompt, or before the invisible
-+ characters in the prompt, we need to adjust _rl_last_c_pos
-+ in a multibyte locale to account for the wrap offset and
-+ set cpos_adjusted accordingly. */
- _rl_output_some_chars (nfd, temp);
- _rl_last_c_pos += col_temp; /* XXX */
-+ if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
-+ {
-+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
-+ {
-+ _rl_last_c_pos -= wrap_offset;
-+ cpos_adjusted = 1;
-+ }
-+ }
- }
- lendiff = (oe - old) - (ne - new);
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-005
-
-Bug-Reported-by: Thomas Loeber <ifp@loeber1.de>
-Bug-Reference-ID: <200703082223.08919.ifp@loeber1.de>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-03/msg00036.html
-
-Bug-Description:
-
-When rl_read_key returns -1, indicating that readline's controlling terminal
-has been invalidated for some reason (e.g., receiving a SIGHUP), the error
-status was not reported correctly to the caller. This could cause input
-loops.
-
-Patch:
-
-*** ../readline-5.2/complete.c Fri Jul 28 11:35:49 2006
---- complete.c Tue Mar 13 08:50:16 2007
-***************
-*** 429,433 ****
- if (c == 'n' || c == 'N' || c == RUBOUT)
- return (0);
-! if (c == ABORT_CHAR)
- _rl_abort_internal ();
- if (for_pager && (c == NEWLINE || c == RETURN))
---- 440,444 ----
- if (c == 'n' || c == 'N' || c == RUBOUT)
- return (0);
-! if (c == ABORT_CHAR || c < 0)
- _rl_abort_internal ();
- if (for_pager && (c == NEWLINE || c == RETURN))
-*** ../readline-5.2/input.c Wed Aug 16 15:15:16 2006
---- input.c Wed May 2 16:07:59 2007
-***************
-*** 514,518 ****
- int size;
- {
-! int mb_len = 0;
- size_t mbchar_bytes_length;
- wchar_t wc;
---- 522,526 ----
- int size;
- {
-! int mb_len, c;
- size_t mbchar_bytes_length;
- wchar_t wc;
-***************
-*** 521,531 ****
- memset(&ps, 0, sizeof (mbstate_t));
- memset(&ps_back, 0, sizeof (mbstate_t));
-!
- while (mb_len < size)
- {
- RL_SETSTATE(RL_STATE_MOREINPUT);
-! mbchar[mb_len++] = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
- mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
- if (mbchar_bytes_length == (size_t)(-1))
---- 529,545 ----
- memset(&ps, 0, sizeof (mbstate_t));
- memset(&ps_back, 0, sizeof (mbstate_t));
-!
-! mb_len = 0;
- while (mb_len < size)
- {
- RL_SETSTATE(RL_STATE_MOREINPUT);
-! c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
-+ if (c < 0)
-+ break;
-+
-+ mbchar[mb_len++] = c;
-+
- mbchar_bytes_length = mbrtowc (&wc, mbchar, mb_len, &ps);
- if (mbchar_bytes_length == (size_t)(-1))
-***************
-*** 565,569 ****
- c = first;
- memset (mb, 0, mlen);
-! for (i = 0; i < mlen; i++)
- {
- mb[i] = (char)c;
---- 579,583 ----
- c = first;
- memset (mb, 0, mlen);
-! for (i = 0; c >= 0 && i < mlen; i++)
- {
- mb[i] = (char)c;
-*** ../readline-5.2/isearch.c Mon Dec 26 17:18:53 2005
---- isearch.c Fri Mar 9 14:30:59 2007
-***************
-*** 328,333 ****
-
- f = (rl_command_func_t *)NULL;
-!
-! /* Translate the keys we do something with to opcodes. */
- if (c >= 0 && _rl_keymap[c].type == ISFUNC)
- {
---- 328,340 ----
-
- f = (rl_command_func_t *)NULL;
-!
-! if (c < 0)
-! {
-! cxt->sflags |= SF_FAILED;
-! cxt->history_pos = cxt->last_found_line;
-! return -1;
-! }
-!
-! /* Translate the keys we do something with to opcodes. */
- if (c >= 0 && _rl_keymap[c].type == ISFUNC)
- {
-*** ../readline-5.2/misc.c Mon Dec 26 17:20:46 2005
---- misc.c Fri Mar 9 14:44:11 2007
-***************
-*** 147,150 ****
---- 147,152 ----
- rl_clear_message ();
- RL_UNSETSTATE(RL_STATE_NUMERICARG);
-+ if (key < 0)
-+ return -1;
- return (_rl_dispatch (key, _rl_keymap));
- }
-*** ../readline-5.2/readline.c Wed Aug 16 15:00:36 2006
---- readline.c Fri Mar 9 14:47:24 2007
-***************
-*** 646,649 ****
---- 669,677 ----
- {
- nkey = _rl_subseq_getchar (cxt->okey);
-+ if (nkey < 0)
-+ {
-+ _rl_abort_internal ();
-+ return -1;
-+ }
- r = _rl_dispatch_subseq (nkey, cxt->dmap, cxt->subseq_arg);
- cxt->flags |= KSEQ_DISPATCHED;
-*** ../readline-5.2/text.c Fri Jul 28 11:55:27 2006
---- text.c Sun Mar 25 13:41:38 2007
-***************
-*** 858,861 ****
---- 864,870 ----
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
-+ if (c < 0)
-+ return -1;
-+
- #if defined (HANDLE_SIGNALS)
- if (RL_ISSTATE (RL_STATE_CALLBACK) == 0)
-***************
-*** 1521,1524 ****
---- 1530,1536 ----
- mb_len = _rl_read_mbchar (mbchar, MB_LEN_MAX);
-
-+ if (mb_len <= 0)
-+ return -1;
-+
- if (count < 0)
- return (_rl_char_search_internal (-count, bdir, mbchar, mb_len));
-***************
-*** 1537,1540 ****
---- 1549,1555 ----
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
-+ if (c < 0)
-+ return -1;
-+
- if (count < 0)
- return (_rl_char_search_internal (-count, bdir, c));
-*** ../readline-5.2/vi_mode.c Sat Jul 29 16:42:28 2006
---- vi_mode.c Fri Mar 9 15:02:11 2007
-***************
-*** 887,890 ****
---- 887,897 ----
- c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-+
-+ if (c < 0)
-+ {
-+ *nextkey = 0;
-+ return -1;
-+ }
-+
- *nextkey = c;
-
-***************
-*** 903,906 ****
---- 910,918 ----
- c = rl_read_key (); /* real command */
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-+ if (c < 0)
-+ {
-+ *nextkey = 0;
-+ return -1;
-+ }
- *nextkey = c;
- }
-***************
-*** 1225,1236 ****
- _rl_callback_generic_arg *data;
- {
- #if defined (HANDLE_MULTIBYTE)
-! _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
- #else
- RL_SETSTATE(RL_STATE_MOREINPUT);
-! _rl_vi_last_search_char = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
- #endif
-
- _rl_callback_func = 0;
- _rl_want_redisplay = 1;
---- 1243,1262 ----
- _rl_callback_generic_arg *data;
- {
-+ int c;
- #if defined (HANDLE_MULTIBYTE)
-! c = _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
- #else
- RL_SETSTATE(RL_STATE_MOREINPUT);
-! c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
- #endif
-
-+ if (c <= 0)
-+ return -1;
-+
-+ #if !defined (HANDLE_MULTIBYTE)
-+ _rl_vi_last_search_char = c;
-+ #endif
-+
- _rl_callback_func = 0;
- _rl_want_redisplay = 1;
-***************
-*** 1248,1251 ****
---- 1274,1278 ----
- int count, key;
- {
-+ int c;
- #if defined (HANDLE_MULTIBYTE)
- static char *target;
-***************
-*** 1294,1302 ****
- {
- #if defined (HANDLE_MULTIBYTE)
-! _rl_vi_last_search_mblen = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
- #else
- RL_SETSTATE(RL_STATE_MOREINPUT);
-! _rl_vi_last_search_char = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
- #endif
- }
---- 1321,1335 ----
- {
- #if defined (HANDLE_MULTIBYTE)
-! c = _rl_read_mbchar (_rl_vi_last_search_mbchar, MB_LEN_MAX);
-! if (c <= 0)
-! return -1;
-! _rl_vi_last_search_mblen = c;
- #else
- RL_SETSTATE(RL_STATE_MOREINPUT);
-! c = rl_read_key ();
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-+ if (c < 0)
-+ return -1;
-+ _rl_vi_last_search_char = c;
- #endif
- }
-***************
-*** 1468,1471 ****
---- 1501,1507 ----
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
-+ if (c < 0)
-+ return -1;
-+
- #if defined (HANDLE_MULTIBYTE)
- if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
-***************
-*** 1486,1489 ****
---- 1522,1528 ----
- _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
-
-+ if (c < 0)
-+ return -1;
-+
- _rl_callback_func = 0;
- _rl_want_redisplay = 1;
-***************
-*** 1517,1520 ****
---- 1556,1562 ----
- _rl_vi_last_replacement = c = _rl_vi_callback_getchar (mb, MB_LEN_MAX);
-
-+ if (c < 0)
-+ return -1;
-+
- return (_rl_vi_change_char (count, c, mb));
- }
-***************
-*** 1651,1655 ****
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
-! if (ch < 'a' || ch > 'z')
- {
- rl_ding ();
---- 1693,1697 ----
- RL_UNSETSTATE(RL_STATE_MOREINPUT);
-
-! if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */
- {
- rl_ding ();
-***************
-*** 1703,1707 ****
- return 0;
- }
-! else if (ch < 'a' || ch > 'z')
- {
- rl_ding ();
---- 1745,1749 ----
- return 0;
- }
-! else if (ch < 0 || ch < 'a' || ch > 'z') /* make test against 0 explicit */
- {
- rl_ding ();
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-006
-
-Bug-Reported-by: Peter Volkov <torre_cremata@mail.ru>
-Bug-Reference-ID: <1178376645.9063.25.camel@localhost>
-Bug-Reference-URL: http://bugs.gentoo.org/177095
-
-Bug-Description:
-
-The readline display code miscalculated the screen position when performing
-a redisplay in which the new text occupies more screen space that the old,
-but takes fewer bytes to do so (e.g., when replacing a shorter string
-containing multibyte characters with a longer one containing only ASCII).
-
-Patch:
-
-*** ../readline-5.2/display.c Thu Apr 26 11:38:22 2007
---- display.c Thu Jul 12 23:10:10 2007
-***************
-*** 1519,1527 ****
- /* Non-zero if we're increasing the number of lines. */
- int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
- /* Sometimes it is cheaper to print the characters rather than
- use the terminal's capabilities. If we're growing the number
- of lines, make sure we actually cause the new line to wrap
- around on auto-wrapping terminals. */
-! if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
- {
- /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
---- 1568,1596 ----
- /* Non-zero if we're increasing the number of lines. */
- int gl = current_line >= _rl_vis_botlin && inv_botlin > _rl_vis_botlin;
-+ /* If col_lendiff is > 0, implying that the new string takes up more
-+ screen real estate than the old, but lendiff is < 0, meaning that it
-+ takes fewer bytes, we need to just output the characters starting
-+ from the first difference. These will overwrite what is on the
-+ display, so there's no reason to do a smart update. This can really
-+ only happen in a multibyte environment. */
-+ if (lendiff < 0)
-+ {
-+ _rl_output_some_chars (nfd, temp);
-+ _rl_last_c_pos += _rl_col_width (nfd, 0, temp);
-+ /* If nfd begins before any invisible characters in the prompt,
-+ adjust _rl_last_c_pos to account for wrap_offset and set
-+ cpos_adjusted to let the caller know. */
-+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
-+ {
-+ _rl_last_c_pos -= wrap_offset;
-+ cpos_adjusted = 1;
-+ }
-+ return;
-+ }
- /* Sometimes it is cheaper to print the characters rather than
- use the terminal's capabilities. If we're growing the number
- of lines, make sure we actually cause the new line to wrap
- around on auto-wrapping terminals. */
-! else if (_rl_terminal_can_insert && ((2 * col_temp) >= col_lendiff || _rl_term_IC) && (!_rl_term_autowrap || !gl))
- {
- /* If lendiff > prompt_visible_length and _rl_last_c_pos == 0 and
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-007
-
-Bug-Reported-by: Tom Bjorkholm <tom.bjorkholm@ericsson.com>
-Bug-Reference-ID: <AEA1A32F001C6B4F98614B5B80D7647D01C075E9@esealmw115.eemea.ericsson.se>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-04/msg00004.html
-
-
-Bug-Description:
-
-An off-by-one error in readline's input buffering caused readline to drop
-each 511th character of buffered input (e.g., when pasting a large amount
-of data into a terminal window).
-
-Patch:
-
-*** ../readline-5.2/input.c Wed Aug 16 15:15:16 2006
---- input.c Tue Jul 17 09:24:21 2007
-***************
-*** 134,139 ****
-
- *key = ibuffer[pop_index++];
-!
- if (pop_index >= ibuffer_len)
- pop_index = 0;
-
---- 134,142 ----
-
- *key = ibuffer[pop_index++];
-! #if 0
- if (pop_index >= ibuffer_len)
-+ #else
-+ if (pop_index > ibuffer_len)
-+ #endif
- pop_index = 0;
-
-***************
-*** 251,255 ****
- {
- k = (*rl_getc_function) (rl_instream);
-! rl_stuff_char (k);
- if (k == NEWLINE || k == RETURN)
- break;
---- 254,259 ----
- {
- k = (*rl_getc_function) (rl_instream);
-! if (rl_stuff_char (k) == 0)
-! break; /* some problem; no more room */
- if (k == NEWLINE || k == RETURN)
- break;
-***************
-*** 374,378 ****
---- 378,386 ----
- }
- ibuffer[push_index++] = key;
-+ #if 0
- if (push_index >= ibuffer_len)
-+ #else
-+ if (push_index > ibuffer_len)
-+ #endif
- push_index = 0;
-
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-008
-
-Bug-Reported-by: dAniel hAhler <ubuntu@thequod.de>
-Bug-Reference-ID: <4702ED8A.5000503@thequod.de>
-Bug-Reference-URL: https://bugs.launchpad.net/ubuntu/+source/bash/+bug/119938
-
-Bug-Description:
-
-When updating the display after displaying, for instance, a list of possible
-completions, readline will place the cursor at the wrong position if the
-prompt contains invisible characters and a newline.
-
-Patch:
-
-*** ../readline-5.2-patched/display.c Mon Aug 6 14:26:29 2007
---- display.c Wed Oct 10 22:43:58 2007
-***************
-*** 1049,1053 ****
- else
- tx = nleft;
-! if (_rl_last_c_pos > tx)
- {
- _rl_backspace (_rl_last_c_pos - tx); /* XXX */
---- 1049,1053 ----
- else
- tx = nleft;
-! if (tx >= 0 && _rl_last_c_pos > tx)
- {
- _rl_backspace (_rl_last_c_pos - tx); /* XXX */
-***************
-*** 1205,1209 ****
- {
- register char *ofd, *ols, *oe, *nfd, *nls, *ne;
-! int temp, lendiff, wsatend, od, nd;
- int current_invis_chars;
- int col_lendiff, col_temp;
---- 1205,1209 ----
- {
- register char *ofd, *ols, *oe, *nfd, *nls, *ne;
-! int temp, lendiff, wsatend, od, nd, o_cpos;
- int current_invis_chars;
- int col_lendiff, col_temp;
-***************
-*** 1466,1469 ****
---- 1466,1471 ----
- }
-
-+ o_cpos = _rl_last_c_pos;
-+
- /* When this function returns, _rl_last_c_pos is correct, and an absolute
- cursor postion in multibyte mode, but a buffer index when not in a
-***************
-*** 1475,1479 ****
- invisible characters in the prompt string. Let's see if setting this when
- we make sure we're at the end of the drawn prompt string works. */
-! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 && _rl_last_c_pos == prompt_physical_chars)
- cpos_adjusted = 1;
- #endif
---- 1477,1483 ----
- invisible characters in the prompt string. Let's see if setting this when
- we make sure we're at the end of the drawn prompt string works. */
-! if (current_line == 0 && MB_CUR_MAX > 1 && rl_byte_oriented == 0 &&
-! (_rl_last_c_pos > 0 || o_cpos > 0) &&
-! _rl_last_c_pos == prompt_physical_chars)
- cpos_adjusted = 1;
- #endif
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-009
-
-Bug-Reported-by: dAniel hAhler <ubuntu@thequod.de>
-Bug-Reference-ID:
-Bug-Reference-URL:
-
-Bug-Description:
-
-Under some circumstances, readline will incorrectly display a prompt string
-containing invisible characters after the final newline.
-
-Patch:
-
-*** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400
---- display.c 2007-11-10 17:51:29.000000000 -0500
-***************
-*** 392,396 ****
- local_prompt = expand_prompt (p, &prompt_visible_length,
- &prompt_last_invisible,
-! (int *)NULL,
- &prompt_physical_chars);
- c = *t; *t = '\0';
---- 420,424 ----
- local_prompt = expand_prompt (p, &prompt_visible_length,
- &prompt_last_invisible,
-! &prompt_invis_chars_first_line,
- &prompt_physical_chars);
- c = *t; *t = '\0';
-***************
-*** 399,403 ****
- local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
- (int *)NULL,
-! &prompt_invis_chars_first_line,
- (int *)NULL);
- *t = c;
---- 427,431 ----
- local_prompt_prefix = expand_prompt (prompt, &prompt_prefix_length,
- (int *)NULL,
-! (int *)NULL,
- (int *)NULL);
- *t = c;
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-010
-
-Bug-Reported-by: Miroslav Lichvar <mlichvar@redhat.com>
-Bug-Reference-ID: Fri, 02 Nov 2007 14:07:45 +0100
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-readline/2007-11/msg00000.html
-
-Bug-Description:
-
-In certain cases when outputting characters at the end of the line,
-e.g., when displaying the prompt string, readline positions the cursor
-incorrectly if the prompt string contains invisible characters and the
-text being drawn begins before the last invisible character in the line.
-
-Patch:
-
-*** ../readline-5.2-patched/display.c 2007-08-25 13:47:08.000000000 -0400
---- display.c 2007-11-10 17:51:29.000000000 -0500
-***************
-*** 1566,1574 ****
- else
- {
-- /* We have horizontal scrolling and we are not inserting at
-- the end. We have invisible characters in this line. This
-- is a dumb update. */
- _rl_output_some_chars (nfd, temp);
- _rl_last_c_pos += col_temp;
- return;
- }
---- 1619,1632 ----
- else
- {
- _rl_output_some_chars (nfd, temp);
- _rl_last_c_pos += col_temp;
-+ /* If nfd begins before any invisible characters in the prompt,
-+ adjust _rl_last_c_pos to account for wrap_offset and set
-+ cpos_adjusted to let the caller know. */
-+ if (current_line == 0 && wrap_offset && ((nfd - new) <= prompt_last_invisible))
-+ {
-+ _rl_last_c_pos -= wrap_offset;
-+ cpos_adjusted = 1;
-+ }
- return;
- }
+++ /dev/null
- READLINE PATCH REPORT
- =====================
-
-Readline-Release: 5.2
-Patch-ID: readline52-011
-
-Bug-Reported-by: Uwe Doering <gemini@geminix.org>
-Bug-Reference-ID: <46F3DD72.2090801@geminix.org>
-Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2007-09/msg00102.html
-
-Bug-Description:
-
-There is an off-by-one error in the code that buffers characters received
-very quickly in succession, causing characters to be dropped.
-
-Patch:
-
-*** ../readline-5.2-patched/input.c 2007-08-25 13:47:10.000000000 -0400
---- input.c 2007-10-12 22:55:25.000000000 -0400
-***************
-*** 155,159 ****
- pop_index--;
- if (pop_index < 0)
-! pop_index = ibuffer_len - 1;
- ibuffer[pop_index] = key;
- return (1);
---- 155,159 ----
- pop_index--;
- if (pop_index < 0)
-! pop_index = ibuffer_len;
- ibuffer[pop_index] = key;
- return (1);
+++ /dev/null
-GDB PR 544: gdb.cp/annota2.exp and gdb.cp/annota3.exp sometimes FAIL with:
- FAIL: gdb.cp/annota3.exp: annotate-quit (pattern 1)
-
-One can put `sleep (1)' at the end of _RL_OUTPUT_SOME_CHARS and type
- p 1<enter><ctrl-c>
-to abort the prompt printing. Before the patch:
- (gdb) p 1
- $1 = 1
- Quit) (gdb)
- (gdb) _
-After the patch:
- [bash]jkratoch@host0.dyn.jankratochvil.net:/home/jkratoch/redhat/sources/readline# ../gdb/gdb -nx -silent(gdb) p 1
- $1 = 1
- (gdb) Quit
- (gdb) _
-
-The readline patch posted upstream:
- http://sourceware.org/ml/gdb-patches/2008-03/msg00317.html
-
-On Fri, 21 Mar 2008 19:37:31 +0100, Chet Ramey wrote:
-> I will add something like your block_sigint/release_sigint changes around
-> the guts of rl_redisplay. That's the right thing to do anyway. It will
-> probably not come out as a patch for readline-5.2; you can use your
-> current patch (though the names will change to _rl_block_sigint and
-> _rl_release_sigint -- fair warning).
-
-Application cannot easily supply its own RL_REDISPLAY_FUNCTION as a custom
-function there changes the readline behavior:
- http://sourceware.org/ml/gdb-patches/2008-03/msg00340.html
-
-BLOCK_SIGINT / RELEASE_SIGINT: Make it public and prefix it by `_rl_'.
-RL_REDISPLAY: Wrap it by _RL_BLOCK_SIGINT / _RL_RELEASE_SIGINT.
-
---- readline-5.2-orig/display.c 2008-03-23 20:52:12.000000000 +0100
-+++ readline-5.2/display.c 2008-03-23 20:56:58.000000000 +0100
-@@ -472,6 +472,10 @@ rl_redisplay ()
- if (!readline_echoing_p)
- return;
-
-+ /* Signals are blocked through this function as the global data structures
-+ could get corrupted upon modifications from an invoked signal handler. */
-+ _rl_block_sigint ();
-+
- if (!rl_display_prompt)
- rl_display_prompt = "";
-
-@@ -1180,6 +1184,8 @@ rl_redisplay ()
- else
- visible_wrap_offset = wrap_offset;
- }
-+
-+ _rl_release_sigint ();
- }
-
- /* PWP: update_line() is based on finding the middle difference of each
---- readline-5.2-orig/rltty.c 2005-12-26 23:21:50.000000000 +0100
-+++ readline-5.2/rltty.c 2008-03-23 20:57:26.000000000 +0100
-@@ -52,8 +52,8 @@ extern int errno;
- rl_vintfunc_t *rl_prep_term_function = rl_prep_terminal;
- rl_voidfunc_t *rl_deprep_term_function = rl_deprep_terminal;
-
--static void block_sigint PARAMS((void));
--static void release_sigint PARAMS((void));
-+void _rl_block_sigint PARAMS((void));
-+void _rl_release_sigint PARAMS((void));
-
- static void set_winsize PARAMS((int));
-
-@@ -74,9 +74,9 @@ static int sigint_oldmask;
- static int sigint_blocked;
-
- /* Cause SIGINT to not be delivered until the corresponding call to
-- release_sigint(). */
--static void
--block_sigint ()
-+ _rl_release_sigint(). */
-+void
-+_rl_block_sigint ()
- {
- if (sigint_blocked)
- return;
-@@ -100,8 +100,8 @@ block_sigint ()
- }
-
- /* Allow SIGINT to be delivered. */
--static void
--release_sigint ()
-+void
-+_rl_release_sigint ()
- {
- if (sigint_blocked == 0)
- return;
-@@ -663,7 +663,7 @@ rl_prep_terminal (meta_flag)
- return;
-
- /* Try to keep this function from being INTerrupted. */
-- block_sigint ();
-+ _rl_block_sigint ();
-
- tty = fileno (rl_instream);
-
-@@ -676,7 +676,7 @@ rl_prep_terminal (meta_flag)
- if (errno == ENOTTY)
- #endif
- readline_echoing_p = 1; /* XXX */
-- release_sigint ();
-+ _rl_release_sigint ();
- return;
- }
-
-@@ -711,7 +711,7 @@ rl_prep_terminal (meta_flag)
-
- if (set_tty_settings (tty, &tio) < 0)
- {
-- release_sigint ();
-+ _rl_release_sigint ();
- return;
- }
-
-@@ -722,7 +722,7 @@ rl_prep_terminal (meta_flag)
- terminal_prepped = 1;
- RL_SETSTATE(RL_STATE_TERMPREPPED);
-
-- release_sigint ();
-+ _rl_release_sigint ();
- }
-
- /* Restore the terminal's normal settings and modes. */
-@@ -735,7 +735,7 @@ rl_deprep_terminal ()
- return;
-
- /* Try to keep this function from being interrupted. */
-- block_sigint ();
-+ _rl_block_sigint ();
-
- tty = fileno (rl_instream);
-
-@@ -746,14 +746,14 @@ rl_deprep_terminal ()
-
- if (set_tty_settings (tty, &otio) < 0)
- {
-- release_sigint ();
-+ _rl_release_sigint ();
- return;
- }
-
- terminal_prepped = 0;
- RL_UNSETSTATE(RL_STATE_TERMPREPPED);
-
-- release_sigint ();
-+ _rl_release_sigint ();
- }
- #endif /* !NO_TTY_DRIVER */
- \f
---- readline-5.2-orig/rltty.h 2003-02-01 04:43:11.000000000 +0100
-+++ readline-5.2/rltty.h 2008-03-23 20:57:30.000000000 +0100
-@@ -79,4 +79,7 @@ typedef struct _rl_tty_chars {
- unsigned char t_status;
- } _RL_TTY_CHARS;
-
-+extern void _rl_block_sigint PARAMS((void));
-+extern void _rl_release_sigint PARAMS((void));
-+
- #endif /* _RLTTY_H_ */
+++ /dev/null
---- readline-5.2/support/shlib-install.shlib 2006-01-03 20:06:27.000000000 +0100
-+++ readline-5.2/support/shlib-install 2006-11-13 13:51:02.000000000 +0100
-@@ -71,7 +71,7 @@
- case "$host_os" in
- hpux*|darwin*|macosx*|linux*)
- if [ -z "$uninstall" ]; then
-- chmod 555 ${INSTALLDIR}/${LIBNAME}
-+ chmod 755 ${INSTALLDIR}/${LIBNAME}
- fi ;;
- cygwin*)
- IMPLIBNAME=`echo ${LIBNAME} \
---- readline-5.2/support/shobj-conf.shlib 2006-04-11 15:15:43.000000000 +0200
-+++ readline-5.2/support/shobj-conf 2007-03-15 14:11:36.000000000 +0100
-@@ -108,10 +108,11 @@
- linux*-*|gnu*-*|k*bsd*-gnu-*)
- SHOBJ_CFLAGS=-fPIC
- SHOBJ_LD='${CC}'
-- SHOBJ_LDFLAGS='-shared -Wl,-soname,$@'
-+ SHOBJ_LDFLAGS='$(CFLAGS) -shared -Wl,-soname,$@'
-
-- SHLIB_XLDFLAGS='-Wl,-rpath,$(libdir) -Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
-+ SHLIB_XLDFLAGS='-Wl,-soname,`basename $@ $(SHLIB_MINOR)`'
- SHLIB_LIBVERSION='$(SHLIB_LIBSUFF).$(SHLIB_MAJOR)$(SHLIB_MINOR)'
-+ SHLIB_LIBS='-ltinfo'
- ;;
-
- freebsd2* | netbsd*)
---- readline-5.2/shlib/Makefile.in.shlib 2005-08-12 05:56:10.000000000 +0200
-+++ readline-5.2/shlib/Makefile.in 2007-11-05 18:59:14.000000000 +0100
-@@ -168,7 +168,7 @@ $(SHARED_READLINE): $(SHARED_OBJ)
-
- $(SHARED_HISTORY): $(SHARED_HISTOBJ) xmalloc.so
- $(RM) $@
-- $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) xmalloc.so $(SHLIB_LIBS)
-+ $(SHOBJ_LD) ${SHOBJ_LDFLAGS} ${SHLIB_XLDFLAGS} -o $@ $(SHARED_HISTOBJ) xmalloc.so
-
- # Since tilde.c is shared between readline and bash, make sure we compile
- # it with the right flags when it's built as part of readline