wok-next rev 20661

Unification of the patch system
author Aleksej Bobylev <al.bobylev@gmail.com>
date Thu May 10 21:12:00 2018 +0300 (2018-05-10)
parents c7b121a4ffd9
children c466d255e4b3
files barcode/receipt barcode/stuff/barcode.patch barcode/stuff/patches/barcode.patch barcode/stuff/patches/series blackbox/receipt blackbox/stuff/blackbox-0.70.1-asneeded.patch blackbox/stuff/blackbox-0.70.1-gcc-4.3.patch blackbox/stuff/patches/blackbox-0.70.1-asneeded.patch blackbox/stuff/patches/blackbox-0.70.1-gcc-4.3.patch blackbox/stuff/patches/series blackbox/stuff/patches/textpropertytostring-unconditional.patch blackbox/stuff/textpropertytostring-unconditional.patch buffer/receipt buffer/stuff/buffer-1.19.patch buffer/stuff/patches/buffer-1.19.patch buffer/stuff/patches/series cdrdao/receipt cdrdao/stuff/cdrdao-1.2.3-stat.patch cdrdao/stuff/patches/cdrdao-1.2.3-stat.patch cdrdao/stuff/patches/series cdrkit/stuff/cdrkit-1.1.9-glibc-2.10.patch clementine/receipt clementine/stuff/patches/series clementine/stuff/patches/udisks-namespace.patch clementine/stuff/udisks-namespace.patch clisp/receipt clisp/stuff/patches/series clisp/stuff/patches/streams.tst.patch clisp/stuff/streams.tst.patch cmark-gfm/receipt cmark-gfm/stuff/cmark-0.27.1.76.patch cmark-gfm/stuff/patches/cmark-0.27.1.76.patch cmark-gfm/stuff/patches/series codeblocks/receipt codeblocks/stuff/glib.u codeblocks/stuff/patches/glib.u codeblocks/stuff/patches/series comical/receipt comical/stuff/comical-0.8_wx-2.8.patch comical/stuff/patches/comical-0.8_wx-2.8.patch comical/stuff/patches/series cryptkeeper/receipt cryptkeeper/stuff/cryptkeeper.patch cryptkeeper/stuff/patches/cryptkeeper.patch cryptkeeper/stuff/patches/series csstidy/receipt csstidy/stuff/csstidy-1.4-fix-misc.cpp.patch csstidy/stuff/patches/csstidy-1.4-fix-misc.cpp.patch csstidy/stuff/patches/series dia/receipt dia/stuff/dia-overflow-fix.patch dia/stuff/patches/dia-overflow-fix.patch dia/stuff/patches/series dillo/receipt dillo/stuff/fltk-1.3.3.u dillo/stuff/patches/fltk-1.3.3.u dillo/stuff/patches/series dvd+rw-tools/receipt dvd+rw-tools/stuff/build-7.1.patch dvd+rw-tools/stuff/patches/build-7.1.patch dvd+rw-tools/stuff/patches/series epdfview-cups/receipt epdfview-cups/stuff/no-stock-icons.patch epdfview-cups/stuff/patches/no-stock-icons.patch epdfview-cups/stuff/patches/series epdfview/receipt epdfview/stuff/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch epdfview/stuff/fix-scrolling.patch epdfview/stuff/no-stock-icons.patch epdfview/stuff/patches/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch epdfview/stuff/patches/fix-scrolling.patch epdfview/stuff/patches/no-stock-icons.patch epdfview/stuff/patches/series etherboot/receipt etherboot/stuff/etherboot-net.u etherboot/stuff/etherboot-prefix.u etherboot/stuff/patches/etherboot-net.u etherboot/stuff/patches/etherboot-prefix.u etherboot/stuff/patches/series fbvnc/receipt fbvnc/stuff/fbvnc.u fbvnc/stuff/patches/fbvnc.u fbvnc/stuff/patches/series foobillard/receipt foobillard/stuff/03_bugfixes foobillard/stuff/05_foul_explanation foobillard/stuff/06_show_ball_to_hit foobillard/stuff/patches/03_bugfixes foobillard/stuff/patches/05_foul_explanation foobillard/stuff/patches/06_show_ball_to_hit foobillard/stuff/patches/series foobillard/stuff/patches/snooker_draw.patch foobillard/stuff/patches/snooker_reset.patch foobillard/stuff/snooker_draw.patch foobillard/stuff/snooker_reset.patch freeglut/receipt freeglut/stuff/2.6.0-GFX_radeon.patch freeglut/stuff/patches/2.6.0-GFX_radeon.patch freeglut/stuff/patches/series fusecloop/receipt fusecloop/stuff/fusecloop.u fusecloop/stuff/patches/fusecloop.u fusecloop/stuff/patches/series genromfs/receipt genromfs/stuff/genromfs.u genromfs/stuff/patches/genromfs.u genromfs/stuff/patches/series ghex/receipt ghex/stuff/ghex2-remove-help.patch ghex/stuff/patches/ghex2-remove-help.patch ghex/stuff/patches/series gmrun/receipt gmrun/stuff/gmrun-0.9.2-gcc43.patch gmrun/stuff/patches/gmrun-0.9.2-gcc43.patch gmrun/stuff/patches/series gpxe/receipt gpxe/stuff/cmdline.u gpxe/stuff/default_boot.u gpxe/stuff/gcc.u gpxe/stuff/patches/cmdline.u gpxe/stuff/patches/default_boot.u gpxe/stuff/patches/gcc.u gpxe/stuff/patches/prefix.u gpxe/stuff/patches/series gpxe/stuff/patches/url_list.u gpxe/stuff/prefix.u gpxe/stuff/url_list.u grub/receipt grub/stuff/dev_partition.diff grub/stuff/ext3_256byte_inode.diff grub/stuff/patches/dev_partition.diff grub/stuff/patches/ext3_256byte_inode.diff grub/stuff/patches/series grub/stuff/patches/xfs_freeze.diff grub/stuff/xfs_freeze.diff grub4dos/receipt grub4dos/stuff/dev_partition.diff grub4dos/stuff/lzma.diff grub4dos/stuff/patches/dev_partition.diff grub4dos/stuff/patches/lzma.diff grub4dos/stuff/patches/series grub4dos/stuff/patches/xfs_freeze.diff grub4dos/stuff/xfs_freeze.diff gtk-theme-albatross/receipt gtk-theme-albatross/stuff/define-sizes.patch gtk-theme-albatross/stuff/patches/define-sizes.patch gtk-theme-albatross/stuff/patches/series gtk-theme-bluebird/receipt gtk-theme-bluebird/stuff/define-sizes.patch gtk-theme-bluebird/stuff/patches/define-sizes.patch gtk-theme-bluebird/stuff/patches/series gtk-theme-greybird/receipt gtk-theme-greybird/stuff/define-sizes.patch gtk-theme-greybird/stuff/patches/define-sizes.patch gtk-theme-greybird/stuff/patches/series gtk-theme-orion/receipt gtk-theme-orion/stuff/define-sizes.patch gtk-theme-orion/stuff/patches/define-sizes.patch gtk-theme-orion/stuff/patches/series gtkglext/receipt gtkglext/stuff/gtk2.20.patch gtkglext/stuff/patches/gtk2.20.patch gtkglext/stuff/patches/series gxine/receipt gxine/stuff/gxine-0.5.907-lirc.patch gxine/stuff/patches/gxine-0.5.907-lirc.patch gxine/stuff/patches/series hal/receipt hal/stuff/hal-scripts.u hal/stuff/patches/hal-scripts.u hal/stuff/patches/series hardinfo/receipt hardinfo/stuff/boots.patch hardinfo/stuff/languages.patch hardinfo/stuff/os.patch hardinfo/stuff/patches/boots.patch hardinfo/stuff/patches/languages.patch hardinfo/stuff/patches/os.patch hardinfo/stuff/patches/series hardinfo/stuff/patches/usb.patch hardinfo/stuff/usb.patch hplip/receipt hplip/stuff/cups-1.6-buildfix.diff hplip/stuff/hplip-3.9.4b-glibc210.u hplip/stuff/hplip-cups-1.5.0-compatibility.patch hplip/stuff/patches/cups-1.6-buildfix.diff hplip/stuff/patches/hplip-3.9.4b-glibc210.u hplip/stuff/patches/hplip-cups-1.5.0-compatibility.patch hplip/stuff/patches/series html2text/receipt html2text/stuff/patch-utf8-html2text-1.3.2a.diff html2text/stuff/patches/patch-utf8-html2text-1.3.2a.diff html2text/stuff/patches/series icmpshell/receipt icmpshell/stuff/ishd.u icmpshell/stuff/patches/ishd.u icmpshell/stuff/patches/series idesk/receipt idesk/stuff/DesktopConfig.patch idesk/stuff/patches/DesktopConfig.patch idesk/stuff/patches/series john/receipt john/stuff/params.h.patch john/stuff/patches/params.h.patch john/stuff/patches/series jwm/receipt jwm/stuff/patches/resize-backgound.u jwm/stuff/patches/series jwm/stuff/resize-backgound.u knock/receipt knock/stuff/knock.u knock/stuff/patches/knock.u knock/stuff/patches/series le/receipt le/stuff/gcc-4.patch le/stuff/patches/gcc-4.patch le/stuff/patches/series libdvdread/receipt libdvdread/stuff/DVDFileStat.patch libdvdread/stuff/patches/DVDFileStat.patch libdvdread/stuff/patches/series libee/receipt libee/stuff/libee-build-fix.patch libee/stuff/patches/libee-build-fix.patch libee/stuff/patches/series libimobiledevice/receipt libimobiledevice/stuff/patches/series libimobiledevice/stuff/patches/swig-version-check.patch libimobiledevice/stuff/swig-version-check.patch liblognorm/receipt liblognorm/stuff/liblognorm-build-fix.patch liblognorm/stuff/patches/liblognorm-build-fix.patch liblognorm/stuff/patches/series liblrdf/receipt liblrdf/stuff/md5.patch liblrdf/stuff/patches/md5.patch liblrdf/stuff/patches/pkgconfig-raptor.patch liblrdf/stuff/patches/raptor2.diff liblrdf/stuff/patches/series liblrdf/stuff/pkgconfig-raptor.patch liblrdf/stuff/raptor2.diff libquicktime/receipt libquicktime/stuff/ffmpeg.u libquicktime/stuff/gtk22.patch libquicktime/stuff/patches/ffmpeg.u libquicktime/stuff/patches/series libwrap/receipt libwrap/stuff/patches/series libwrap/stuff/patches/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch libwrap/stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch lite/receipt lite/stuff/lite_fix_pkgconfig.patch lite/stuff/lite_fix_stat_naming.patch lite/stuff/patches/lite_fix_pkgconfig.patch lite/stuff/patches/lite_fix_stat_naming.patch lite/stuff/patches/series loderunner/receipt loderunner/stuff/loderunner.desktop lostirc/receipt lostirc/stuff/gcc.u lostirc/stuff/patches/gcc.u lostirc/stuff/patches/series lsdvd/receipt lsdvd/stuff/lsdvd-0.16-configure.patch lsdvd/stuff/patches/lsdvd-0.16-configure.patch lsdvd/stuff/patches/series luasocket/receipt luasocket/stuff/patch.diff luasocket/stuff/patches/patch.diff luasocket/stuff/patches/series lzop/receipt lzop/stuff/lzop-gcc6.patch lzop/stuff/patches/lzop-gcc6.patch lzop/stuff/patches/series man2html/receipt man2html/stuff/man2html-slitaz.diff man2html/stuff/patches/man2html-slitaz.diff man2html/stuff/patches/series manserver/receipt manserver/stuff/manserver-1.08-add-xz.patch manserver/stuff/patches/manserver-1.08-add-xz.patch manserver/stuff/patches/series marlin/receipt marlin/stuff/marlin-0.5.patch marlin/stuff/marlin-icons.patch marlin/stuff/patches/marlin-0.5.patch marlin/stuff/patches/marlin-icons.patch marlin/stuff/patches/series memtest/receipt memtest/stuff/memtest86+-5.01-array-size.patch memtest/stuff/patches/memtest86+-5.01-array-size.patch memtest/stuff/patches/series mesa12/receipt mesa12/stuff/mesa-12.0.patch mesa12/stuff/nouveau-fix-header.patch mesa12/stuff/patches/mesa-12.0.patch mesa12/stuff/patches/nouveau-fix-header.patch mesa12/stuff/patches/series microperl/receipt microperl/stuff/microperl.patch microperl/stuff/miniperlmain.patch microperl/stuff/patches/microperl.patch microperl/stuff/patches/miniperlmain.patch microperl/stuff/patches/series moserial/receipt moserial/stuff/glade.patch moserial/stuff/patches/glade.patch moserial/stuff/patches/series mplayerplug-in/receipt mplayerplug-in/stuff/mplayerplug-in-3.55-glibc210.u mplayerplug-in/stuff/mplayerplug-in-3.55-static-iid-accessor.u mplayerplug-in/stuff/patches/mplayerplug-in-3.55-glibc210.u mplayerplug-in/stuff/patches/mplayerplug-in-3.55-static-iid-accessor.u mplayerplug-in/stuff/patches/series mtpaint/receipt mtpaint/stuff/mtpaint.patch mtpaint/stuff/patches/mtpaint.patch mtpaint/stuff/patches/series mupdf/receipt mupdf/stuff/patches/series mupdf/stuff/patches/use_openjpeg_1.5.patch mupdf/stuff/use_openjpeg_1.5.patch musique/receipt musique/stuff/icons.diff musique/stuff/patches/icons.diff musique/stuff/patches/series ndoutils/receipt ndoutils/stuff/ndoutils-1.4b9-Makefile.in.u ndoutils/stuff/ndoutils-1.4b9-Makefiles.in.u ndoutils/stuff/ndoutils-1.5.2-Makefiles.in.u ndoutils/stuff/patches/ndoutils-1.5.2-Makefiles.in.u ndoutils/stuff/patches/series notecase/receipt notecase/stuff/notecase-1.9.8_gcc4.u notecase/stuff/patches/notecase-1.9.8_gcc4.u notecase/stuff/patches/series nvclock/receipt nvclock/stuff/nvclock-0.8b4-install.patch nvclock/stuff/patches/nvclock-0.8b4-install.patch nvclock/stuff/patches/series ocsinventory-agent/receipt ocsinventory-agent/stuff/Drives.pm.u ocsinventory-agent/stuff/manifest.u ocsinventory-agent/stuff/ocsinventory-agent-1.1.2.1.u ocsinventory-agent/stuff/patches/Drives.pm.u ocsinventory-agent/stuff/patches/manifest.u ocsinventory-agent/stuff/patches/ocsinventory-agent-1.1.2.1.u ocsinventory-agent/stuff/patches/series opencpn/receipt opencpn/stuff/glib.u opencpn/stuff/patches/glib.u opencpn/stuff/patches/series openspades/receipt openspades/stuff/openspades-0.0.12.patch openspades/stuff/patches/openspades-0.0.12.patch openspades/stuff/patches/series ovz-web-panel/receipt ovz-web-panel/stuff/hardware_server.rb.u ovz-web-panel/stuff/owp-1.7.u ovz-web-panel/stuff/patches/hardware_server.rb.u ovz-web-panel/stuff/patches/owp-1.7.u ovz-web-panel/stuff/patches/series par2/receipt par2/stuff/par2cmdline-0.4-gcc4.patch par2/stuff/patches/par2cmdline-0.4-gcc4.patch par2/stuff/patches/series pcmanfm-legacy/receipt pcmanfm-legacy/stuff/archiver-tazpkg-support.patch pcmanfm-legacy/stuff/patches/archiver-tazpkg-support.patch pcmanfm-legacy/stuff/patches/series pcmanfm-legacy/stuff/patches/view.as.detailed.list.click.bug.patch pcmanfm-legacy/stuff/view.as.detailed.list.click.bug.patch php-auth-pam/receipt php-auth-pam/stuff/patches/php-auth-pam-Makefile.global0.4.u php-auth-pam/stuff/patches/series php-auth-pam/stuff/php-auth-pam-Makefile.global0.4.u portmidi/receipt portmidi/stuff/patches/portmidi-217-Makefile.patch portmidi/stuff/patches/series portmidi/stuff/portmidi-217-Makefile.patch procps/receipt procps/stuff/patches/procps-3.2.8+gmake-3.82.patch procps/stuff/patches/series procps/stuff/procps-3.2.8+gmake-3.82.patch python-pygame/receipt python-pygame/stuff/config.patch python-pygame/stuff/patches/config.patch python-pygame/stuff/patches/series python-pyxml/receipt python-pyxml/stuff/fix-python2.6.patch python-pyxml/stuff/patches/fix-python2.6.patch python-pyxml/stuff/patches/series qemu-light/receipt qemu-light/stuff/cloop.u qemu-light/stuff/patches/cloop.u qemu-light/stuff/patches/series qemu/receipt qemu/stuff/cloop.u qemu/stuff/patches/cloop.u qemu/stuff/patches/series qtpanel/receipt qtpanel/stuff/p.diff qtpanel/stuff/patches/p.diff qtpanel/stuff/patches/series rawstudio/receipt rawstudio/stuff/patches/rawstudio-const.patch rawstudio/stuff/patches/series rawstudio/stuff/rawstudio-const.patch retawq/receipt retawq/stuff/patches/retawq.patch retawq/stuff/patches/series retawq/stuff/retawq.patch rhythmcat2/receipt rhythmcat2/stuff/patches/rhythmcat2.patch rhythmcat2/stuff/patches/series rhythmcat2/stuff/rhythmcat2.patch rox-filer/receipt rox-filer/stuff/menu.diff rox-filer/stuff/patches/menu.diff rox-filer/stuff/patches/series ruby-ncurses/receipt ruby-ncurses/stuff/STR2CSTR-deprecated.patch ruby-ncurses/stuff/Werror-format-security.patch ruby-ncurses/stuff/patches/STR2CSTR-deprecated.patch ruby-ncurses/stuff/patches/Werror-format-security.patch ruby-ncurses/stuff/patches/ruby-ncurses-fix-missing-tz-prototypes.patch ruby-ncurses/stuff/patches/series ruby-ncurses/stuff/ruby-ncurses-fix-missing-tz-prototypes.patch sane-backends/receipt sane-backends/stuff/libv4l-0.8.3.patch sane-backends/stuff/patches/libv4l-0.8.3.patch sane-backends/stuff/patches/series sane-backends/stuff/patches/xerox_mfp_fix_usb_devices.patch sane-backends/stuff/xerox_mfp_fix_usb_devices.patch screenfetch/receipt screenfetch/stuff/patches/series screenfetch/stuff/patches/slitaz.patch screenfetch/stuff/slitaz.patch scrot/receipt scrot/stuff/patches/scrot.patch scrot/stuff/patches/series scrot/stuff/scrot.patch seamonkey/receipt seamonkey/stuff/google-breakpad.u seamonkey/stuff/linux-remove.patch seamonkey/stuff/linux3.0.patch seamonkey/stuff/patches/google-breakpad.u seamonkey/stuff/patches/linux-remove.patch seamonkey/stuff/patches/linux3.0.patch seamonkey/stuff/patches/seamonkey-2.0-lang.patch seamonkey/stuff/patches/seamonkey-install-dir.patch seamonkey/stuff/patches/series seamonkey/stuff/seamonkey-2.0-lang.patch seamonkey/stuff/seamonkey-install-dir.patch setserial/receipt setserial/stuff/patches/series setserial/stuff/patches/setserial-2.17.u setserial/stuff/setserial-2.17.u sheerdns/receipt sheerdns/stuff/large-subdomains.u sheerdns/stuff/patches/large-subdomains.u sheerdns/stuff/patches/series soundtouch/receipt soundtouch/stuff/patches/series soundtouch/stuff/patches/soundtouch-1.4.0-mmx-sse-compile-fix.patch soundtouch/stuff/soundtouch-1.4.0-mmx-sse-compile-fix.patch spidermonkey/receipt spidermonkey/stuff/patches/series spidermonkey/stuff/patches/spidermonkey-1.7-threadsafe.patch spidermonkey/stuff/patches/spidermonkey-Makefile.patch spidermonkey/stuff/spidermonkey-1.7-threadsafe.patch spidermonkey/stuff/spidermonkey-Makefile.patch stardict/receipt stardict/stuff/patches/series stardict/stuff/patches/sigc++.patch stardict/stuff/patches/stardict_gcc43.patch stardict/stuff/sigc++.patch stardict/stuff/stardict_gcc43.patch sundown/receipt sundown/stuff/patches/series sundown/stuff/patches/sundown.options.patch sundown/stuff/sundown.options.patch superswitcher/receipt superswitcher/stuff/patches/series superswitcher/stuff/patches/superswitcher-0.6-wnck-workspace.patch superswitcher/stuff/superswitcher-0.6-wnck-workspace.patch syslinux/receipt syslinux/stuff/extra/iso9660.u syslinux/stuff/extra/keytab-lilo.u syslinux/stuff/extra/loadhigh.u syslinux/stuff/extra/readconfig.u syslinux/stuff/patches/iso9660.u syslinux/stuff/patches/keytab-lilo.u syslinux/stuff/patches/loadhigh.u syslinux/stuff/patches/readconfig.u syslinux/stuff/patches/series thttpd/receipt thttpd/stuff/htpassword.c.u thttpd/stuff/patches/htpassword.c.u thttpd/stuff/patches/series tinyproxy/receipt tinyproxy/stuff/no-docs-and-tests.diff tinyproxy/stuff/patches/no-docs-and-tests.diff tinyproxy/stuff/patches/series tpp/receipt tpp/stuff/optional-x.patch tpp/stuff/patches/optional-x.patch tpp/stuff/patches/ruby19.patch tpp/stuff/patches/series tpp/stuff/ruby19.patch tuxmath/receipt tuxmath/stuff/SDL_extras.c.patch tuxmath/stuff/patches/SDL_extras.c.patch tuxmath/stuff/patches/series visualboyadvance/receipt visualboyadvance/stuff/1.7.2-deprecatedsigc++.patch visualboyadvance/stuff/1.7.2-gcc34.patch visualboyadvance/stuff/1.7.2-gcc41.patch visualboyadvance/stuff/1.7.2-glibc.patch visualboyadvance/stuff/1.7.2-homedir.patch visualboyadvance/stuff/1.7.2-uninit.patch visualboyadvance/stuff/patches/1.7.2-deprecatedsigc++.patch visualboyadvance/stuff/patches/1.7.2-gcc34.patch visualboyadvance/stuff/patches/1.7.2-gcc41.patch visualboyadvance/stuff/patches/1.7.2-glibc.patch visualboyadvance/stuff/patches/1.7.2-homedir.patch visualboyadvance/stuff/patches/1.7.2-uninit.patch visualboyadvance/stuff/patches/series volumeicon/receipt volumeicon/stuff/alsa_backend.patch volumeicon/stuff/patches/alsa_backend.patch volumeicon/stuff/patches/series vzctl/receipt vzctl/stuff/patches/series vzctl/stuff/patches/vzctl-3.0.25.1-Makefile.u vzctl/stuff/vzctl-3.0.23-Makefile.u vzctl/stuff/vzctl-3.0.23.u vzctl/stuff/vzctl-3.0.25.1-Makefile.u vzquota/receipt vzquota/stuff/patches/series vzquota/stuff/patches/vzquota-3.0.12.u vzquota/stuff/vzquota-3.0.12.u w3m/receipt w3m/stuff/file_handle.patch w3m/stuff/https.patch w3m/stuff/patches/file_handle.patch w3m/stuff/patches/https.patch w3m/stuff/patches/series w3m/stuff/patches/w3m-0.5.2-gc72.patch w3m/stuff/w3m-0.5.2-gc72.patch wbar/receipt wbar/stuff/gcc43_fixes.diff wbar/stuff/patches/gcc43_fixes.diff wbar/stuff/patches/series wicd/receipt wicd/stuff/831_830.patch wicd/stuff/835_834.patch wicd/stuff/dbus_string_fix.patch wicd/stuff/patches/831_830.patch wicd/stuff/patches/835_834.patch wicd/stuff/patches/dbus_string_fix.patch wicd/stuff/patches/series wxWidgets/stuff/gsockgtk.patch wxpython/receipt wxpython/stuff/patches/series wxpython/stuff/patches/wxpython-cairo.patch wxpython/stuff/wxpython-cairo.patch xarchive/receipt xarchive/stuff/patches/series xarchive/stuff/patches/slitaz-xarchive-wrappers-0.2.8-6.patch xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch xbattle/receipt xbattle/stuff/patches/pseudo_color.u xbattle/stuff/patches/series xbattle/stuff/pseudo_color.u xfmedia/receipt xfmedia/stuff/patches/series xfmedia/stuff/patches/xfmedia-dbus-0.6-support.patch xfmedia/stuff/patches/xfmedia-empty-prev-next-fix.patch xfmedia/stuff/patches/xfmedia-exo-0.6.patch xfmedia/stuff/xfmedia-dbus-0.6-support.patch xfmedia/stuff/xfmedia-empty-prev-next-fix.patch xfmedia/stuff/xfmedia-exo-0.6.patch xfprint/receipt xfprint/stuff/patches/series xfprint/stuff/patches/xfprint-4.6.1-cups-1.6.patch xfprint/stuff/xfprint-4.6.1-cups-1.6.patch xpat2/receipt xpat2/stuff/layout.patch xpat2/stuff/patches/layout.patch xpat2/stuff/patches/series xpat2/stuff/patches/xpat2.patch xpat2/stuff/xpat2.patch yarock/receipt yarock/stuff/patches/series yarock/stuff/patches/yarock.patch yarock/stuff/yarock.patch yasr/receipt yasr/stuff/patches/series yasr/stuff/patches/yasr.patch yasr/stuff/yasr.patch ypserv/receipt ypserv/stuff/confpost.patch ypserv/stuff/patches/confpost.patch ypserv/stuff/patches/series zerobin/receipt zerobin/stuff/patches/series zerobin/stuff/patches/zerobin.u zerobin/stuff/zerobin.u zsnes/receipt zsnes/stuff/patches/series zsnes/stuff/patches/zsnes.patch zsnes/stuff/zsnes.patch
line diff
     1.1 --- a/barcode/receipt	Wed May 09 17:03:28 2018 +0300
     1.2 +++ b/barcode/receipt	Thu May 10 21:12:00 2018 +0300
     1.3 @@ -15,7 +15,6 @@
     1.4  # Rules to configure and make the package.
     1.5  compile_rules()
     1.6  {
     1.7 -	patch -p1 -i $stuff/barcode.patch
     1.8  	autoreconf -fi
     1.9  	sed -i 's|/info|/share&|' Makefile*
    1.10  	./configure $CONFIGURE_ARGS && make && make install
     2.1 --- a/barcode/stuff/barcode.patch	Wed May 09 17:03:28 2018 +0300
     2.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.3 @@ -1,36 +0,0 @@
     2.4 ---- a/Makefile.in
     2.5 -+++ b/Makefile.in
     2.6 -@@ -14,8 +14,8 @@
     2.7 - BINDIR = $(prefix)/bin
     2.8 - LIBDIR = $(prefix)/lib
     2.9 - INCDIR = $(prefix)/include
    2.10 --MAN1DIR = $(prefix)/man/man1
    2.11 --MAN3DIR = $(prefix)/man/man3
    2.12 -+MAN1DIR = $(prefix)/share/man/man1
    2.13 -+MAN3DIR = $(prefix)/share/man/man3
    2.14 - INFODIR = $(prefix)/info
    2.15 - 
    2.16 - # getopt may be installed or not, if not take our copy
    2.17 -@@ -63,14 +63,14 @@
    2.18 - 	cd doc && $(MAKE) 
    2.19 - 
    2.20 - install:
    2.21 --	$(INSTALL) -d $(BINDIR) $(INCDIR) $(LIBDIR) $(MAN1DIR) \
    2.22 --		$(MAN3DIR) $(INFODIR)
    2.23 --	$(INSTALL) -c $(TARGET) $(BINDIR)
    2.24 --	$(INSTALL) -c -m 0644 $(HEADER) $(INCDIR)
    2.25 --	$(INSTALL) -c -m 0644  $(LIBRARY) $(LIBDIR)
    2.26 --	$(INSTALL) -c -m 0644  $(MAN1) $(MAN1DIR)
    2.27 --	$(INSTALL) -c -m 0644  $(MAN3) $(MAN3DIR)
    2.28 --	$(INSTALL) -c -m 0644  $(INFO) $(INFODIR)
    2.29 -+	$(INSTALL) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(INCDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) \
    2.30 -+		$(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INFODIR)
    2.31 -+	$(INSTALL) -c $(TARGET) $(DESTDIR)$(BINDIR)
    2.32 -+	$(INSTALL) -c -m 0644 $(HEADER) $(DESTDIR)$(INCDIR)
    2.33 -+	$(INSTALL) -c -m 0644  $(LIBRARY) $(DESTDIR)$(LIBDIR)
    2.34 -+	$(INSTALL) -c -m 0644  $(MAN1) $(DESTDIR)$(MAN1DIR)
    2.35 -+	$(INSTALL) -c -m 0644  $(MAN3) $(DESTDIR)$(MAN3DIR)
    2.36 -+	$(INSTALL) -c -m 0644  $(INFO) $(DESTDIR)$(INFODIR)
    2.37 - 
    2.38 - uninstall:
    2.39 - 	$(RM) -f $(BINDIR)/$(TARGET)
     3.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     3.2 +++ b/barcode/stuff/patches/barcode.patch	Thu May 10 21:12:00 2018 +0300
     3.3 @@ -0,0 +1,36 @@
     3.4 +--- a/Makefile.in
     3.5 ++++ b/Makefile.in
     3.6 +@@ -14,8 +14,8 @@
     3.7 + BINDIR = $(prefix)/bin
     3.8 + LIBDIR = $(prefix)/lib
     3.9 + INCDIR = $(prefix)/include
    3.10 +-MAN1DIR = $(prefix)/man/man1
    3.11 +-MAN3DIR = $(prefix)/man/man3
    3.12 ++MAN1DIR = $(prefix)/share/man/man1
    3.13 ++MAN3DIR = $(prefix)/share/man/man3
    3.14 + INFODIR = $(prefix)/info
    3.15 + 
    3.16 + # getopt may be installed or not, if not take our copy
    3.17 +@@ -63,14 +63,14 @@
    3.18 + 	cd doc && $(MAKE) 
    3.19 + 
    3.20 + install:
    3.21 +-	$(INSTALL) -d $(BINDIR) $(INCDIR) $(LIBDIR) $(MAN1DIR) \
    3.22 +-		$(MAN3DIR) $(INFODIR)
    3.23 +-	$(INSTALL) -c $(TARGET) $(BINDIR)
    3.24 +-	$(INSTALL) -c -m 0644 $(HEADER) $(INCDIR)
    3.25 +-	$(INSTALL) -c -m 0644  $(LIBRARY) $(LIBDIR)
    3.26 +-	$(INSTALL) -c -m 0644  $(MAN1) $(MAN1DIR)
    3.27 +-	$(INSTALL) -c -m 0644  $(MAN3) $(MAN3DIR)
    3.28 +-	$(INSTALL) -c -m 0644  $(INFO) $(INFODIR)
    3.29 ++	$(INSTALL) -d $(DESTDIR)$(BINDIR) $(DESTDIR)$(INCDIR) $(DESTDIR)$(LIBDIR) $(DESTDIR)$(MAN1DIR) \
    3.30 ++		$(DESTDIR)$(MAN3DIR) $(DESTDIR)$(INFODIR)
    3.31 ++	$(INSTALL) -c $(TARGET) $(DESTDIR)$(BINDIR)
    3.32 ++	$(INSTALL) -c -m 0644 $(HEADER) $(DESTDIR)$(INCDIR)
    3.33 ++	$(INSTALL) -c -m 0644  $(LIBRARY) $(DESTDIR)$(LIBDIR)
    3.34 ++	$(INSTALL) -c -m 0644  $(MAN1) $(DESTDIR)$(MAN1DIR)
    3.35 ++	$(INSTALL) -c -m 0644  $(MAN3) $(DESTDIR)$(MAN3DIR)
    3.36 ++	$(INSTALL) -c -m 0644  $(INFO) $(DESTDIR)$(INFODIR)
    3.37 + 
    3.38 + uninstall:
    3.39 + 	$(RM) -f $(BINDIR)/$(TARGET)
     4.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.2 +++ b/barcode/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
     4.3 @@ -0,0 +1,1 @@
     4.4 +-p1|barcode.patch
     5.1 --- a/blackbox/receipt	Wed May 09 17:03:28 2018 +0300
     5.2 +++ b/blackbox/receipt	Thu May 10 21:12:00 2018 +0300
     5.3 @@ -17,10 +17,6 @@
     5.4  # to let user use the wm via slim/F1 or by default with 'tazx blackbox'.
     5.5  
     5.6  compile_rules() {
     5.7 -	patch -p1 < $stuff/blackbox-0.70.1-gcc-4.3.patch
     5.8 -	patch -p0 < $stuff/blackbox-0.70.1-asneeded.patch
     5.9 -	patch -p1 < $stuff/textpropertytostring-unconditional.patch
    5.10 -
    5.11  	./configure \
    5.12  		--libexecdir=/usr/bin \
    5.13  		$CONFIGURE_ARGS &&
     6.1 --- a/blackbox/stuff/blackbox-0.70.1-asneeded.patch	Wed May 09 17:03:28 2018 +0300
     6.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     6.3 @@ -1,49 +0,0 @@
     6.4 -Fixing build with as-needed. Enabling shared libs.
     6.5 -
     6.6 -http://bugs.gentoo.org/show_bug.cgi?id=248549
     6.7 - 
     6.8 ---- src/Makefile.am
     6.9 -+++ src/Makefile.am
    6.10 -@@ -22,7 +22,7 @@
    6.11 - 
    6.12 - DEFAULT_MENU		= $(pkgdatadir)/menu
    6.13 - DEFAULT_STYLE		= $(pkgdatadir)/styles/Gray
    6.14 --CPPFLAGS		= @CPPFLAGS@ @SHAPE@ @XFT@ @DEBUG@ @NLS@ \
    6.15 -+AM_CPPFLAGS		= @SHAPE@ @XFT@ @DEBUG@ @NLS@ \
    6.16 - 			  -DLOCALEPATH=\"$(pkgdatadir)/nls\" \
    6.17 - 			  -DDEFAULTMENU=\"$(DEFAULT_MENU)\" \
    6.18 - 			  -DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \
    6.19 ---- lib/Makefile.am
    6.20 -+++ lib/Makefile.am
    6.21 -@@ -62,7 +62,8 @@
    6.22 - 			Util.hh						\
    6.23 - 			XDG.hh
    6.24 - 
    6.25 --libbt_la_LIBADD =	@ICONV@ @LOCALE@
    6.26 -+libbt_la_LIBADD =	@ICONV@ @LOCALE@ @xft_LIBS@
    6.27 -+libbt_la_CFLAGS = 	@xft_CFLAGS@
    6.28 - 
    6.29 - pkgconfigdir = 		$(libdir)/pkgconfig
    6.30 - nodist_pkgconfig_DATA =	libbt.pc
    6.31 ---- util/Makefile.am
    6.32 -+++ util/Makefile.am
    6.33 -@@ -21,7 +21,7 @@
    6.34 - # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
    6.35 - # DEALINGS IN THE SOFTWARE.
    6.36 - 
    6.37 --CPPFLAGS		= @CPPFLAGS@ @DEBUG@ @NLS@ \
    6.38 -+AM_CPPFLAGS		= @DEBUG@ @NLS@ \
    6.39 - 			  -I$(top_srcdir)/lib
    6.40 - 
    6.41 - bin_SCRIPTS		= bsetbg
    6.42 ---- configure.ac
    6.43 -+++ configure.ac
    6.44 -@@ -29,7 +29,7 @@
    6.45 - AC_PROG_INSTALL
    6.46 - 
    6.47 - dnl libbt shouldn't be shared by default (yet)
    6.48 --AC_DISABLE_SHARED
    6.49 -+dnl AC_DISABLE_SHARED
    6.50 - AC_PROG_LIBTOOL
    6.51 - AC_SUBST(LIBTOOL_DEPS)
    6.52 - 
     7.1 --- a/blackbox/stuff/blackbox-0.70.1-gcc-4.3.patch	Wed May 09 17:03:28 2018 +0300
     7.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     7.3 @@ -1,106 +0,0 @@
     7.4 -diff -Naupr blackbox-0.70.1.orig/lib/Image.cc blackbox-0.70.1/lib/Image.cc
     7.5 ---- blackbox-0.70.1.orig/lib/Image.cc	2005-04-08 17:41:09.000000000 +0200
     7.6 -+++ blackbox-0.70.1/lib/Image.cc	2008-02-24 08:31:28.000000000 +0100
     7.7 -@@ -42,8 +42,9 @@
     7.8 - 
     7.9 - #include <assert.h>
    7.10 - #include <math.h>
    7.11 --#include <stdio.h>
    7.12 --#include <stdlib.h>
    7.13 -+#include <cstdio>
    7.14 -+#include <cstdlib>
    7.15 -+#include <cstring>
    7.16 - 
    7.17 - // #define COLORTABLE_DEBUG
    7.18 - // #define MITSHM_DEBUG
    7.19 -diff -Naupr blackbox-0.70.1.orig/lib/Resource.cc blackbox-0.70.1/lib/Resource.cc
    7.20 ---- blackbox-0.70.1.orig/lib/Resource.cc	2005-04-06 23:16:50.000000000 +0200
    7.21 -+++ blackbox-0.70.1/lib/Resource.cc	2008-02-24 08:33:11.000000000 +0100
    7.22 -@@ -28,7 +28,8 @@
    7.23 - #include <X11/Xlib.h>
    7.24 - #include <X11/Xresource.h>
    7.25 - 
    7.26 --#include <stdio.h>
    7.27 -+#include <cstdio>
    7.28 -+#include <cstring>
    7.29 - 
    7.30 - 
    7.31 - bt::Resource::Resource(void)
    7.32 -diff -Naupr blackbox-0.70.1.orig/lib/XDG.cc blackbox-0.70.1/lib/XDG.cc
    7.33 ---- blackbox-0.70.1.orig/lib/XDG.cc	2005-04-06 16:04:38.000000000 +0200
    7.34 -+++ blackbox-0.70.1/lib/XDG.cc	2008-02-24 08:34:11.000000000 +0100
    7.35 -@@ -25,7 +25,8 @@
    7.36 - #include "Util.hh"
    7.37 - #include "XDG.hh"
    7.38 - 
    7.39 --#include <stdlib.h>
    7.40 -+#include <cstdlib>
    7.41 -+#include <algorithm>
    7.42 - 
    7.43 - 
    7.44 - // make sure directory names end with a slash
    7.45 -diff -Naupr blackbox-0.70.1.orig/src/BlackboxResource.cc blackbox-0.70.1/src/BlackboxResource.cc
    7.46 ---- blackbox-0.70.1.orig/src/BlackboxResource.cc	2005-10-18 09:34:46.000000000 +0200
    7.47 -+++ blackbox-0.70.1/src/BlackboxResource.cc	2008-02-24 08:34:49.000000000 +0100
    7.48 -@@ -33,6 +33,8 @@
    7.49 - #include <X11/Xutil.h>
    7.50 - #include <X11/cursorfont.h>
    7.51 - 
    7.52 -+#include <cstring>
    7.53 -+
    7.54 - 
    7.55 - BlackboxResource::BlackboxResource(const std::string& rc): rc_file(rc) {
    7.56 -   screen_resources = 0;
    7.57 -diff -Naupr blackbox-0.70.1.orig/src/main.cc blackbox-0.70.1/src/main.cc
    7.58 ---- blackbox-0.70.1.orig/src/main.cc	2005-01-03 10:42:57.000000000 +0100
    7.59 -+++ blackbox-0.70.1/src/main.cc	2008-02-24 08:37:16.000000000 +0100
    7.60 -@@ -34,7 +34,8 @@
    7.61 - #include "blackbox.hh"
    7.62 - #include "../version.h"
    7.63 - 
    7.64 --#include <stdio.h>
    7.65 -+#include <cstdio>
    7.66 -+#include <cstring>
    7.67 - 
    7.68 - 
    7.69 - static void showHelp(int exitval) {
    7.70 -diff -Naupr blackbox-0.70.1.orig/src/Screen.cc blackbox-0.70.1/src/Screen.cc
    7.71 ---- blackbox-0.70.1.orig/src/Screen.cc	2005-10-18 10:07:22.000000000 +0200
    7.72 -+++ blackbox-0.70.1/src/Screen.cc	2008-02-24 08:35:46.000000000 +0100
    7.73 -@@ -45,8 +45,9 @@
    7.74 - #include <sys/types.h>
    7.75 - #include <sys/stat.h>
    7.76 - #include <assert.h>
    7.77 --#include <ctype.h>
    7.78 - #include <dirent.h>
    7.79 -+#include <cctype>
    7.80 -+#include <cstring>
    7.81 - 
    7.82 - 
    7.83 - static bool running = true;
    7.84 -diff -Naupr blackbox-0.70.1.orig/src/ScreenResource.cc blackbox-0.70.1/src/ScreenResource.cc
    7.85 ---- blackbox-0.70.1.orig/src/ScreenResource.cc	2005-04-13 07:54:08.000000000 +0200
    7.86 -+++ blackbox-0.70.1/src/ScreenResource.cc	2008-02-24 08:36:31.000000000 +0100
    7.87 -@@ -33,6 +33,8 @@
    7.88 - 
    7.89 - #include <assert.h>
    7.90 - 
    7.91 -+#include <cstring>
    7.92 -+
    7.93 - 
    7.94 - static const int iconify_width  = 9;
    7.95 - static const int iconify_height = 9;
    7.96 -diff -Naupr blackbox-0.70.1.orig/util/bsetroot.cc blackbox-0.70.1/util/bsetroot.cc
    7.97 ---- blackbox-0.70.1.orig/util/bsetroot.cc	2005-03-15 08:01:37.000000000 +0100
    7.98 -+++ blackbox-0.70.1/util/bsetroot.cc	2008-02-24 08:38:41.000000000 +0100
    7.99 -@@ -30,7 +30,9 @@
   7.100 - #include <cctype>
   7.101 - 
   7.102 - #include <X11/Xatom.h>
   7.103 --#include <stdio.h>
   7.104 -+#include <cstdio>
   7.105 -+#include <cstdlib>
   7.106 -+#include <cstring>
   7.107 - 
   7.108 - 
   7.109 - // ignore all X errors
     8.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     8.2 +++ b/blackbox/stuff/patches/blackbox-0.70.1-asneeded.patch	Thu May 10 21:12:00 2018 +0300
     8.3 @@ -0,0 +1,49 @@
     8.4 +Fixing build with as-needed. Enabling shared libs.
     8.5 +
     8.6 +http://bugs.gentoo.org/show_bug.cgi?id=248549
     8.7 + 
     8.8 +--- src/Makefile.am
     8.9 ++++ src/Makefile.am
    8.10 +@@ -22,7 +22,7 @@
    8.11 + 
    8.12 + DEFAULT_MENU		= $(pkgdatadir)/menu
    8.13 + DEFAULT_STYLE		= $(pkgdatadir)/styles/Gray
    8.14 +-CPPFLAGS		= @CPPFLAGS@ @SHAPE@ @XFT@ @DEBUG@ @NLS@ \
    8.15 ++AM_CPPFLAGS		= @SHAPE@ @XFT@ @DEBUG@ @NLS@ \
    8.16 + 			  -DLOCALEPATH=\"$(pkgdatadir)/nls\" \
    8.17 + 			  -DDEFAULTMENU=\"$(DEFAULT_MENU)\" \
    8.18 + 			  -DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \
    8.19 +--- lib/Makefile.am
    8.20 ++++ lib/Makefile.am
    8.21 +@@ -62,7 +62,8 @@
    8.22 + 			Util.hh						\
    8.23 + 			XDG.hh
    8.24 + 
    8.25 +-libbt_la_LIBADD =	@ICONV@ @LOCALE@
    8.26 ++libbt_la_LIBADD =	@ICONV@ @LOCALE@ @xft_LIBS@
    8.27 ++libbt_la_CFLAGS = 	@xft_CFLAGS@
    8.28 + 
    8.29 + pkgconfigdir = 		$(libdir)/pkgconfig
    8.30 + nodist_pkgconfig_DATA =	libbt.pc
    8.31 +--- util/Makefile.am
    8.32 ++++ util/Makefile.am
    8.33 +@@ -21,7 +21,7 @@
    8.34 + # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
    8.35 + # DEALINGS IN THE SOFTWARE.
    8.36 + 
    8.37 +-CPPFLAGS		= @CPPFLAGS@ @DEBUG@ @NLS@ \
    8.38 ++AM_CPPFLAGS		= @DEBUG@ @NLS@ \
    8.39 + 			  -I$(top_srcdir)/lib
    8.40 + 
    8.41 + bin_SCRIPTS		= bsetbg
    8.42 +--- configure.ac
    8.43 ++++ configure.ac
    8.44 +@@ -29,7 +29,7 @@
    8.45 + AC_PROG_INSTALL
    8.46 + 
    8.47 + dnl libbt shouldn't be shared by default (yet)
    8.48 +-AC_DISABLE_SHARED
    8.49 ++dnl AC_DISABLE_SHARED
    8.50 + AC_PROG_LIBTOOL
    8.51 + AC_SUBST(LIBTOOL_DEPS)
    8.52 + 
     9.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     9.2 +++ b/blackbox/stuff/patches/blackbox-0.70.1-gcc-4.3.patch	Thu May 10 21:12:00 2018 +0300
     9.3 @@ -0,0 +1,106 @@
     9.4 +diff -Naupr blackbox-0.70.1.orig/lib/Image.cc blackbox-0.70.1/lib/Image.cc
     9.5 +--- blackbox-0.70.1.orig/lib/Image.cc	2005-04-08 17:41:09.000000000 +0200
     9.6 ++++ blackbox-0.70.1/lib/Image.cc	2008-02-24 08:31:28.000000000 +0100
     9.7 +@@ -42,8 +42,9 @@
     9.8 + 
     9.9 + #include <assert.h>
    9.10 + #include <math.h>
    9.11 +-#include <stdio.h>
    9.12 +-#include <stdlib.h>
    9.13 ++#include <cstdio>
    9.14 ++#include <cstdlib>
    9.15 ++#include <cstring>
    9.16 + 
    9.17 + // #define COLORTABLE_DEBUG
    9.18 + // #define MITSHM_DEBUG
    9.19 +diff -Naupr blackbox-0.70.1.orig/lib/Resource.cc blackbox-0.70.1/lib/Resource.cc
    9.20 +--- blackbox-0.70.1.orig/lib/Resource.cc	2005-04-06 23:16:50.000000000 +0200
    9.21 ++++ blackbox-0.70.1/lib/Resource.cc	2008-02-24 08:33:11.000000000 +0100
    9.22 +@@ -28,7 +28,8 @@
    9.23 + #include <X11/Xlib.h>
    9.24 + #include <X11/Xresource.h>
    9.25 + 
    9.26 +-#include <stdio.h>
    9.27 ++#include <cstdio>
    9.28 ++#include <cstring>
    9.29 + 
    9.30 + 
    9.31 + bt::Resource::Resource(void)
    9.32 +diff -Naupr blackbox-0.70.1.orig/lib/XDG.cc blackbox-0.70.1/lib/XDG.cc
    9.33 +--- blackbox-0.70.1.orig/lib/XDG.cc	2005-04-06 16:04:38.000000000 +0200
    9.34 ++++ blackbox-0.70.1/lib/XDG.cc	2008-02-24 08:34:11.000000000 +0100
    9.35 +@@ -25,7 +25,8 @@
    9.36 + #include "Util.hh"
    9.37 + #include "XDG.hh"
    9.38 + 
    9.39 +-#include <stdlib.h>
    9.40 ++#include <cstdlib>
    9.41 ++#include <algorithm>
    9.42 + 
    9.43 + 
    9.44 + // make sure directory names end with a slash
    9.45 +diff -Naupr blackbox-0.70.1.orig/src/BlackboxResource.cc blackbox-0.70.1/src/BlackboxResource.cc
    9.46 +--- blackbox-0.70.1.orig/src/BlackboxResource.cc	2005-10-18 09:34:46.000000000 +0200
    9.47 ++++ blackbox-0.70.1/src/BlackboxResource.cc	2008-02-24 08:34:49.000000000 +0100
    9.48 +@@ -33,6 +33,8 @@
    9.49 + #include <X11/Xutil.h>
    9.50 + #include <X11/cursorfont.h>
    9.51 + 
    9.52 ++#include <cstring>
    9.53 ++
    9.54 + 
    9.55 + BlackboxResource::BlackboxResource(const std::string& rc): rc_file(rc) {
    9.56 +   screen_resources = 0;
    9.57 +diff -Naupr blackbox-0.70.1.orig/src/main.cc blackbox-0.70.1/src/main.cc
    9.58 +--- blackbox-0.70.1.orig/src/main.cc	2005-01-03 10:42:57.000000000 +0100
    9.59 ++++ blackbox-0.70.1/src/main.cc	2008-02-24 08:37:16.000000000 +0100
    9.60 +@@ -34,7 +34,8 @@
    9.61 + #include "blackbox.hh"
    9.62 + #include "../version.h"
    9.63 + 
    9.64 +-#include <stdio.h>
    9.65 ++#include <cstdio>
    9.66 ++#include <cstring>
    9.67 + 
    9.68 + 
    9.69 + static void showHelp(int exitval) {
    9.70 +diff -Naupr blackbox-0.70.1.orig/src/Screen.cc blackbox-0.70.1/src/Screen.cc
    9.71 +--- blackbox-0.70.1.orig/src/Screen.cc	2005-10-18 10:07:22.000000000 +0200
    9.72 ++++ blackbox-0.70.1/src/Screen.cc	2008-02-24 08:35:46.000000000 +0100
    9.73 +@@ -45,8 +45,9 @@
    9.74 + #include <sys/types.h>
    9.75 + #include <sys/stat.h>
    9.76 + #include <assert.h>
    9.77 +-#include <ctype.h>
    9.78 + #include <dirent.h>
    9.79 ++#include <cctype>
    9.80 ++#include <cstring>
    9.81 + 
    9.82 + 
    9.83 + static bool running = true;
    9.84 +diff -Naupr blackbox-0.70.1.orig/src/ScreenResource.cc blackbox-0.70.1/src/ScreenResource.cc
    9.85 +--- blackbox-0.70.1.orig/src/ScreenResource.cc	2005-04-13 07:54:08.000000000 +0200
    9.86 ++++ blackbox-0.70.1/src/ScreenResource.cc	2008-02-24 08:36:31.000000000 +0100
    9.87 +@@ -33,6 +33,8 @@
    9.88 + 
    9.89 + #include <assert.h>
    9.90 + 
    9.91 ++#include <cstring>
    9.92 ++
    9.93 + 
    9.94 + static const int iconify_width  = 9;
    9.95 + static const int iconify_height = 9;
    9.96 +diff -Naupr blackbox-0.70.1.orig/util/bsetroot.cc blackbox-0.70.1/util/bsetroot.cc
    9.97 +--- blackbox-0.70.1.orig/util/bsetroot.cc	2005-03-15 08:01:37.000000000 +0100
    9.98 ++++ blackbox-0.70.1/util/bsetroot.cc	2008-02-24 08:38:41.000000000 +0100
    9.99 +@@ -30,7 +30,9 @@
   9.100 + #include <cctype>
   9.101 + 
   9.102 + #include <X11/Xatom.h>
   9.103 +-#include <stdio.h>
   9.104 ++#include <cstdio>
   9.105 ++#include <cstdlib>
   9.106 ++#include <cstring>
   9.107 + 
   9.108 + 
   9.109 + // ignore all X errors
    10.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    10.2 +++ b/blackbox/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    10.3 @@ -0,0 +1,3 @@
    10.4 +-p1|blackbox-0.70.1-gcc-4.3.patch
    10.5 +-p0|blackbox-0.70.1-asneeded.patch
    10.6 +-p1|textpropertytostring-unconditional.patch
    11.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    11.2 +++ b/blackbox/stuff/patches/textpropertytostring-unconditional.patch	Thu May 10 21:12:00 2018 +0300
    11.3 @@ -0,0 +1,28 @@
    11.4 +Description: Declare bt::textPropertyToString unconditionally.
    11.5 +Author: Jakub Wilk <jwilk@debian.org>
    11.6 +Forwarded: no
    11.7 +Bug-Debian: http://bugs.debian.org/614468
    11.8 +Last-Update: 2011-03-12
    11.9 +
   11.10 +--- a/lib/Util.hh
   11.11 ++++ b/lib/Util.hh
   11.12 +@@ -25,6 +25,8 @@
   11.13 + #ifndef __Util_hh
   11.14 + #define __Util_hh
   11.15 + 
   11.16 ++#include <X11/Xutil.h>
   11.17 ++
   11.18 + #include <limits.h>
   11.19 + #include <string>
   11.20 + 
   11.21 +@@ -94,10 +96,8 @@
   11.22 + 
   11.23 +   std::string tolower(const std::string &string);
   11.24 + 
   11.25 +-#ifdef _XUTIL_H_
   11.26 +   std::string textPropertyToString(::Display *display,
   11.27 +                                    ::XTextProperty& text_prop);
   11.28 +-#endif
   11.29 + 
   11.30 + } // namespace bt
   11.31 + 
    12.1 --- a/blackbox/stuff/textpropertytostring-unconditional.patch	Wed May 09 17:03:28 2018 +0300
    12.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    12.3 @@ -1,28 +0,0 @@
    12.4 -Description: Declare bt::textPropertyToString unconditionally.
    12.5 -Author: Jakub Wilk <jwilk@debian.org>
    12.6 -Forwarded: no
    12.7 -Bug-Debian: http://bugs.debian.org/614468
    12.8 -Last-Update: 2011-03-12
    12.9 -
   12.10 ---- a/lib/Util.hh
   12.11 -+++ b/lib/Util.hh
   12.12 -@@ -25,6 +25,8 @@
   12.13 - #ifndef __Util_hh
   12.14 - #define __Util_hh
   12.15 - 
   12.16 -+#include <X11/Xutil.h>
   12.17 -+
   12.18 - #include <limits.h>
   12.19 - #include <string>
   12.20 - 
   12.21 -@@ -94,10 +96,8 @@
   12.22 - 
   12.23 -   std::string tolower(const std::string &string);
   12.24 - 
   12.25 --#ifdef _XUTIL_H_
   12.26 -   std::string textPropertyToString(::Display *display,
   12.27 -                                    ::XTextProperty& text_prop);
   12.28 --#endif
   12.29 - 
   12.30 - } // namespace bt
   12.31 - 
    13.1 --- a/buffer/receipt	Wed May 09 17:03:28 2018 +0300
    13.2 +++ b/buffer/receipt	Thu May 10 21:12:00 2018 +0300
    13.3 @@ -16,7 +16,6 @@
    13.4  # Rules to configure and make the package.
    13.5  compile_rules()
    13.6  {
    13.7 -	patch -p1 < $stuff/buffer-1.19.patch || exit 1
    13.8  	make
    13.9  
   13.10  	cp buffer.man buffer.1
    14.1 --- a/buffer/stuff/buffer-1.19.patch	Wed May 09 17:03:28 2018 +0300
    14.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    14.3 @@ -1,14 +0,0 @@
    14.4 ---- buffer-1.19-ori/buffer.c
    14.5 -+++ buffer-1.19/buffer.c
    14.6 -@@ -126,11 +126,6 @@
    14.7 - static char *rcsid = "$Header: /a/swan/home/swan/staff/csg/lmjm/src/buffer/RCS/buffer.c,v 1.19 1995/08/24 17:46:28 lmjm Exp lmjm $";
    14.8 - #endif
    14.9 - 
   14.10 --#ifndef __alpha
   14.11 --#ifndef __ia64
   14.12 --extern char *shmat();
   14.13 --#endif /* __ia64 */
   14.14 --#endif /* __alpha */
   14.15 - 
   14.16 - /* General macros */
   14.17 - #define TRUE 1
    15.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    15.2 +++ b/buffer/stuff/patches/buffer-1.19.patch	Thu May 10 21:12:00 2018 +0300
    15.3 @@ -0,0 +1,14 @@
    15.4 +--- buffer-1.19-ori/buffer.c
    15.5 ++++ buffer-1.19/buffer.c
    15.6 +@@ -126,11 +126,6 @@
    15.7 + static char *rcsid = "$Header: /a/swan/home/swan/staff/csg/lmjm/src/buffer/RCS/buffer.c,v 1.19 1995/08/24 17:46:28 lmjm Exp lmjm $";
    15.8 + #endif
    15.9 + 
   15.10 +-#ifndef __alpha
   15.11 +-#ifndef __ia64
   15.12 +-extern char *shmat();
   15.13 +-#endif /* __ia64 */
   15.14 +-#endif /* __alpha */
   15.15 + 
   15.16 + /* General macros */
   15.17 + #define TRUE 1
    16.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    16.2 +++ b/buffer/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    16.3 @@ -0,0 +1,1 @@
    16.4 +-p1|buffer-1.19.patch
    17.1 --- a/cdrdao/receipt	Wed May 09 17:03:28 2018 +0300
    17.2 +++ b/cdrdao/receipt	Thu May 10 21:12:00 2018 +0300
    17.3 @@ -25,8 +25,8 @@
    17.4  	grep -qs 'define u8' scsilib/libscg/scsi-linux-sg.c ||
    17.5  	sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' \
    17.6  		scsilib/libscg/scsi-linux-sg.c
    17.7 -	patch -Np1 -i $stuff/$PACKAGE-$VERSION-stat.patch || return 1
    17.8  	export CXXFLAGS="-Wno-narrowing"
    17.9 +
   17.10  	./configure \
   17.11  		--prefix=/usr \
   17.12  		--with-lame \
    18.1 --- a/cdrdao/stuff/cdrdao-1.2.3-stat.patch	Wed May 09 17:03:28 2018 +0300
    18.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    18.3 @@ -1,13 +0,0 @@
    18.4 -diff -up cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat cdrdao-1.2.3/dao/ScsiIf-linux.cc
    18.5 ---- cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat	2010-01-20 20:11:36.000000000 +0100
    18.6 -+++ cdrdao-1.2.3/dao/ScsiIf-linux.cc	2010-01-20 20:14:07.000000000 +0100
    18.7 -@@ -19,6 +19,9 @@
    18.8 - 
    18.9 - #include <config.h>
   18.10 - 
   18.11 -+#include <sys/types.h>
   18.12 -+#include <sys/stat.h>
   18.13 -+
   18.14 - #include <stdio.h>
   18.15 - #include <fcntl.h>
   18.16 - #include <unistd.h>
    19.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    19.2 +++ b/cdrdao/stuff/patches/cdrdao-1.2.3-stat.patch	Thu May 10 21:12:00 2018 +0300
    19.3 @@ -0,0 +1,13 @@
    19.4 +diff -up cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat cdrdao-1.2.3/dao/ScsiIf-linux.cc
    19.5 +--- cdrdao-1.2.3/dao/ScsiIf-linux.cc.stat	2010-01-20 20:11:36.000000000 +0100
    19.6 ++++ cdrdao-1.2.3/dao/ScsiIf-linux.cc	2010-01-20 20:14:07.000000000 +0100
    19.7 +@@ -19,6 +19,9 @@
    19.8 + 
    19.9 + #include <config.h>
   19.10 + 
   19.11 ++#include <sys/types.h>
   19.12 ++#include <sys/stat.h>
   19.13 ++
   19.14 + #include <stdio.h>
   19.15 + #include <fcntl.h>
   19.16 + #include <unistd.h>
    20.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    20.2 +++ b/cdrdao/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    20.3 @@ -0,0 +1,1 @@
    20.4 +cdrdao-1.2.3-stat.patch
    21.1 --- a/cdrkit/stuff/cdrkit-1.1.9-glibc-2.10.patch	Wed May 09 17:03:28 2018 +0300
    21.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    21.3 @@ -1,143 +0,0 @@
    21.4 -diff -puNr cdrkit-1.1.9.orig/include/schily.h cdrkit-1.1.9/include/schily.h
    21.5 ---- cdrkit-1.1.9.orig/include/schily.h	2006-11-25 01:20:20.000000000 +0100
    21.6 -+++ cdrkit-1.1.9/include/schily.h	2009-03-11 20:31:53.000000000 +0100
    21.7 -@@ -116,7 +116,7 @@ extern	int	fexecl(const char *, FILE *, 
    21.8 - extern	int	fexecle(const char *, FILE *, FILE *, FILE *, const char *, ...);
    21.9 - 		/* 6th arg not const, fexecv forces av[ac] = NULL */
   21.10 - extern	int	fexecv(const char *, FILE *, FILE *, FILE *, int, char **);
   21.11 --extern	int	fexecve(const char *, FILE *, FILE *, FILE *, char * const *, 
   21.12 -+extern	int	f_execve(const char *, FILE *, FILE *, FILE *, char * const *, 
   21.13 - 							  char * const *);
   21.14 - extern	int	fspawnv(FILE *, FILE *, FILE *, int, char * const *);
   21.15 - extern	int	fspawnl(FILE *, FILE *, FILE *, const char *, const char *, ...);
   21.16 -@@ -190,7 +190,7 @@ extern	int	schily_error(const char *, ..
   21.17 - extern	char	*fillbytes(void *, int, char);
   21.18 - extern	char	*findbytes(const void *, int, char);
   21.19 - extern	int	findline(const char *, char, const char *, int, char **, int);
   21.20 --extern	int	getline(char *, int);
   21.21 -+extern	int	get_line(char *, int);
   21.22 - extern	int	getstr(char *, int);
   21.23 - extern	int	breakline(char *, char, char **, int);
   21.24 - extern	int	getallargs(int *, char * const**, const char *, ...);
   21.25 -diff -puNr cdrkit-1.1.9.orig/librols/fexec.c cdrkit-1.1.9/librols/fexec.c
   21.26 ---- cdrkit-1.1.9.orig/librols/fexec.c	2008-02-25 12:14:07.000000000 +0100
   21.27 -+++ cdrkit-1.1.9/librols/fexec.c	2009-03-11 20:31:53.000000000 +0100
   21.28 -@@ -170,7 +170,7 @@ fexecle(name, in, out, err, va_alist)
   21.29 - 	} while (p != NULL);
   21.30 - 	va_end(args);
   21.31 - 
   21.32 --	ret = fexecve(name, in, out, err, av, env);
   21.33 -+	ret = f_execve(name, in, out, err, av, env);
   21.34 - 	if (av != xav)
   21.35 - 		free(av);
   21.36 - 	return (ret);
   21.37 -@@ -184,11 +184,11 @@ fexecv(name, in, out, err, ac, av)
   21.38 - 	char *av[];
   21.39 - {
   21.40 - 	av[ac] = NULL;			/*  force list to be null terminated */
   21.41 --	return (fexecve(name, in, out, err, av, environ));
   21.42 -+	return (f_execve(name, in, out, err, av, environ));
   21.43 - }
   21.44 - 
   21.45 - EXPORT int
   21.46 --fexecve(name, in, out, err, av, env)
   21.47 -+f_execve(name, in, out, err, av, env)
   21.48 - 	const char *name;
   21.49 - 	FILE *in, *out, *err;
   21.50 - 	char * const av[], * const env[];
   21.51 -diff -puNr cdrkit-1.1.9.orig/librols/stdio/fgetline.c cdrkit-1.1.9/librols/stdio/fgetline.c
   21.52 ---- cdrkit-1.1.9.orig/librols/stdio/fgetline.c	2006-09-05 10:39:04.000000000 +0200
   21.53 -+++ cdrkit-1.1.9/librols/stdio/fgetline.c	2009-03-11 20:31:53.000000000 +0100
   21.54 -@@ -76,7 +76,7 @@ fgetline(f, buf, len)
   21.55 - }
   21.56 - 
   21.57 - EXPORT int
   21.58 --getline(buf, len)
   21.59 -+get_line(buf, len)
   21.60 - 	char	*buf;
   21.61 - 	int	len;
   21.62 - {
   21.63 -diff -puNr cdrkit-1.1.9.orig/libusal/scsitransp.c cdrkit-1.1.9/libusal/scsitransp.c
   21.64 ---- cdrkit-1.1.9.orig/libusal/scsitransp.c	2008-02-25 12:14:07.000000000 +0100
   21.65 -+++ cdrkit-1.1.9/libusal/scsitransp.c	2009-03-11 20:31:53.000000000 +0100
   21.66 -@@ -301,7 +301,7 @@ usal_yes(char *msg)
   21.67 - 
   21.68 - 	printf("%s", msg);
   21.69 - 	flush();
   21.70 --	if (getline(okbuf, sizeof (okbuf)) == EOF)
   21.71 -+	if (get_line(okbuf, sizeof (okbuf)) == EOF)
   21.72 - 		exit(EX_BAD);
   21.73 - 	if (streql(okbuf, "y") || streql(okbuf, "yes") ||
   21.74 - 	    streql(okbuf, "Y") || streql(okbuf, "YES"))
   21.75 -diff -puNr cdrkit-1.1.9.orig/readom/io.c cdrkit-1.1.9/readom/io.c
   21.76 ---- cdrkit-1.1.9.orig/readom/io.c	2006-12-08 14:38:43.000000000 +0100
   21.77 -+++ cdrkit-1.1.9/readom/io.c	2009-03-11 20:31:53.000000000 +0100
   21.78 -@@ -130,7 +130,7 @@ BOOL getvalue(char *s, long *lp, long mi
   21.79 - 		(*prt)(s, *lp, mini, maxi, dp);
   21.80 - 		flush();
   21.81 - 		line[0] = '\0';
   21.82 --		if (getline(line, 80) == EOF)
   21.83 -+		if (get_line(line, 80) == EOF)
   21.84 - 			exit(EX_BAD);
   21.85 - 
   21.86 - 		linep = skipwhite(line);
   21.87 -@@ -178,7 +178,7 @@ again:
   21.88 - 	vprintf(form, args);
   21.89 - 	va_end(args);
   21.90 - 	flush();
   21.91 --	if (getline(okbuf, sizeof(okbuf)) == EOF)
   21.92 -+	if (get_line(okbuf, sizeof(okbuf)) == EOF)
   21.93 - 		exit(EX_BAD);
   21.94 - 	if (okbuf[0] == '?') {
   21.95 - 		printf("Enter 'y', 'Y', 'yes' or 'YES' if you agree with the previous asked question.\n");
   21.96 -diff -puNr cdrkit-1.1.9.orig/readom/readom.c cdrkit-1.1.9/readom/readom.c
   21.97 ---- cdrkit-1.1.9.orig/readom/readom.c	2007-04-03 00:43:29.000000000 +0200
   21.98 -+++ cdrkit-1.1.9/readom/readom.c	2009-03-11 20:31:53.000000000 +0100
   21.99 -@@ -1605,7 +1605,7 @@ read_generic(SCSI *usalp, parm_t *parmp,
  21.100 - 		fprintf(stderr, "Copy from SCSI (%d,%d,%d) disk to file\n",
  21.101 - 					usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
  21.102 - 		fprintf(stderr, "Enter filename [%s]: ", defname); flush();
  21.103 --		(void) getline(filename, sizeof (filename));
  21.104 -+		(void) get_line(filename, sizeof (filename));
  21.105 - 	}
  21.106 - 
  21.107 - 	if (askrange) {
  21.108 -@@ -1772,7 +1772,7 @@ write_disk(SCSI *usalp, parm_t *parmp)
  21.109 - 		fprintf(stderr, "Copy from file to SCSI (%d,%d,%d) disk\n",
  21.110 - 					usal_scsibus(usalp), usal_target(usalp), usal_lun(usalp));
  21.111 - 		fprintf(stderr, "Enter filename [%s]: ", defname); flush();
  21.112 --		(void) getline(filename, sizeof (filename));
  21.113 -+		(void) get_line(filename, sizeof (filename));
  21.114 - 		fprintf(stderr, "Notice: reading from file always starts at file offset 0.\n");
  21.115 - 
  21.116 - 		getlong("Enter starting sector for copy:", &addr, 0L, end-1);
  21.117 -diff -puNr cdrkit-1.1.9.orig/wodim/cue.c cdrkit-1.1.9/wodim/cue.c
  21.118 ---- cdrkit-1.1.9.orig/wodim/cue.c	2006-12-08 14:38:43.000000000 +0100
  21.119 -+++ cdrkit-1.1.9/wodim/cue.c	2009-03-11 20:32:18.000000000 +0100
  21.120 -@@ -253,7 +253,7 @@ static	char	*skipwhite(const char *s);
  21.121 - static	char	*peekword(void);
  21.122 - static	char	*lineend(void);
  21.123 - static	char	*markword(char *delim);
  21.124 --static	char	getdelim(void);
  21.125 -+static	char	get_delim(void);
  21.126 - static	char	*getnextitem(char *delim);
  21.127 - static	char	*neednextitem(char *delim);
  21.128 - static	char	*nextword(void);
  21.129 -@@ -746,7 +746,7 @@ parse_track(track_t trackp[], state_t *s
  21.130 - 	if (kp == NULL)
  21.131 - 		cueabort("Unknown filetype '%s'", word);
  21.132 - 
  21.133 --	if (getdelim() == '/') {
  21.134 -+	if (get_delim() == '/') {
  21.135 - 		word = needitem();
  21.136 - 		if (*astol(++word, &secsize) != '\0')
  21.137 - 			cueabort("Not a number '%s'", word);
  21.138 -@@ -1128,7 +1128,7 @@ linelen--;
  21.139 - }
  21.140 - 
  21.141 - static char 
  21.142 --getdelim()
  21.143 -+get_delim()
  21.144 - {
  21.145 - 	return (wordendc);
  21.146 - }
    22.1 --- a/clementine/receipt	Wed May 09 17:03:28 2018 +0300
    22.2 +++ b/clementine/receipt	Thu May 10 21:12:00 2018 +0300
    22.3 @@ -23,7 +23,6 @@
    22.4  compile_rules()
    22.5  {
    22.6  	mkdir build
    22.7 -	patch -Np1 -i $stuff/udisks-namespace.patch
    22.8  	cd $src/build
    22.9  	cmake \
   22.10  		-DCMAKE_INSTALL_PREFIX=/usr \
    23.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    23.2 +++ b/clementine/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    23.3 @@ -0,0 +1,1 @@
    23.4 +udisks-namespace.patch
    24.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    24.2 +++ b/clementine/stuff/patches/udisks-namespace.patch	Thu May 10 21:12:00 2018 +0300
    24.3 @@ -0,0 +1,33 @@
    24.4 +---
    24.5 + src/CMakeLists.txt | 9 ++++-----
    24.6 + 1 file changed, 4 insertions(+), 5 deletions(-)
    24.7 +
    24.8 +diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
    24.9 +index 650fa74..775b0a5 100644
   24.10 +--- a/src/CMakeLists.txt
   24.11 ++++ b/src/CMakeLists.txt
   24.12 +@@ -892,11 +892,6 @@ optional_source(LINUX SOURCES widgets/osd_x11.cpp)
   24.13 + if(HAVE_DBUS)
   24.14 +   file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus)
   24.15 + 
   24.16 +-  # Hack to get it to generate interfaces without namespaces - required
   24.17 +-  # because otherwise org::freedesktop::UDisks and
   24.18 +-  # org::freedesktop::UDisks::Device conflict.
   24.19 +-  list(APPEND QT_DBUSXML2CPP_EXECUTABLE -N)
   24.20 +-
   24.21 +   # MPRIS DBUS interfaces
   24.22 +   qt4_add_dbus_adaptor(SOURCES
   24.23 +       dbus/org.freedesktop.MediaPlayer.player.xml
   24.24 +@@ -964,6 +959,10 @@ if(HAVE_DBUS)
   24.25 + 
   24.26 +   # DeviceKit DBUS interfaces
   24.27 +   if(HAVE_DEVICEKIT)
   24.28 ++    set_source_files_properties(dbus/org.freedesktop.UDisks.xml
   24.29 ++        PROPERTIES NO_NAMESPACE dbus/udisks)
   24.30 ++    set_source_files_properties(dbus/org.freedesktop.UDisks.Device.xml
   24.31 ++        PROPERTIES NO_NAMESPACE dbus/udisksdevice)
   24.32 +     qt4_add_dbus_interface(SOURCES
   24.33 +         dbus/org.freedesktop.UDisks.xml
   24.34 +         dbus/udisks)
   24.35 +-- 
   24.36 +2.0.3
    25.1 --- a/clementine/stuff/udisks-namespace.patch	Wed May 09 17:03:28 2018 +0300
    25.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    25.3 @@ -1,33 +0,0 @@
    25.4 ----
    25.5 - src/CMakeLists.txt | 9 ++++-----
    25.6 - 1 file changed, 4 insertions(+), 5 deletions(-)
    25.7 -
    25.8 -diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
    25.9 -index 650fa74..775b0a5 100644
   25.10 ---- a/src/CMakeLists.txt
   25.11 -+++ b/src/CMakeLists.txt
   25.12 -@@ -892,11 +892,6 @@ optional_source(LINUX SOURCES widgets/osd_x11.cpp)
   25.13 - if(HAVE_DBUS)
   25.14 -   file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/dbus)
   25.15 - 
   25.16 --  # Hack to get it to generate interfaces without namespaces - required
   25.17 --  # because otherwise org::freedesktop::UDisks and
   25.18 --  # org::freedesktop::UDisks::Device conflict.
   25.19 --  list(APPEND QT_DBUSXML2CPP_EXECUTABLE -N)
   25.20 --
   25.21 -   # MPRIS DBUS interfaces
   25.22 -   qt4_add_dbus_adaptor(SOURCES
   25.23 -       dbus/org.freedesktop.MediaPlayer.player.xml
   25.24 -@@ -964,6 +959,10 @@ if(HAVE_DBUS)
   25.25 - 
   25.26 -   # DeviceKit DBUS interfaces
   25.27 -   if(HAVE_DEVICEKIT)
   25.28 -+    set_source_files_properties(dbus/org.freedesktop.UDisks.xml
   25.29 -+        PROPERTIES NO_NAMESPACE dbus/udisks)
   25.30 -+    set_source_files_properties(dbus/org.freedesktop.UDisks.Device.xml
   25.31 -+        PROPERTIES NO_NAMESPACE dbus/udisksdevice)
   25.32 -     qt4_add_dbus_interface(SOURCES
   25.33 -         dbus/org.freedesktop.UDisks.xml
   25.34 -         dbus/udisks)
   25.35 --- 
   25.36 -2.0.3
    26.1 --- a/clisp/receipt	Wed May 09 17:03:28 2018 +0300
    26.2 +++ b/clisp/receipt	Thu May 10 21:12:00 2018 +0300
    26.3 @@ -16,9 +16,6 @@
    26.4  # Rules to configure and make the package.
    26.5  compile_rules()
    26.6  {
    26.7 -	# Temporarily (?) disabling one failed test
    26.8 -	patch -p1 -i $stuff/streams.tst.patch
    26.9 -
   26.10  	# CFLAGS/CXXFLAGS/MAKEFLAGS screw the build process.
   26.11  	unset CFLAGS CXXFLAGS MAKEFLAGS
   26.12  	export CFLAGS="-falign-functions=4"
    27.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    27.2 +++ b/clisp/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    27.3 @@ -0,0 +1,2 @@
    27.4 +# Temporarily (?) disabling one failed test
    27.5 +-p1|streams.tst.patch
    28.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    28.2 +++ b/clisp/stuff/patches/streams.tst.patch	Thu May 10 21:12:00 2018 +0300
    28.3 @@ -0,0 +1,43 @@
    28.4 +Disable one test from "streams" group.
    28.5 +
    28.6 +
    28.7 +1) Normal test flow: http://cook.slitaz.org/cooker.cgi?log=clisp.log.2
    28.8 +
    28.9 +(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S)))
   28.10 +;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 301 Moved Permanently --> "http://www.clisp.org/impnotes/id-href.map"
   28.11 +;; connecting to "http://www.clisp.org/impnotes/id-href.map"...connected...HTTP/1.1 200 OK...74,297 bytes
   28.12 +;; SYSTEM::GET-STRING-MAP(#<IO INPUT-BUFFERED SOCKET-STREAM CHARACTER www.clisp.org:80>)...2,004 IDs
   28.13 +;; SYSTEM::ENSURE-IMPNOTES-MAP(#P"/home/slitaz/wok/clisp/source/clisp-2.49/doc/Symbol-Table.text")...
   28.14 +WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol
   28.15 +         "EXT:SOURCE-PROGRAM-ERROR"
   28.16 +WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol
   28.17 +         "EXT:SOURCE-PROGRAM-ERROR-DETAIL"
   28.18 +WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol
   28.19 +         "EXT:SOURCE-PROGRAM-ERROR-FORM"
   28.20 +644 IDs
   28.21 +EQL-OK: T
   28.22 +
   28.23 +
   28.24 +2) Something wrong (network problems?): http://cook.slitaz.org/cooker.cgi?pkg=clisp
   28.25 +
   28.26 +(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S)))
   28.27 +;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 302 Found --> "https://clisp.cons.org:80/impnotes/id-href.map"
   28.28 +;; connecting to "http://clisp.cons.orghttps://clisp.cons.org:80/impnotes/id-href.map"...
   28.29 +[SIMPLE-PARSE-ERROR]: PARSE-INTEGER: substring "" does not have integer syntax at position 0
   28.30 +
   28.31 +ERROR!! ERROR should be T !
   28.32 +
   28.33 +
   28.34 +--- a/tests/streams.tst
   28.35 ++++ b/tests/streams.tst
   28.36 +@@ -1036,8 +1036,8 @@
   28.37 +            (describe (make-array nil :element-type nil) s)))
   28.38 + T
   28.39 + 
   28.40 +-(stringp (with-output-to-string (s) (describe nil s)))
   28.41 +-T
   28.42 ++;;(stringp (with-output-to-string (s) (describe nil s)))
   28.43 ++;;T
   28.44 + 
   28.45 + ;; https://sourceforge.net/tracker/index.php?func=detail&aid=1622642&group_id=1355&atid=101355
   28.46 + (let ((s "a   b"))
    29.1 --- a/clisp/stuff/streams.tst.patch	Wed May 09 17:03:28 2018 +0300
    29.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    29.3 @@ -1,43 +0,0 @@
    29.4 -Disable one test from "streams" group.
    29.5 -
    29.6 -
    29.7 -1) Normal test flow: http://cook.slitaz.org/cooker.cgi?log=clisp.log.2
    29.8 -
    29.9 -(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S)))
   29.10 -;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 301 Moved Permanently --> "http://www.clisp.org/impnotes/id-href.map"
   29.11 -;; connecting to "http://www.clisp.org/impnotes/id-href.map"...connected...HTTP/1.1 200 OK...74,297 bytes
   29.12 -;; SYSTEM::GET-STRING-MAP(#<IO INPUT-BUFFERED SOCKET-STREAM CHARACTER www.clisp.org:80>)...2,004 IDs
   29.13 -;; SYSTEM::ENSURE-IMPNOTES-MAP(#P"/home/slitaz/wok/clisp/source/clisp-2.49/doc/Symbol-Table.text")...
   29.14 -WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol
   29.15 -         "EXT:SOURCE-PROGRAM-ERROR"
   29.16 -WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol
   29.17 -         "EXT:SOURCE-PROGRAM-ERROR-DETAIL"
   29.18 -WARNING: SYSTEM::ENSURE-IMPNOTES-MAP: invalid id "compile-errors" for symbol
   29.19 -         "EXT:SOURCE-PROGRAM-ERROR-FORM"
   29.20 -644 IDs
   29.21 -EQL-OK: T
   29.22 -
   29.23 -
   29.24 -2) Something wrong (network problems?): http://cook.slitaz.org/cooker.cgi?pkg=clisp
   29.25 -
   29.26 -(STRINGP (WITH-OUTPUT-TO-STRING (S) (DESCRIBE NIL S)))
   29.27 -;; connecting to "http://clisp.cons.org/impnotes/id-href.map"...connected...HTTP/1.1 302 Found --> "https://clisp.cons.org:80/impnotes/id-href.map"
   29.28 -;; connecting to "http://clisp.cons.orghttps://clisp.cons.org:80/impnotes/id-href.map"...
   29.29 -[SIMPLE-PARSE-ERROR]: PARSE-INTEGER: substring "" does not have integer syntax at position 0
   29.30 -
   29.31 -ERROR!! ERROR should be T !
   29.32 -
   29.33 -
   29.34 ---- a/tests/streams.tst
   29.35 -+++ b/tests/streams.tst
   29.36 -@@ -1036,8 +1036,8 @@
   29.37 -            (describe (make-array nil :element-type nil) s)))
   29.38 - T
   29.39 - 
   29.40 --(stringp (with-output-to-string (s) (describe nil s)))
   29.41 --T
   29.42 -+;;(stringp (with-output-to-string (s) (describe nil s)))
   29.43 -+;;T
   29.44 - 
   29.45 - ;; https://sourceforge.net/tracker/index.php?func=detail&aid=1622642&group_id=1355&atid=101355
   29.46 - (let ((s "a   b"))
    30.1 --- a/cmark-gfm/receipt	Wed May 09 17:03:28 2018 +0300
    30.2 +++ b/cmark-gfm/receipt	Thu May 10 21:12:00 2018 +0300
    30.3 @@ -17,8 +17,6 @@
    30.4  # Rules to configure and make the package.
    30.5  compile_rules()
    30.6  {
    30.7 -	patch -p1 -i $stuff/cmark-0.27.1.76.patch
    30.8 -
    30.9  	mkdir build; cd build
   30.10  	cmake .. -DCMAKE_INSTALL_PREFIX=/usr &&
   30.11  	make &&
    31.1 --- a/cmark-gfm/stuff/cmark-0.27.1.76.patch	Wed May 09 17:03:28 2018 +0300
    31.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    31.3 @@ -1,10 +0,0 @@
    31.4 ---- a/man/CMakeLists.txt
    31.5 -+++ b/man/CMakeLists.txt
    31.6 -@@ -5,6 +5,6 @@
    31.7 -   install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
    31.8 -     DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
    31.9 - 
   31.10 --  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark.3
   31.11 -+  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark-gfm.3
   31.12 -     DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
   31.13 - endif(NOT MSVC)
    32.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    32.2 +++ b/cmark-gfm/stuff/patches/cmark-0.27.1.76.patch	Thu May 10 21:12:00 2018 +0300
    32.3 @@ -0,0 +1,10 @@
    32.4 +--- a/man/CMakeLists.txt
    32.5 ++++ b/man/CMakeLists.txt
    32.6 +@@ -5,6 +5,6 @@
    32.7 +   install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man1/cmark.1
    32.8 +     DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
    32.9 + 
   32.10 +-  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark.3
   32.11 ++  install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/man3/cmark-gfm.3
   32.12 +     DESTINATION ${CMAKE_INSTALL_MANDIR}/man3)
   32.13 + endif(NOT MSVC)
    33.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    33.2 +++ b/cmark-gfm/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    33.3 @@ -0,0 +1,1 @@
    33.4 +-p1|cmark-0.27.1.76.patch
    34.1 --- a/codeblocks/receipt	Wed May 09 17:03:28 2018 +0300
    34.2 +++ b/codeblocks/receipt	Thu May 10 21:12:00 2018 +0300
    34.3 @@ -19,8 +19,6 @@
    34.4  	# Binutils 2.22 break many packages build without LDFLAGS set correctly.
    34.5  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
    34.6  
    34.7 -	busybox patch -p1 -i $stuff/glib.u
    34.8 -
    34.9  	./configure \
   34.10  		--with-contrib-plugins="all, -help" \
   34.11  		$CONFIGURE_ARGS &&
    35.1 --- a/codeblocks/stuff/glib.u	Wed May 09 17:03:28 2018 +0300
    35.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    35.3 @@ -1,78 +0,0 @@
    35.4 -Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883
    35.5 -
    35.6 ---- codeblocks-8.02/src/src/prefix.cpp
    35.7 -+++ codeblocks-8.02/src/src/prefix.cpp
    35.8 -@@ -393,7 +393,7 @@
    35.9 - 
   35.10 - 	br_return_val_if_fail (path != (char *) NULL, (char *) NULL);
   35.11 - 
   35.12 --	end = strrchr (path, '/');
   35.13 -+	end = strrchr ((char *) path, '/');
   35.14 - 	if (!end) return strdup (".");
   35.15 - 
   35.16 - 	while (end > path && *end == '/')
   35.17 -@@ -429,7 +429,7 @@
   35.18 - 	br_return_val_if_fail (path != (char *) NULL, (char *) NULL);
   35.19 - 
   35.20 - 	if (!*path) return strdup ("/");
   35.21 --	end = strrchr (path, '/');
   35.22 -+	end = strrchr ((char *) path, '/');
   35.23 - 	if (!end) return strdup (path);
   35.24 - 
   35.25 - 	tmp = br_strndup ((char *) path, end - path);
   35.26 -
   35.27 ---- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp
   35.28 -+++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp
   35.29 -@@ -21,6 +21,13 @@
   35.30 - 
   35.31 - #include <cstring>
   35.32 - #include "sdk.h"
   35.33 -+#if defined(__WXGTK__)
   35.34 -+#define GSocket GlibGSocket
   35.35 -+    #include "wx/gtk/win_gtk.h"
   35.36 -+#undef GSocket
   35.37 -+    #include <gdk/gdkx.h>
   35.38 -+#endif
   35.39 -+
   35.40 - #ifndef CB_PRECOMP
   35.41 - 	#include <wx/event.h>
   35.42 - 	#include <wx/frame.h> // Manager::Get()->GetAppWindow()
   35.43 -@@ -51,11 +58,6 @@
   35.44 - #include <wx/wxFlatNotebook/wxFlatNotebook.h>
   35.45 - #include "memorymappedfile.h"
   35.46 - 
   35.47 --#if defined(__WXGTK__)
   35.48 --    #include "wx/gtk/win_gtk.h"
   35.49 --    #include <gdk/gdkx.h>
   35.50 --#endif
   35.51 --
   35.52 - // The plugin needs a flag ON to enable some code for the plugin
   35.53 - #if !defined(BUILDING_PLUGIN)
   35.54 -     #error preprocessor BUILDING_PLUGIN flag required for this target
   35.55 -
   35.56 ---- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
   35.57 -+++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
   35.58 -@@ -19,6 +19,12 @@
   35.59 - */
   35.60 - // RCS-ID: $Id: codesnippetstreectrl.cpp 112 2008-01-07 17:03:31Z Pecan $
   35.61 - 
   35.62 -+#if defined(__WXGTK__)
   35.63 -+#define GSocket GlibGSocket
   35.64 -+    #include "wx/gtk/win_gtk.h"
   35.65 -+#undef GSocket
   35.66 -+    #include <gdk/gdkx.h>
   35.67 -+#endif
   35.68 - #ifdef WX_PRECOMP
   35.69 -     #include "wx_pch.h"
   35.70 - #else
   35.71 -@@ -48,10 +54,6 @@
   35.72 - #include "messagebox.h"
   35.73 - #include "menuidentifiers.h"
   35.74 - #include "editsnippetframe.h"
   35.75 --#if defined(__WXGTK__)
   35.76 --    #include "wx/gtk/win_gtk.h"
   35.77 --    #include <gdk/gdkx.h>
   35.78 --#endif
   35.79 - 
   35.80 - IMPLEMENT_DYNAMIC_CLASS(CodeSnippetsTreeCtrl, wxTreeCtrl)
   35.81 - 
    36.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    36.2 +++ b/codeblocks/stuff/patches/glib.u	Thu May 10 21:12:00 2018 +0300
    36.3 @@ -0,0 +1,78 @@
    36.4 +Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883
    36.5 +
    36.6 +--- codeblocks-8.02/src/src/prefix.cpp
    36.7 ++++ codeblocks-8.02/src/src/prefix.cpp
    36.8 +@@ -393,7 +393,7 @@
    36.9 + 
   36.10 + 	br_return_val_if_fail (path != (char *) NULL, (char *) NULL);
   36.11 + 
   36.12 +-	end = strrchr (path, '/');
   36.13 ++	end = strrchr ((char *) path, '/');
   36.14 + 	if (!end) return strdup (".");
   36.15 + 
   36.16 + 	while (end > path && *end == '/')
   36.17 +@@ -429,7 +429,7 @@
   36.18 + 	br_return_val_if_fail (path != (char *) NULL, (char *) NULL);
   36.19 + 
   36.20 + 	if (!*path) return strdup ("/");
   36.21 +-	end = strrchr (path, '/');
   36.22 ++	end = strrchr ((char *) path, '/');
   36.23 + 	if (!end) return strdup (path);
   36.24 + 
   36.25 + 	tmp = br_strndup ((char *) path, end - path);
   36.26 +
   36.27 +--- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp
   36.28 ++++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippets.cpp
   36.29 +@@ -21,6 +21,13 @@
   36.30 + 
   36.31 + #include <cstring>
   36.32 + #include "sdk.h"
   36.33 ++#if defined(__WXGTK__)
   36.34 ++#define GSocket GlibGSocket
   36.35 ++    #include "wx/gtk/win_gtk.h"
   36.36 ++#undef GSocket
   36.37 ++    #include <gdk/gdkx.h>
   36.38 ++#endif
   36.39 ++
   36.40 + #ifndef CB_PRECOMP
   36.41 + 	#include <wx/event.h>
   36.42 + 	#include <wx/frame.h> // Manager::Get()->GetAppWindow()
   36.43 +@@ -51,11 +58,6 @@
   36.44 + #include <wx/wxFlatNotebook/wxFlatNotebook.h>
   36.45 + #include "memorymappedfile.h"
   36.46 + 
   36.47 +-#if defined(__WXGTK__)
   36.48 +-    #include "wx/gtk/win_gtk.h"
   36.49 +-    #include <gdk/gdkx.h>
   36.50 +-#endif
   36.51 +-
   36.52 + // The plugin needs a flag ON to enable some code for the plugin
   36.53 + #if !defined(BUILDING_PLUGIN)
   36.54 +     #error preprocessor BUILDING_PLUGIN flag required for this target
   36.55 +
   36.56 +--- codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
   36.57 ++++ codeblocks-8.02/src/plugins/contrib/codesnippets/codesnippetstreectrl.cpp
   36.58 +@@ -19,6 +19,12 @@
   36.59 + */
   36.60 + // RCS-ID: $Id: codesnippetstreectrl.cpp 112 2008-01-07 17:03:31Z Pecan $
   36.61 + 
   36.62 ++#if defined(__WXGTK__)
   36.63 ++#define GSocket GlibGSocket
   36.64 ++    #include "wx/gtk/win_gtk.h"
   36.65 ++#undef GSocket
   36.66 ++    #include <gdk/gdkx.h>
   36.67 ++#endif
   36.68 + #ifdef WX_PRECOMP
   36.69 +     #include "wx_pch.h"
   36.70 + #else
   36.71 +@@ -48,10 +54,6 @@
   36.72 + #include "messagebox.h"
   36.73 + #include "menuidentifiers.h"
   36.74 + #include "editsnippetframe.h"
   36.75 +-#if defined(__WXGTK__)
   36.76 +-    #include "wx/gtk/win_gtk.h"
   36.77 +-    #include <gdk/gdkx.h>
   36.78 +-#endif
   36.79 + 
   36.80 + IMPLEMENT_DYNAMIC_CLASS(CodeSnippetsTreeCtrl, wxTreeCtrl)
   36.81 + 
    37.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    37.2 +++ b/codeblocks/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    37.3 @@ -0,0 +1,1 @@
    37.4 +-p1|glib.u
    38.1 --- a/comical/receipt	Wed May 09 17:03:28 2018 +0300
    38.2 +++ b/comical/receipt	Thu May 10 21:12:00 2018 +0300
    38.3 @@ -16,7 +16,6 @@
    38.4  # Rules to configure and make the package.
    38.5  compile_rules()
    38.6  {
    38.7 -	patch -p1 -i $stuff/comical-0.8_wx-2.8.patch
    38.8  	make -j 1
    38.9  }
   38.10  
    39.1 --- a/comical/stuff/comical-0.8_wx-2.8.patch	Wed May 09 17:03:28 2018 +0300
    39.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    39.3 @@ -1,51 +0,0 @@
    39.4 ---- "a/Comical Icons/comical.xpm"
    39.5 -+++ "b/Comical Icons/comical.xpm"
    39.6 -@@ -1,5 +1,5 @@
    39.7 - /* XPM */
    39.8 --static char *comical_xpm[]={
    39.9 -+static const char *comical_xpm[]={
   39.10 - "128 128 131 2",
   39.11 - "Qt c None",
   39.12 - ".8 c #080000",
   39.13 ---- a/src/ComicalApp.cpp
   39.14 -+++ b/src/ComicalApp.cpp
   39.15 -@@ -28,6 +28,8 @@
   39.16 - #include "ComicalApp.h"
   39.17 - #include "ComicalFrame.h"
   39.18 - #include <wx/log.h>
   39.19 -+#include <wx/icon.h>
   39.20 -+#include <wx/numdlg.h>
   39.21 - 
   39.22 - #if !defined(__WXMAC__) && !defined(__WXCOCOA__) && !defined(__WXMSW__) && !defined(__WXPM__)
   39.23 - #include "../Comical Icons/comical.xpm"
   39.24 ---- a/src/ComicBook.cpp
   39.25 -+++ b/src/ComicBook.cpp
   39.26 -@@ -537,7 +537,8 @@
   39.27 - 			if (curr > 0) {	// ftw and fth scaling requires previous page to
   39.28 - 				target--;	// do FitWithoutScrollbars.
   39.29 - 				if (target > high)
   39.30 --					target = curr - (++target - high);
   39.31 -+					// target = curr - (++target - high); // will cause 'target' uninitialized warning
   39.32 -+					target = curr - ((target + 1) - high);
   39.33 - 			} else if (target > high)
   39.34 - 				target = curr - (target - high);
   39.35 - 			try {
   39.36 ---- a/Makefile
   39.37 -+++ b/Makefile
   39.38 -@@ -1,8 +1,8 @@
   39.39 - CC = `wx-config --cxx`
   39.40 --LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip
   39.41 -+LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -lz
   39.42 - INSTALL = install
   39.43 - INSTALL_PROGRAM = $(INSTALL)
   39.44 --prefix = /usr/local
   39.45 -+prefix = /usr
   39.46 - exec_prefix = $(prefix)
   39.47 - bindir = $(exec_prefix)/bin
   39.48 - 
   39.49 -@@ -43,4 +43,4 @@
   39.50 - 	$(MAKE) clean -C unzip
   39.51 - 	rm -f $(DEPS) bin2h src/bin2h.o
   39.52 - 
   39.53 --.PHONY : install install-strip uninstall clean distclean
   39.54 -+.PHONY : all install install-strip uninstall clean distclean
    40.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    40.2 +++ b/comical/stuff/patches/comical-0.8_wx-2.8.patch	Thu May 10 21:12:00 2018 +0300
    40.3 @@ -0,0 +1,51 @@
    40.4 +--- "a/Comical Icons/comical.xpm"
    40.5 ++++ "b/Comical Icons/comical.xpm"
    40.6 +@@ -1,5 +1,5 @@
    40.7 + /* XPM */
    40.8 +-static char *comical_xpm[]={
    40.9 ++static const char *comical_xpm[]={
   40.10 + "128 128 131 2",
   40.11 + "Qt c None",
   40.12 + ".8 c #080000",
   40.13 +--- a/src/ComicalApp.cpp
   40.14 ++++ b/src/ComicalApp.cpp
   40.15 +@@ -28,6 +28,8 @@
   40.16 + #include "ComicalApp.h"
   40.17 + #include "ComicalFrame.h"
   40.18 + #include <wx/log.h>
   40.19 ++#include <wx/icon.h>
   40.20 ++#include <wx/numdlg.h>
   40.21 + 
   40.22 + #if !defined(__WXMAC__) && !defined(__WXCOCOA__) && !defined(__WXMSW__) && !defined(__WXPM__)
   40.23 + #include "../Comical Icons/comical.xpm"
   40.24 +--- a/src/ComicBook.cpp
   40.25 ++++ b/src/ComicBook.cpp
   40.26 +@@ -537,7 +537,8 @@
   40.27 + 			if (curr > 0) {	// ftw and fth scaling requires previous page to
   40.28 + 				target--;	// do FitWithoutScrollbars.
   40.29 + 				if (target > high)
   40.30 +-					target = curr - (++target - high);
   40.31 ++					// target = curr - (++target - high); // will cause 'target' uninitialized warning
   40.32 ++					target = curr - ((target + 1) - high);
   40.33 + 			} else if (target > high)
   40.34 + 				target = curr - (target - high);
   40.35 + 			try {
   40.36 +--- a/Makefile
   40.37 ++++ b/Makefile
   40.38 +@@ -1,8 +1,8 @@
   40.39 + CC = `wx-config --cxx`
   40.40 +-LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip
   40.41 ++LDFLAGS = `wx-config --libs` -Lunrar -lunrar -Lunzip -lminiunzip -lz
   40.42 + INSTALL = install
   40.43 + INSTALL_PROGRAM = $(INSTALL)
   40.44 +-prefix = /usr/local
   40.45 ++prefix = /usr
   40.46 + exec_prefix = $(prefix)
   40.47 + bindir = $(exec_prefix)/bin
   40.48 + 
   40.49 +@@ -43,4 +43,4 @@
   40.50 + 	$(MAKE) clean -C unzip
   40.51 + 	rm -f $(DEPS) bin2h src/bin2h.o
   40.52 + 
   40.53 +-.PHONY : install install-strip uninstall clean distclean
   40.54 ++.PHONY : all install install-strip uninstall clean distclean
    41.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    41.2 +++ b/comical/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    41.3 @@ -0,0 +1,1 @@
    41.4 +-p1|comical-0.8_wx-2.8.patch
    42.1 --- a/cryptkeeper/receipt	Wed May 09 17:03:28 2018 +0300
    42.2 +++ b/cryptkeeper/receipt	Thu May 10 21:12:00 2018 +0300
    42.3 @@ -17,7 +17,6 @@
    42.4  compile_rules()
    42.5  {
    42.6  	mv po/ru_RU.gmo po/ru.gmo
    42.7 -	patch -p1 -i $stuff/cryptkeeper.patch
    42.8  	export LDFLAGS="-lX11"
    42.9  
   42.10  	./configure $CONFIGURE_ARGS && make && make install
    43.1 --- a/cryptkeeper/stuff/cryptkeeper.patch	Wed May 09 17:03:28 2018 +0300
    43.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    43.3 @@ -1,40 +0,0 @@
    43.4 ---- a/src/defines.h
    43.5 -+++ b/src/defines.h
    43.6 -@@ -4,7 +4,7 @@
    43.7 - #define UI_SPACING	5
    43.8 - #define UI_WINDOW_BORDER	10
    43.9 - 
   43.10 --#define DEFAULT_FILEMANAGER	"nautilus"
   43.11 -+#define DEFAULT_FILEMANAGER	"pcmanfm"
   43.12 - 
   43.13 - #include "../config.h"
   43.14 - #include "../lib/gettext.h"
   43.15 -
   43.16 ---- a/src/lsof.cpp
   43.17 -+++ b/src/lsof.cpp
   43.18 -@@ -17,6 +17,7 @@
   43.19 -  */
   43.20 - #include <stdlib.h>
   43.21 - #include <stdio.h>
   43.22 -+#include <unistd.h>
   43.23 - #include <string>
   43.24 - #include <vector>
   43.25 - #include <assert.h>
   43.26 -
   43.27 ---- a/po/LINGUAS
   43.28 -+++ b.po/LINGUAS
   43.29 -@@ -1 +1 @@
   43.30 --en@quot en@boldquot fr en_GB de_DE pt_BR ru_RU tr pl es_ES it
   43.31 -+en@quot en@boldquot fr en_GB de_DE pt_BR ru tr pl es_ES it
   43.32 -
   43.33 ---- a/cryptkeeper.desktop
   43.34 -+++ b/cryptkeeper.desktop
   43.35 -@@ -3,7 +3,7 @@
   43.36 - Name=Cryptkeeper
   43.37 - Exec=cryptkeeper
   43.38 - Icon=cryptkeeper
   43.39 --Categories=Application;System;
   43.40 -+Categories=Application;System;Security;
   43.41 - Terminal=false
   43.42 - Type=Application
   43.43 - StartupNotify=false
    44.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    44.2 +++ b/cryptkeeper/stuff/patches/cryptkeeper.patch	Thu May 10 21:12:00 2018 +0300
    44.3 @@ -0,0 +1,40 @@
    44.4 +--- a/src/defines.h
    44.5 ++++ b/src/defines.h
    44.6 +@@ -4,7 +4,7 @@
    44.7 + #define UI_SPACING	5
    44.8 + #define UI_WINDOW_BORDER	10
    44.9 + 
   44.10 +-#define DEFAULT_FILEMANAGER	"nautilus"
   44.11 ++#define DEFAULT_FILEMANAGER	"pcmanfm"
   44.12 + 
   44.13 + #include "../config.h"
   44.14 + #include "../lib/gettext.h"
   44.15 +
   44.16 +--- a/src/lsof.cpp
   44.17 ++++ b/src/lsof.cpp
   44.18 +@@ -17,6 +17,7 @@
   44.19 +  */
   44.20 + #include <stdlib.h>
   44.21 + #include <stdio.h>
   44.22 ++#include <unistd.h>
   44.23 + #include <string>
   44.24 + #include <vector>
   44.25 + #include <assert.h>
   44.26 +
   44.27 +--- a/po/LINGUAS
   44.28 ++++ b.po/LINGUAS
   44.29 +@@ -1 +1 @@
   44.30 +-en@quot en@boldquot fr en_GB de_DE pt_BR ru_RU tr pl es_ES it
   44.31 ++en@quot en@boldquot fr en_GB de_DE pt_BR ru tr pl es_ES it
   44.32 +
   44.33 +--- a/cryptkeeper.desktop
   44.34 ++++ b/cryptkeeper.desktop
   44.35 +@@ -3,7 +3,7 @@
   44.36 + Name=Cryptkeeper
   44.37 + Exec=cryptkeeper
   44.38 + Icon=cryptkeeper
   44.39 +-Categories=Application;System;
   44.40 ++Categories=Application;System;Security;
   44.41 + Terminal=false
   44.42 + Type=Application
   44.43 + StartupNotify=false
    45.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    45.2 +++ b/cryptkeeper/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    45.3 @@ -0,0 +1,1 @@
    45.4 +-p1|cryptkeeper.patch
    46.1 --- a/csstidy/receipt	Wed May 09 17:03:28 2018 +0300
    46.2 +++ b/csstidy/receipt	Thu May 10 21:12:00 2018 +0300
    46.3 @@ -16,7 +16,6 @@
    46.4  # Rules to configure and make the package.
    46.5  compile_rules()
    46.6  {
    46.7 -	patch -p1 -i $stuff/csstidy-1.4-fix-misc.cpp.patch
    46.8  	scons
    46.9  	mkdir -p $install/usr/bin
   46.10  	cp -a $src/release/csstidy/csstidy $install/usr/bin
    47.1 --- a/csstidy/stuff/csstidy-1.4-fix-misc.cpp.patch	Wed May 09 17:03:28 2018 +0300
    47.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    47.3 @@ -1,10 +0,0 @@
    47.4 ---- a/csstidy/misc.cpp
    47.5 -+++ b/csstidy/misc.cpp
    47.6 -@@ -16,6 +16,7 @@
    47.7 -  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    47.8 -  */
    47.9 -  
   47.10 -+#include <string.h>
   47.11 - #include "csspp_globals.hpp"
   47.12 - 
   47.13 - bool escaped(const string &istring, const int pos) 
    48.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    48.2 +++ b/csstidy/stuff/patches/csstidy-1.4-fix-misc.cpp.patch	Thu May 10 21:12:00 2018 +0300
    48.3 @@ -0,0 +1,10 @@
    48.4 +--- a/csstidy/misc.cpp
    48.5 ++++ b/csstidy/misc.cpp
    48.6 +@@ -16,6 +16,7 @@
    48.7 +  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    48.8 +  */
    48.9 +  
   48.10 ++#include <string.h>
   48.11 + #include "csspp_globals.hpp"
   48.12 + 
   48.13 + bool escaped(const string &istring, const int pos) 
    49.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    49.2 +++ b/csstidy/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    49.3 @@ -0,0 +1,1 @@
    49.4 +-p1|csstidy-1.4-fix-misc.cpp.patch
    50.1 --- a/dia/receipt	Wed May 09 17:03:28 2018 +0300
    50.2 +++ b/dia/receipt	Thu May 10 21:12:00 2018 +0300
    50.3 @@ -19,7 +19,6 @@
    50.4  compile_rules() {
    50.5  	#find . -name '*.[ch]*' | xargs sed -i 's|<glib/.*h|<glib.h|'
    50.6  	#sed -i 's|stdio.h>|&\n#include <sys/stat.h>|' plug-ins/vdx/vdx-export.c
    50.7 -	#patch -Np1 -i $stuff/dia-overflow-fix.patch
    50.8  
    50.9  	./configure \
   50.10  		--with-python \
    51.1 --- a/dia/stuff/dia-overflow-fix.patch	Wed May 09 17:03:28 2018 +0300
    51.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    51.3 @@ -1,28 +0,0 @@
    51.4 -diff -wbBur dia-0.97.1/plug-ins/xfig/xfig-export.c dia-0.97.1.my/plug-ins/xfig/xfig-export.c
    51.5 ---- dia-0.97.1/plug-ins/xfig/xfig-export.c	2009-11-07 17:28:34.000000000 +0300
    51.6 -+++ dia-0.97.1.my/plug-ins/xfig/xfig-export.c	2010-11-15 17:44:05.640896280 +0300
    51.7 -@@ -417,6 +417,9 @@
    51.8 -     if (text[i] > 127) {
    51.9 -       newlen += 3;
   51.10 -     }
   51.11 -+    if (text[i] == '\\') {
   51.12 -+      newlen += 1;
   51.13 -+    }
   51.14 -   }
   51.15 -   returntext = g_malloc(sizeof(char)*(newlen+1));
   51.16 -   j = 0;
   51.17 -@@ -1085,10 +1088,10 @@
   51.18 -   figtext = figText(renderer, (unsigned char *) text);
   51.19 -   /* xfig texts are specials */
   51.20 -   fprintf(renderer->file, "4 %d %d %d 0 %d %s 0.0 6 0.0 0.0 %d %d %s\\001\n",
   51.21 --	  figAlignment(renderer, alignment),
   51.22 --	  figColor(renderer, color), 
   51.23 --	  figDepth(renderer),
   51.24 --	  figFont(renderer),
   51.25 -+	  (int)figAlignment(renderer, alignment),
   51.26 -+	  (int)figColor(renderer, color), 
   51.27 -+	  (int)figDepth(renderer),
   51.28 -+	  (int)figFont(renderer),
   51.29 - 	  xfig_dtostr(d_buf, figFontSize(renderer)),
   51.30 - 	  (int)figCoord(renderer, pos->x),
   51.31 - 	  (int)figCoord(renderer, pos->y),
    52.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    52.2 +++ b/dia/stuff/patches/dia-overflow-fix.patch	Thu May 10 21:12:00 2018 +0300
    52.3 @@ -0,0 +1,28 @@
    52.4 +diff -wbBur dia-0.97.1/plug-ins/xfig/xfig-export.c dia-0.97.1.my/plug-ins/xfig/xfig-export.c
    52.5 +--- dia-0.97.1/plug-ins/xfig/xfig-export.c	2009-11-07 17:28:34.000000000 +0300
    52.6 ++++ dia-0.97.1.my/plug-ins/xfig/xfig-export.c	2010-11-15 17:44:05.640896280 +0300
    52.7 +@@ -417,6 +417,9 @@
    52.8 +     if (text[i] > 127) {
    52.9 +       newlen += 3;
   52.10 +     }
   52.11 ++    if (text[i] == '\\') {
   52.12 ++      newlen += 1;
   52.13 ++    }
   52.14 +   }
   52.15 +   returntext = g_malloc(sizeof(char)*(newlen+1));
   52.16 +   j = 0;
   52.17 +@@ -1085,10 +1088,10 @@
   52.18 +   figtext = figText(renderer, (unsigned char *) text);
   52.19 +   /* xfig texts are specials */
   52.20 +   fprintf(renderer->file, "4 %d %d %d 0 %d %s 0.0 6 0.0 0.0 %d %d %s\\001\n",
   52.21 +-	  figAlignment(renderer, alignment),
   52.22 +-	  figColor(renderer, color), 
   52.23 +-	  figDepth(renderer),
   52.24 +-	  figFont(renderer),
   52.25 ++	  (int)figAlignment(renderer, alignment),
   52.26 ++	  (int)figColor(renderer, color), 
   52.27 ++	  (int)figDepth(renderer),
   52.28 ++	  (int)figFont(renderer),
   52.29 + 	  xfig_dtostr(d_buf, figFontSize(renderer)),
   52.30 + 	  (int)figCoord(renderer, pos->x),
   52.31 + 	  (int)figCoord(renderer, pos->y),
    53.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    53.2 +++ b/dia/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    53.3 @@ -0,0 +1,1 @@
    53.4 +# dia-overflow-fix.patch
    54.1 --- a/dillo/receipt	Wed May 09 17:03:28 2018 +0300
    54.2 +++ b/dillo/receipt	Thu May 10 21:12:00 2018 +0300
    54.3 @@ -15,7 +15,6 @@
    54.4  xorg-libX11-dev"
    54.5  
    54.6  compile_rules() {
    54.7 -	patch -p0 < $stuff/fltk-1.3.3.u
    54.8  	cp -f $stuff/pixmaps.slitaz.h src/pixmaps.h &&
    54.9  
   54.10  	./configure \
    55.1 --- a/dillo/stuff/fltk-1.3.3.u	Wed May 09 17:03:28 2018 +0300
    55.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    55.3 @@ -1,22 +0,0 @@
    55.4 ---- dw/fltkviewbase.cc
    55.5 -+++ dw/fltkviewbase.cc
    55.6 -@@ -27,8 +27,6 @@
    55.7 - #include <stdio.h>
    55.8 - #include "../lout/msg.h"
    55.9 - 
   55.10 --extern Fl_Widget* fl_oldfocus;
   55.11 --
   55.12 - using namespace lout::object;
   55.13 - using namespace lout::container::typed;
   55.14 - 
   55.15 -@@ -364,7 +362,9 @@
   55.16 -       }
   55.17 -       return 1;
   55.18 -    case FL_UNFOCUS:
   55.19 --      focused_child = fl_oldfocus;
   55.20 -+      //focused_child = fl_oldfocus;
   55.21 -+      for (Fl_Widget *p = this; p; p = p->parent())
   55.22 -+        focused_child = p;
   55.23 -       return 0;
   55.24 -    case FL_KEYBOARD:
   55.25 -       if (Fl::event_key() == FL_Tab)
    56.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    56.2 +++ b/dillo/stuff/patches/fltk-1.3.3.u	Thu May 10 21:12:00 2018 +0300
    56.3 @@ -0,0 +1,22 @@
    56.4 +--- dw/fltkviewbase.cc
    56.5 ++++ dw/fltkviewbase.cc
    56.6 +@@ -27,8 +27,6 @@
    56.7 + #include <stdio.h>
    56.8 + #include "../lout/msg.h"
    56.9 + 
   56.10 +-extern Fl_Widget* fl_oldfocus;
   56.11 +-
   56.12 + using namespace lout::object;
   56.13 + using namespace lout::container::typed;
   56.14 + 
   56.15 +@@ -364,7 +362,9 @@
   56.16 +       }
   56.17 +       return 1;
   56.18 +    case FL_UNFOCUS:
   56.19 +-      focused_child = fl_oldfocus;
   56.20 ++      //focused_child = fl_oldfocus;
   56.21 ++      for (Fl_Widget *p = this; p; p = p->parent())
   56.22 ++        focused_child = p;
   56.23 +       return 0;
   56.24 +    case FL_KEYBOARD:
   56.25 +       if (Fl::event_key() == FL_Tab)
    57.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    57.2 +++ b/dillo/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    57.3 @@ -0,0 +1,1 @@
    57.4 +-p0|fltk-1.3.3.u
    58.1 --- a/dvd+rw-tools/receipt	Wed May 09 17:03:28 2018 +0300
    58.2 +++ b/dvd+rw-tools/receipt	Thu May 10 21:12:00 2018 +0300
    58.3 @@ -15,7 +15,6 @@
    58.4  SPLIT="dvd+rw-media-tools"
    58.5  
    58.6  compile_rules() {
    58.7 -	patch -p1 -i $stuff/build-7.1.patch
    58.8  	grep -qs 'define u8' growisofs.c ||
    58.9  	sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' growisofs.c
   58.10  	make
    59.1 --- a/dvd+rw-tools/stuff/build-7.1.patch	Wed May 09 17:03:28 2018 +0300
    59.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    59.3 @@ -1,20 +0,0 @@
    59.4 ---- dvd+rw-tools-7.1/growisofs.c	Tue Mar  4 09:15:03 2008
    59.5 -+++ dvd+rw-tools-7.1-new/growisofs.c	Wed Apr 22 21:57:43 2009
    59.6 -@@ -442,6 +442,7 @@
    59.7 - #include <sys/types.h>
    59.8 - #include <sys/stat.h>
    59.9 - #include <assert.h>
   59.10 -+#include <limits.h>
   59.11 - #include "mp.h"
   59.12 - 
   59.13 - #if defined(__unix) || defined(__unix__)
   59.14 ---- dvd+rw-tools-7.1/transport.hxx	Sat Mar  1 10:34:43 2008
   59.15 -+++ dvd+rw-tools-7.1-new/transport.hxx	Wed Apr 22 21:58:09 2009
   59.16 -@@ -145,6 +145,7 @@
   59.17 - #include <sys/wait.h>
   59.18 - #include <sys/utsname.h>
   59.19 - #include <scsi/sg.h>
   59.20 -+#include <limits.h>
   59.21 - #if !defined(SG_FLAG_LUN_INHIBIT)
   59.22 - # if defined(SG_FLAG_UNUSED_LUN_INHIBIT)
   59.23 - #  define SG_FLAG_LUN_INHIBIT SG_FLAG_UNUSED_LUN_INHIBIT
    60.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    60.2 +++ b/dvd+rw-tools/stuff/patches/build-7.1.patch	Thu May 10 21:12:00 2018 +0300
    60.3 @@ -0,0 +1,20 @@
    60.4 +--- dvd+rw-tools-7.1/growisofs.c	Tue Mar  4 09:15:03 2008
    60.5 ++++ dvd+rw-tools-7.1-new/growisofs.c	Wed Apr 22 21:57:43 2009
    60.6 +@@ -442,6 +442,7 @@
    60.7 + #include <sys/types.h>
    60.8 + #include <sys/stat.h>
    60.9 + #include <assert.h>
   60.10 ++#include <limits.h>
   60.11 + #include "mp.h"
   60.12 + 
   60.13 + #if defined(__unix) || defined(__unix__)
   60.14 +--- dvd+rw-tools-7.1/transport.hxx	Sat Mar  1 10:34:43 2008
   60.15 ++++ dvd+rw-tools-7.1-new/transport.hxx	Wed Apr 22 21:58:09 2009
   60.16 +@@ -145,6 +145,7 @@
   60.17 + #include <sys/wait.h>
   60.18 + #include <sys/utsname.h>
   60.19 + #include <scsi/sg.h>
   60.20 ++#include <limits.h>
   60.21 + #if !defined(SG_FLAG_LUN_INHIBIT)
   60.22 + # if defined(SG_FLAG_UNUSED_LUN_INHIBIT)
   60.23 + #  define SG_FLAG_LUN_INHIBIT SG_FLAG_UNUSED_LUN_INHIBIT
    61.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    61.2 +++ b/dvd+rw-tools/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    61.3 @@ -0,0 +1,1 @@
    61.4 +-p1|build-7.1.patch
    62.1 --- a/epdfview-cups/receipt	Wed May 09 17:03:28 2018 +0300
    62.2 +++ b/epdfview-cups/receipt	Thu May 10 21:12:00 2018 +0300
    62.3 @@ -27,7 +27,7 @@
    62.4  	    -e 's/location->values\[0\].string.text/ippGetString(location, 0, NULL)/' \
    62.5  	    -e 's/.*IPP_TAG_KEYWORD.*/    ipp_t *request = ippNewRequest(IPP_GET_PRINTER_ATTRIBUTES);\n&/' \
    62.6  		src/PrintPter.cxx
    62.7 -	patch -p1 -i $stuff/no-stock-icons.patch
    62.8 +
    62.9  	./configure \
   62.10  		--with-cups \
   62.11  		$CONFIGURE_ARGS &&
    63.1 --- a/epdfview-cups/stuff/no-stock-icons.patch	Wed May 09 17:03:28 2018 +0300
    63.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    63.3 @@ -1,192 +0,0 @@
    63.4 ---- a/src/gtk/FindView.cxx
    63.5 -+++ b/srv/gtk/FindView.cxx
    63.6 -@@ -50,7 +50,7 @@
    63.7 -     gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ);
    63.8 - 
    63.9 -     // The "Close" button.
   63.10 --    m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE);
   63.11 -+    m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close"));
   63.12 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1);
   63.13 - 
   63.14 -     // The text to find entry.
   63.15 -@@ -65,13 +65,13 @@
   63.16 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1);
   63.17 - 
   63.18 -     // The "Find Next" button.
   63.19 --    m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT);
   63.20 -+    m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next"));
   63.21 -     gtk_tool_item_set_is_important (m_FindNext, TRUE);
   63.22 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1);
   63.23 - 
   63.24 -     // The "Find Previous" button.
   63.25 -     m_FindPrevious = 
   63.26 --        gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS);
   63.27 -+        gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous"));
   63.28 -     gtk_tool_item_set_is_important (m_FindPrevious, TRUE);
   63.29 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1);
   63.30 - 
   63.31 ---- a/src/gtk/MainView.cxx
   63.32 -+++ b/src/gtk/MainView.cxx
   63.33 -@@ -92,80 +92,80 @@
   63.34 -     { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL },
   63.35 -     { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },
   63.36 - 
   63.37 --    { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "<control>O",
   63.38 -+    { "OpenFile", "document-open", N_("_Open"), "<control>O",
   63.39 -       N_("Open a PDF document"),
   63.40 -       G_CALLBACK (main_window_open_file_cb) },
   63.41 - 
   63.42 --    { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R",
   63.43 -+    { "ReloadFile", "view-refresh", N_("_Reload"), "<control>R",
   63.44 -       N_("Reload the current document"),
   63.45 -       G_CALLBACK (main_window_reload_cb) },
   63.46 - 
   63.47 --    { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "<control>S",
   63.48 -+    { "SaveFile", "document-save", N_("_Save a Copy..."), "<control>S",
   63.49 -       N_("Save a copy of the current document"),
   63.50 -       G_CALLBACK (main_window_save_file_cb) },
   63.51 - 
   63.52 - #if defined (HAVE_CUPS)
   63.53 --    { "Print", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",
   63.54 -+    { "Print", "document-print", N_("_Print..."), "<control>P",
   63.55 -       N_("Print the current document"),
   63.56 -       G_CALLBACK (main_window_print_cb) },
   63.57 - #endif // HAVE_CUPS
   63.58 - 
   63.59 --    { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
   63.60 -+    { "Quit", "window-close", N_("_Close"), "<control>W",
   63.61 -       N_("Close this window"),
   63.62 -       G_CALLBACK (main_window_quit_cb) },
   63.63 - 
   63.64 --    { "Find", GTK_STOCK_FIND, N_("_Find"), "<control>F",
   63.65 -+    { "Find", "edit-find", N_("_Find"), "<control>F",
   63.66 -       N_("Find a word in the document"),
   63.67 -       G_CALLBACK (main_window_find_cb) },
   63.68 - 
   63.69 --    { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL,
   63.70 -+    { "Preferences", "preferences-system", N_("_Preferences..."), NULL,
   63.71 -       N_("Change the application's preferences"),
   63.72 -       G_CALLBACK (main_window_preferences_cb) },
   63.73 - 
   63.74 --    { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "<control>plus",
   63.75 -+    { "ZoomIn", "zoom-in", N_("Zoom _In"), "<control>plus",
   63.76 -       N_("Enlarge the document"),
   63.77 -       G_CALLBACK (main_window_zoom_in_cb) },
   63.78 - 
   63.79 --    { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<control>minus",
   63.80 -+    { "ZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus",
   63.81 -       N_("Shrink the document"),
   63.82 -       G_CALLBACK (main_window_zoom_out_cb) },
   63.83 - 
   63.84 --    { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "<control>bracketright",
   63.85 -+    { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "<control>bracketright",
   63.86 -       N_("Rotate the document 90 degrees clockwise"),
   63.87 -       G_CALLBACK (main_window_rotate_right_cb) },
   63.88 - 
   63.89 --    { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "<control>bracketleft",
   63.90 -+    { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "<control>bracketleft",
   63.91 -       N_("Rotate the document 90 degrees counter-clockwise"),
   63.92 -       G_CALLBACK (main_window_rotate_left_cb) },
   63.93 - 
   63.94 --    { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home",
   63.95 -+    { "GoToFirstPage", "go-first", N_("_First Page"), "<control>Home",
   63.96 -       N_("Go to the first page"),
   63.97 -       G_CALLBACK (main_window_go_to_first_page_cb) },
   63.98 - 
   63.99 --    { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "<Shift>Page_Down",
  63.100 -+    { "GoToNextPage", "go-next", N_("_Next Page"), "<Shift>Page_Down",
  63.101 -       N_("Go to the next page"),
  63.102 -       G_CALLBACK (main_window_go_to_next_page_cb) },
  63.103 - 
  63.104 --    { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "<Shift>Page_Up",
  63.105 -+    { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "<Shift>Page_Up",
  63.106 -       N_("Go to the previous page"),
  63.107 -       G_CALLBACK (main_window_go_to_previous_page_cb) },
  63.108 - 
  63.109 --    { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "<control>End",
  63.110 -+    { "GoToLastPage", "go-last", N_("_Last Page"), "<control>End",
  63.111 -       N_("Go to the last page"),
  63.112 -       G_CALLBACK (main_window_go_to_last_page_cb) },
  63.113 - 
  63.114 --    { "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
  63.115 -+    { "About", "help-about", N_("_About"), NULL,
  63.116 -       N_("Display application's credits"),
  63.117 -       G_CALLBACK (main_window_about_box_cb) },
  63.118 - 
  63.119 -     // Accelerator keys.
  63.120 --    { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL,
  63.121 -+    { "Slash", "edit-find", NULL, "slash", NULL,
  63.122 -       G_CALLBACK (main_window_find_cb) },
  63.123 - 
  63.124 --    { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "<control>KP_Add", NULL,
  63.125 -+    { "KPAdd", "zoom-in", NULL, "<control>KP_Add", NULL,
  63.126 -       G_CALLBACK (main_window_zoom_in_cb) },
  63.127 - 
  63.128 --    { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "<control>KP_Subtract",
  63.129 -+    { "KPSubtract", "zoom-out", NULL, "<control>KP_Subtract",
  63.130 -       NULL,
  63.131 -       G_CALLBACK (main_window_zoom_out_cb) }
  63.132 - };
  63.133 -@@ -188,21 +188,21 @@
  63.134 -       N_("Show or hide the document's outline"),
  63.135 -       G_CALLBACK (main_window_show_index_cb), FALSE },
  63.136 - 
  63.137 --    { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL,
  63.138 -+    { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL,
  63.139 -       N_("Make the current document fill the window"),
  63.140 -       G_CALLBACK (main_window_zoom_fit_cb), FALSE },
  63.141 - 
  63.142 --    { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL,
  63.143 -+    { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL,
  63.144 -       N_("Make the current document fill the window width"),
  63.145 -       G_CALLBACK (main_window_zoom_width_cb), FALSE },
  63.146 - };
  63.147 - 
  63.148 - static GtkRadioActionEntry g_PageScrollEntries[] =
  63.149 - {   
  63.150 --    { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL,
  63.151 -+    { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL,
  63.152 -       N_("Mouse scroll page"), (int)PagePterModeScroll },
  63.153 - 
  63.154 --    { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL,
  63.155 -+    { "PageModeText", "edit-select-all", N_("Select Text"), NULL,
  63.156 -       N_(" Mouse select text"), (int)PagePterModeSelectText },
  63.157 - };
  63.158 - 
  63.159 -@@ -1031,35 +1031,7 @@
  63.160 - void
  63.161 - MainView::setMainWindowIcon ()
  63.162 - {
  63.163 --    const gchar *iconFiles[] =
  63.164 --    {
  63.165 --        "icon_epdfview-48.png",
  63.166 --        "icon_epdfview-32.png",
  63.167 --        "icon_epdfview-24.png",
  63.168 --    };
  63.169 --
  63.170 --    GList *iconList = NULL;
  63.171 --    int iconFilesNum = G_N_ELEMENTS (iconFiles);
  63.172 --    for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ )
  63.173 --    {
  63.174 --        gchar *filename = g_strconcat (DATADIR, "/pixmaps/", 
  63.175 --                                       iconFiles[iconIndex], NULL);
  63.176 --        GError *error = NULL;
  63.177 --        GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error);
  63.178 --        if ( NULL != iconPixbuf )
  63.179 --        {
  63.180 --            iconList = g_list_prepend (iconList, iconPixbuf);
  63.181 --        }
  63.182 --        else
  63.183 --        {
  63.184 --            g_warning ("Error loading icon: %s\n", error->message);
  63.185 --            g_error_free (error);
  63.186 --        }
  63.187 --        g_free (filename);
  63.188 --    }
  63.189 --    gtk_window_set_default_icon_list (iconList);
  63.190 --    g_list_foreach (iconList, (GFunc)g_object_unref, NULL);
  63.191 --    g_list_free (iconList);
  63.192 -+    gtk_window_set_default_icon_name ("epdfview");
  63.193 - }
  63.194 - 
  63.195 - ///
    64.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    64.2 +++ b/epdfview-cups/stuff/patches/no-stock-icons.patch	Thu May 10 21:12:00 2018 +0300
    64.3 @@ -0,0 +1,192 @@
    64.4 +--- a/src/gtk/FindView.cxx
    64.5 ++++ b/srv/gtk/FindView.cxx
    64.6 +@@ -50,7 +50,7 @@
    64.7 +     gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ);
    64.8 + 
    64.9 +     // The "Close" button.
   64.10 +-    m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE);
   64.11 ++    m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close"));
   64.12 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1);
   64.13 + 
   64.14 +     // The text to find entry.
   64.15 +@@ -65,13 +65,13 @@
   64.16 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1);
   64.17 + 
   64.18 +     // The "Find Next" button.
   64.19 +-    m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT);
   64.20 ++    m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next"));
   64.21 +     gtk_tool_item_set_is_important (m_FindNext, TRUE);
   64.22 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1);
   64.23 + 
   64.24 +     // The "Find Previous" button.
   64.25 +     m_FindPrevious = 
   64.26 +-        gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS);
   64.27 ++        gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous"));
   64.28 +     gtk_tool_item_set_is_important (m_FindPrevious, TRUE);
   64.29 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1);
   64.30 + 
   64.31 +--- a/src/gtk/MainView.cxx
   64.32 ++++ b/src/gtk/MainView.cxx
   64.33 +@@ -92,80 +92,80 @@
   64.34 +     { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL },
   64.35 +     { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },
   64.36 + 
   64.37 +-    { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "<control>O",
   64.38 ++    { "OpenFile", "document-open", N_("_Open"), "<control>O",
   64.39 +       N_("Open a PDF document"),
   64.40 +       G_CALLBACK (main_window_open_file_cb) },
   64.41 + 
   64.42 +-    { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R",
   64.43 ++    { "ReloadFile", "view-refresh", N_("_Reload"), "<control>R",
   64.44 +       N_("Reload the current document"),
   64.45 +       G_CALLBACK (main_window_reload_cb) },
   64.46 + 
   64.47 +-    { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "<control>S",
   64.48 ++    { "SaveFile", "document-save", N_("_Save a Copy..."), "<control>S",
   64.49 +       N_("Save a copy of the current document"),
   64.50 +       G_CALLBACK (main_window_save_file_cb) },
   64.51 + 
   64.52 + #if defined (HAVE_CUPS)
   64.53 +-    { "Print", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",
   64.54 ++    { "Print", "document-print", N_("_Print..."), "<control>P",
   64.55 +       N_("Print the current document"),
   64.56 +       G_CALLBACK (main_window_print_cb) },
   64.57 + #endif // HAVE_CUPS
   64.58 + 
   64.59 +-    { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
   64.60 ++    { "Quit", "window-close", N_("_Close"), "<control>W",
   64.61 +       N_("Close this window"),
   64.62 +       G_CALLBACK (main_window_quit_cb) },
   64.63 + 
   64.64 +-    { "Find", GTK_STOCK_FIND, N_("_Find"), "<control>F",
   64.65 ++    { "Find", "edit-find", N_("_Find"), "<control>F",
   64.66 +       N_("Find a word in the document"),
   64.67 +       G_CALLBACK (main_window_find_cb) },
   64.68 + 
   64.69 +-    { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL,
   64.70 ++    { "Preferences", "preferences-system", N_("_Preferences..."), NULL,
   64.71 +       N_("Change the application's preferences"),
   64.72 +       G_CALLBACK (main_window_preferences_cb) },
   64.73 + 
   64.74 +-    { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "<control>plus",
   64.75 ++    { "ZoomIn", "zoom-in", N_("Zoom _In"), "<control>plus",
   64.76 +       N_("Enlarge the document"),
   64.77 +       G_CALLBACK (main_window_zoom_in_cb) },
   64.78 + 
   64.79 +-    { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<control>minus",
   64.80 ++    { "ZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus",
   64.81 +       N_("Shrink the document"),
   64.82 +       G_CALLBACK (main_window_zoom_out_cb) },
   64.83 + 
   64.84 +-    { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "<control>bracketright",
   64.85 ++    { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "<control>bracketright",
   64.86 +       N_("Rotate the document 90 degrees clockwise"),
   64.87 +       G_CALLBACK (main_window_rotate_right_cb) },
   64.88 + 
   64.89 +-    { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "<control>bracketleft",
   64.90 ++    { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "<control>bracketleft",
   64.91 +       N_("Rotate the document 90 degrees counter-clockwise"),
   64.92 +       G_CALLBACK (main_window_rotate_left_cb) },
   64.93 + 
   64.94 +-    { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home",
   64.95 ++    { "GoToFirstPage", "go-first", N_("_First Page"), "<control>Home",
   64.96 +       N_("Go to the first page"),
   64.97 +       G_CALLBACK (main_window_go_to_first_page_cb) },
   64.98 + 
   64.99 +-    { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "<Shift>Page_Down",
  64.100 ++    { "GoToNextPage", "go-next", N_("_Next Page"), "<Shift>Page_Down",
  64.101 +       N_("Go to the next page"),
  64.102 +       G_CALLBACK (main_window_go_to_next_page_cb) },
  64.103 + 
  64.104 +-    { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "<Shift>Page_Up",
  64.105 ++    { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "<Shift>Page_Up",
  64.106 +       N_("Go to the previous page"),
  64.107 +       G_CALLBACK (main_window_go_to_previous_page_cb) },
  64.108 + 
  64.109 +-    { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "<control>End",
  64.110 ++    { "GoToLastPage", "go-last", N_("_Last Page"), "<control>End",
  64.111 +       N_("Go to the last page"),
  64.112 +       G_CALLBACK (main_window_go_to_last_page_cb) },
  64.113 + 
  64.114 +-    { "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
  64.115 ++    { "About", "help-about", N_("_About"), NULL,
  64.116 +       N_("Display application's credits"),
  64.117 +       G_CALLBACK (main_window_about_box_cb) },
  64.118 + 
  64.119 +     // Accelerator keys.
  64.120 +-    { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL,
  64.121 ++    { "Slash", "edit-find", NULL, "slash", NULL,
  64.122 +       G_CALLBACK (main_window_find_cb) },
  64.123 + 
  64.124 +-    { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "<control>KP_Add", NULL,
  64.125 ++    { "KPAdd", "zoom-in", NULL, "<control>KP_Add", NULL,
  64.126 +       G_CALLBACK (main_window_zoom_in_cb) },
  64.127 + 
  64.128 +-    { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "<control>KP_Subtract",
  64.129 ++    { "KPSubtract", "zoom-out", NULL, "<control>KP_Subtract",
  64.130 +       NULL,
  64.131 +       G_CALLBACK (main_window_zoom_out_cb) }
  64.132 + };
  64.133 +@@ -188,21 +188,21 @@
  64.134 +       N_("Show or hide the document's outline"),
  64.135 +       G_CALLBACK (main_window_show_index_cb), FALSE },
  64.136 + 
  64.137 +-    { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL,
  64.138 ++    { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL,
  64.139 +       N_("Make the current document fill the window"),
  64.140 +       G_CALLBACK (main_window_zoom_fit_cb), FALSE },
  64.141 + 
  64.142 +-    { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL,
  64.143 ++    { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL,
  64.144 +       N_("Make the current document fill the window width"),
  64.145 +       G_CALLBACK (main_window_zoom_width_cb), FALSE },
  64.146 + };
  64.147 + 
  64.148 + static GtkRadioActionEntry g_PageScrollEntries[] =
  64.149 + {   
  64.150 +-    { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL,
  64.151 ++    { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL,
  64.152 +       N_("Mouse scroll page"), (int)PagePterModeScroll },
  64.153 + 
  64.154 +-    { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL,
  64.155 ++    { "PageModeText", "edit-select-all", N_("Select Text"), NULL,
  64.156 +       N_(" Mouse select text"), (int)PagePterModeSelectText },
  64.157 + };
  64.158 + 
  64.159 +@@ -1031,35 +1031,7 @@
  64.160 + void
  64.161 + MainView::setMainWindowIcon ()
  64.162 + {
  64.163 +-    const gchar *iconFiles[] =
  64.164 +-    {
  64.165 +-        "icon_epdfview-48.png",
  64.166 +-        "icon_epdfview-32.png",
  64.167 +-        "icon_epdfview-24.png",
  64.168 +-    };
  64.169 +-
  64.170 +-    GList *iconList = NULL;
  64.171 +-    int iconFilesNum = G_N_ELEMENTS (iconFiles);
  64.172 +-    for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ )
  64.173 +-    {
  64.174 +-        gchar *filename = g_strconcat (DATADIR, "/pixmaps/", 
  64.175 +-                                       iconFiles[iconIndex], NULL);
  64.176 +-        GError *error = NULL;
  64.177 +-        GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error);
  64.178 +-        if ( NULL != iconPixbuf )
  64.179 +-        {
  64.180 +-            iconList = g_list_prepend (iconList, iconPixbuf);
  64.181 +-        }
  64.182 +-        else
  64.183 +-        {
  64.184 +-            g_warning ("Error loading icon: %s\n", error->message);
  64.185 +-            g_error_free (error);
  64.186 +-        }
  64.187 +-        g_free (filename);
  64.188 +-    }
  64.189 +-    gtk_window_set_default_icon_list (iconList);
  64.190 +-    g_list_foreach (iconList, (GFunc)g_object_unref, NULL);
  64.191 +-    g_list_free (iconList);
  64.192 ++    gtk_window_set_default_icon_name ("epdfview");
  64.193 + }
  64.194 + 
  64.195 + ///
    65.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    65.2 +++ b/epdfview-cups/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    65.3 @@ -0,0 +1,1 @@
    65.4 +-p1|no-stock-icons.patch
    66.1 --- a/epdfview/receipt	Wed May 09 17:03:28 2018 +0300
    66.2 +++ b/epdfview/receipt	Thu May 10 21:12:00 2018 +0300
    66.3 @@ -22,8 +22,7 @@
    66.4  	sed -i 's/<config.h>/&\n#include <stdio.h>\n#define g_fopen fopen/' \
    66.5  		src/epdfview.h
    66.6  	find . -name '*.[ch]*' | xargs sed -i 's|<glib/.*h|<glib.h|'
    66.7 -	patch -Np1 -i $stuff/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch
    66.8 -	patch -p1 -i $stuff/no-stock-icons.patch
    66.9 +
   66.10  	./configure \
   66.11  		--without-cups \
   66.12  		$CONFIGURE_ARGS &&
    67.1 --- a/epdfview/stuff/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch	Wed May 09 17:03:28 2018 +0300
    67.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    67.3 @@ -1,59 +0,0 @@
    67.4 -From d30496f52b85f82947bd07b9bd60f8482843ece8 Mon Sep 17 00:00:00 2001
    67.5 -From: jordi <jordi@cb4bfb15-1111-0410-82e2-95233c8f1c7e>
    67.6 -Date: Tue, 5 Jul 2011 09:23:38 +0000
    67.7 -Subject: [PATCH 1/2] When using Poppler 0.17.0, I needed to swap the blue and
    67.8 - red channels, otherwise the colors (other than black
    67.9 - and white) looked wierd.
   67.10 -
   67.11 -git-svn-id: svn://svn.emma-soft.com/epdfview/trunk@367 cb4bfb15-1111-0410-82e2-95233c8f1c7e
   67.12 ----
   67.13 - src/PDFDocument.cxx |   20 ++++++++++++++++++++
   67.14 - 1 files changed, 20 insertions(+), 0 deletions(-)
   67.15 -
   67.16 -diff --git a/src/PDFDocument.cxx b/src/PDFDocument.cxx
   67.17 -index df5d75f..63b3513 100644
   67.18 ---- a/src/PDFDocument.cxx
   67.19 -+++ b/src/PDFDocument.cxx
   67.20 -@@ -20,6 +20,7 @@
   67.21 - #include <time.h>
   67.22 - #include <poppler.h>
   67.23 - #include <unistd.h>
   67.24 -+#include <algorithm>
   67.25 - #include "epdfview.h"
   67.26 -
   67.27 - using namespace ePDFView;
   67.28 -@@ -33,6 +34,24 @@ static PageLayout convertPageLayout (gint pageLayout);
   67.29 - static PageMode convertPageMode (gint pageMode);
   67.30 - static gchar *getAbsoluteFileName (const gchar *fileName);
   67.31 -
   67.32 -+namespace
   67.33 -+{
   67.34 -+    void
   67.35 -+    convert_bgra_to_rgba (guint8 *data, int width, int height)
   67.36 -+    {
   67.37 -+        using std::swap;
   67.38 -+
   67.39 -+        for (int y = 0; y < height; y++)
   67.40 -+        {
   67.41 -+            for (int x = 0; x < width; x++)
   67.42 -+            {
   67.43 -+                swap(data[0], data[2]);
   67.44 -+                data += 4;
   67.45 -+            }
   67.46 -+        }
   67.47 -+    }
   67.48 -+}
   67.49 -+
   67.50 - ///
   67.51 - /// @brief Constructs a new PDFDocument object.
   67.52 - ///
   67.53 -@@ -650,6 +669,7 @@ PDFDocument::renderPage (gint pageNum)
   67.54 -         poppler_page_render (page, context);
   67.55 -         cairo_destroy(context);
   67.56 -         cairo_surface_destroy (surface);
   67.57 -+        convert_bgra_to_rgba(renderedPage->getData (), width, height);
   67.58 - #else // !HAVE_POPPLER_0_17_0
   67.59 -         // Create the pixbuf from the data and render to it.
   67.60 -         GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (),
   67.61 ---
   67.62 -1.7.7
    68.1 --- a/epdfview/stuff/fix-scrolling.patch	Wed May 09 17:03:28 2018 +0300
    68.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    68.3 @@ -1,33 +0,0 @@
    68.4 ---- ./src/gtk/MainView.cxx.old	2009-02-28 22:00:55.000000000 +0100
    68.5 -+++ ./src/gtk/MainView.cxx	2009-03-20 03:12:10.000000000 +0100
    68.6 -@@ -77,7 +77,7 @@
    68.7 - static void main_window_zoom_out_cb (GtkWidget *, gpointer);
    68.8 - static void main_window_zoom_width_cb (GtkToggleAction *, gpointer);
    68.9 - static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer);
   68.10 --static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data);
   68.11 -+static gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data);
   68.12 - 
   68.13 - #if defined (HAVE_CUPS)
   68.14 - static void main_window_print_cb (GtkWidget *, gpointer);
   68.15 -@@ -1479,18 +1479,19 @@
   68.16 -     pter->setPageMode (mode);
   68.17 - }
   68.18 - 
   68.19 --void 
   68.20 -+gboolean
   68.21 - main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data)
   68.22 - {
   68.23 -     g_assert ( NULL != data && "The data parameter is NULL.");
   68.24 - 
   68.25 -     MainPter *pter = (MainPter *)data;
   68.26 -     // Only zoom when the CTRL-Button is down...
   68.27 --    if ( !(event->state & GDK_CONTROL_MASK) ) return;
   68.28 -+    if ( !(event->state & GDK_CONTROL_MASK) ) return FALSE;
   68.29 -     if ( event->direction == GDK_SCROLL_UP ) {
   68.30 -         pter->zoomInActivated ();
   68.31 -     } else if ( event->direction == GDK_SCROLL_DOWN ) {
   68.32 -         pter->zoomOutActivated ();
   68.33 -     }
   68.34 -+    return TRUE;
   68.35 - }
   68.36 - 
    69.1 --- a/epdfview/stuff/no-stock-icons.patch	Wed May 09 17:03:28 2018 +0300
    69.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    69.3 @@ -1,192 +0,0 @@
    69.4 ---- a/src/gtk/FindView.cxx
    69.5 -+++ b/srv/gtk/FindView.cxx
    69.6 -@@ -50,7 +50,7 @@
    69.7 -     gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ);
    69.8 - 
    69.9 -     // The "Close" button.
   69.10 --    m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE);
   69.11 -+    m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close"));
   69.12 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1);
   69.13 - 
   69.14 -     // The text to find entry.
   69.15 -@@ -65,13 +65,13 @@
   69.16 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1);
   69.17 - 
   69.18 -     // The "Find Next" button.
   69.19 --    m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT);
   69.20 -+    m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next"));
   69.21 -     gtk_tool_item_set_is_important (m_FindNext, TRUE);
   69.22 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1);
   69.23 - 
   69.24 -     // The "Find Previous" button.
   69.25 -     m_FindPrevious = 
   69.26 --        gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS);
   69.27 -+        gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous"));
   69.28 -     gtk_tool_item_set_is_important (m_FindPrevious, TRUE);
   69.29 -     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1);
   69.30 - 
   69.31 ---- a/src/gtk/MainView.cxx
   69.32 -+++ b/src/gtk/MainView.cxx
   69.33 -@@ -92,80 +92,80 @@
   69.34 -     { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL },
   69.35 -     { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },
   69.36 - 
   69.37 --    { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "<control>O",
   69.38 -+    { "OpenFile", "document-open", N_("_Open"), "<control>O",
   69.39 -       N_("Open a PDF document"),
   69.40 -       G_CALLBACK (main_window_open_file_cb) },
   69.41 - 
   69.42 --    { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R",
   69.43 -+    { "ReloadFile", "view-refresh", N_("_Reload"), "<control>R",
   69.44 -       N_("Reload the current document"),
   69.45 -       G_CALLBACK (main_window_reload_cb) },
   69.46 - 
   69.47 --    { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "<control>S",
   69.48 -+    { "SaveFile", "document-save", N_("_Save a Copy..."), "<control>S",
   69.49 -       N_("Save a copy of the current document"),
   69.50 -       G_CALLBACK (main_window_save_file_cb) },
   69.51 - 
   69.52 - #if defined (HAVE_CUPS)
   69.53 --    { "Print", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",
   69.54 -+    { "Print", "document-print", N_("_Print..."), "<control>P",
   69.55 -       N_("Print the current document"),
   69.56 -       G_CALLBACK (main_window_print_cb) },
   69.57 - #endif // HAVE_CUPS
   69.58 - 
   69.59 --    { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
   69.60 -+    { "Quit", "window-close", N_("_Close"), "<control>W",
   69.61 -       N_("Close this window"),
   69.62 -       G_CALLBACK (main_window_quit_cb) },
   69.63 - 
   69.64 --    { "Find", GTK_STOCK_FIND, N_("_Find"), "<control>F",
   69.65 -+    { "Find", "edit-find", N_("_Find"), "<control>F",
   69.66 -       N_("Find a word in the document"),
   69.67 -       G_CALLBACK (main_window_find_cb) },
   69.68 - 
   69.69 --    { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL,
   69.70 -+    { "Preferences", "preferences-system", N_("_Preferences..."), NULL,
   69.71 -       N_("Change the application's preferences"),
   69.72 -       G_CALLBACK (main_window_preferences_cb) },
   69.73 - 
   69.74 --    { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "<control>plus",
   69.75 -+    { "ZoomIn", "zoom-in", N_("Zoom _In"), "<control>plus",
   69.76 -       N_("Enlarge the document"),
   69.77 -       G_CALLBACK (main_window_zoom_in_cb) },
   69.78 - 
   69.79 --    { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<control>minus",
   69.80 -+    { "ZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus",
   69.81 -       N_("Shrink the document"),
   69.82 -       G_CALLBACK (main_window_zoom_out_cb) },
   69.83 - 
   69.84 --    { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "<control>bracketright",
   69.85 -+    { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "<control>bracketright",
   69.86 -       N_("Rotate the document 90 degrees clockwise"),
   69.87 -       G_CALLBACK (main_window_rotate_right_cb) },
   69.88 - 
   69.89 --    { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "<control>bracketleft",
   69.90 -+    { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "<control>bracketleft",
   69.91 -       N_("Rotate the document 90 degrees counter-clockwise"),
   69.92 -       G_CALLBACK (main_window_rotate_left_cb) },
   69.93 - 
   69.94 --    { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home",
   69.95 -+    { "GoToFirstPage", "go-first", N_("_First Page"), "<control>Home",
   69.96 -       N_("Go to the first page"),
   69.97 -       G_CALLBACK (main_window_go_to_first_page_cb) },
   69.98 - 
   69.99 --    { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "<Shift>Page_Down",
  69.100 -+    { "GoToNextPage", "go-next", N_("_Next Page"), "<Shift>Page_Down",
  69.101 -       N_("Go to the next page"),
  69.102 -       G_CALLBACK (main_window_go_to_next_page_cb) },
  69.103 - 
  69.104 --    { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "<Shift>Page_Up",
  69.105 -+    { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "<Shift>Page_Up",
  69.106 -       N_("Go to the previous page"),
  69.107 -       G_CALLBACK (main_window_go_to_previous_page_cb) },
  69.108 - 
  69.109 --    { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "<control>End",
  69.110 -+    { "GoToLastPage", "go-last", N_("_Last Page"), "<control>End",
  69.111 -       N_("Go to the last page"),
  69.112 -       G_CALLBACK (main_window_go_to_last_page_cb) },
  69.113 - 
  69.114 --    { "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
  69.115 -+    { "About", "help-about", N_("_About"), NULL,
  69.116 -       N_("Display application's credits"),
  69.117 -       G_CALLBACK (main_window_about_box_cb) },
  69.118 - 
  69.119 -     // Accelerator keys.
  69.120 --    { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL,
  69.121 -+    { "Slash", "edit-find", NULL, "slash", NULL,
  69.122 -       G_CALLBACK (main_window_find_cb) },
  69.123 - 
  69.124 --    { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "<control>KP_Add", NULL,
  69.125 -+    { "KPAdd", "zoom-in", NULL, "<control>KP_Add", NULL,
  69.126 -       G_CALLBACK (main_window_zoom_in_cb) },
  69.127 - 
  69.128 --    { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "<control>KP_Subtract",
  69.129 -+    { "KPSubtract", "zoom-out", NULL, "<control>KP_Subtract",
  69.130 -       NULL,
  69.131 -       G_CALLBACK (main_window_zoom_out_cb) }
  69.132 - };
  69.133 -@@ -188,21 +188,21 @@
  69.134 -       N_("Show or hide the document's outline"),
  69.135 -       G_CALLBACK (main_window_show_index_cb), FALSE },
  69.136 - 
  69.137 --    { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL,
  69.138 -+    { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL,
  69.139 -       N_("Make the current document fill the window"),
  69.140 -       G_CALLBACK (main_window_zoom_fit_cb), FALSE },
  69.141 - 
  69.142 --    { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL,
  69.143 -+    { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL,
  69.144 -       N_("Make the current document fill the window width"),
  69.145 -       G_CALLBACK (main_window_zoom_width_cb), FALSE },
  69.146 - };
  69.147 - 
  69.148 - static GtkRadioActionEntry g_PageScrollEntries[] =
  69.149 - {   
  69.150 --    { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL,
  69.151 -+    { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL,
  69.152 -       N_("Mouse scroll page"), (int)PagePterModeScroll },
  69.153 - 
  69.154 --    { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL,
  69.155 -+    { "PageModeText", "edit-select-all", N_("Select Text"), NULL,
  69.156 -       N_(" Mouse select text"), (int)PagePterModeSelectText },
  69.157 - };
  69.158 - 
  69.159 -@@ -1031,35 +1031,7 @@
  69.160 - void
  69.161 - MainView::setMainWindowIcon ()
  69.162 - {
  69.163 --    const gchar *iconFiles[] =
  69.164 --    {
  69.165 --        "icon_epdfview-48.png",
  69.166 --        "icon_epdfview-32.png",
  69.167 --        "icon_epdfview-24.png",
  69.168 --    };
  69.169 --
  69.170 --    GList *iconList = NULL;
  69.171 --    int iconFilesNum = G_N_ELEMENTS (iconFiles);
  69.172 --    for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ )
  69.173 --    {
  69.174 --        gchar *filename = g_strconcat (DATADIR, "/pixmaps/", 
  69.175 --                                       iconFiles[iconIndex], NULL);
  69.176 --        GError *error = NULL;
  69.177 --        GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error);
  69.178 --        if ( NULL != iconPixbuf )
  69.179 --        {
  69.180 --            iconList = g_list_prepend (iconList, iconPixbuf);
  69.181 --        }
  69.182 --        else
  69.183 --        {
  69.184 --            g_warning ("Error loading icon: %s\n", error->message);
  69.185 --            g_error_free (error);
  69.186 --        }
  69.187 --        g_free (filename);
  69.188 --    }
  69.189 --    gtk_window_set_default_icon_list (iconList);
  69.190 --    g_list_foreach (iconList, (GFunc)g_object_unref, NULL);
  69.191 --    g_list_free (iconList);
  69.192 -+    gtk_window_set_default_icon_name ("epdfview");
  69.193 - }
  69.194 - 
  69.195 - ///
    70.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    70.2 +++ b/epdfview/stuff/patches/0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch	Thu May 10 21:12:00 2018 +0300
    70.3 @@ -0,0 +1,59 @@
    70.4 +From d30496f52b85f82947bd07b9bd60f8482843ece8 Mon Sep 17 00:00:00 2001
    70.5 +From: jordi <jordi@cb4bfb15-1111-0410-82e2-95233c8f1c7e>
    70.6 +Date: Tue, 5 Jul 2011 09:23:38 +0000
    70.7 +Subject: [PATCH 1/2] When using Poppler 0.17.0, I needed to swap the blue and
    70.8 + red channels, otherwise the colors (other than black
    70.9 + and white) looked wierd.
   70.10 +
   70.11 +git-svn-id: svn://svn.emma-soft.com/epdfview/trunk@367 cb4bfb15-1111-0410-82e2-95233c8f1c7e
   70.12 +---
   70.13 + src/PDFDocument.cxx |   20 ++++++++++++++++++++
   70.14 + 1 files changed, 20 insertions(+), 0 deletions(-)
   70.15 +
   70.16 +diff --git a/src/PDFDocument.cxx b/src/PDFDocument.cxx
   70.17 +index df5d75f..63b3513 100644
   70.18 +--- a/src/PDFDocument.cxx
   70.19 ++++ b/src/PDFDocument.cxx
   70.20 +@@ -20,6 +20,7 @@
   70.21 + #include <time.h>
   70.22 + #include <poppler.h>
   70.23 + #include <unistd.h>
   70.24 ++#include <algorithm>
   70.25 + #include "epdfview.h"
   70.26 +
   70.27 + using namespace ePDFView;
   70.28 +@@ -33,6 +34,24 @@ static PageLayout convertPageLayout (gint pageLayout);
   70.29 + static PageMode convertPageMode (gint pageMode);
   70.30 + static gchar *getAbsoluteFileName (const gchar *fileName);
   70.31 +
   70.32 ++namespace
   70.33 ++{
   70.34 ++    void
   70.35 ++    convert_bgra_to_rgba (guint8 *data, int width, int height)
   70.36 ++    {
   70.37 ++        using std::swap;
   70.38 ++
   70.39 ++        for (int y = 0; y < height; y++)
   70.40 ++        {
   70.41 ++            for (int x = 0; x < width; x++)
   70.42 ++            {
   70.43 ++                swap(data[0], data[2]);
   70.44 ++                data += 4;
   70.45 ++            }
   70.46 ++        }
   70.47 ++    }
   70.48 ++}
   70.49 ++
   70.50 + ///
   70.51 + /// @brief Constructs a new PDFDocument object.
   70.52 + ///
   70.53 +@@ -650,6 +669,7 @@ PDFDocument::renderPage (gint pageNum)
   70.54 +         poppler_page_render (page, context);
   70.55 +         cairo_destroy(context);
   70.56 +         cairo_surface_destroy (surface);
   70.57 ++        convert_bgra_to_rgba(renderedPage->getData (), width, height);
   70.58 + #else // !HAVE_POPPLER_0_17_0
   70.59 +         // Create the pixbuf from the data and render to it.
   70.60 +         GdkPixbuf *pixbuf = gdk_pixbuf_new_from_data (renderedPage->getData (),
   70.61 +--
   70.62 +1.7.7
    71.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    71.2 +++ b/epdfview/stuff/patches/fix-scrolling.patch	Thu May 10 21:12:00 2018 +0300
    71.3 @@ -0,0 +1,33 @@
    71.4 +--- ./src/gtk/MainView.cxx.old	2009-02-28 22:00:55.000000000 +0100
    71.5 ++++ ./src/gtk/MainView.cxx	2009-03-20 03:12:10.000000000 +0100
    71.6 +@@ -77,7 +77,7 @@
    71.7 + static void main_window_zoom_out_cb (GtkWidget *, gpointer);
    71.8 + static void main_window_zoom_width_cb (GtkToggleAction *, gpointer);
    71.9 + static void main_window_set_page_mode (GtkRadioAction *, GtkRadioAction *, gpointer);
   71.10 +-static void main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data);
   71.11 ++static gboolean main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data);
   71.12 + 
   71.13 + #if defined (HAVE_CUPS)
   71.14 + static void main_window_print_cb (GtkWidget *, gpointer);
   71.15 +@@ -1479,18 +1479,19 @@
   71.16 +     pter->setPageMode (mode);
   71.17 + }
   71.18 + 
   71.19 +-void 
   71.20 ++gboolean
   71.21 + main_window_page_scrolled_cb (GtkWidget *widget, GdkEventScroll *event, gpointer data)
   71.22 + {
   71.23 +     g_assert ( NULL != data && "The data parameter is NULL.");
   71.24 + 
   71.25 +     MainPter *pter = (MainPter *)data;
   71.26 +     // Only zoom when the CTRL-Button is down...
   71.27 +-    if ( !(event->state & GDK_CONTROL_MASK) ) return;
   71.28 ++    if ( !(event->state & GDK_CONTROL_MASK) ) return FALSE;
   71.29 +     if ( event->direction == GDK_SCROLL_UP ) {
   71.30 +         pter->zoomInActivated ();
   71.31 +     } else if ( event->direction == GDK_SCROLL_DOWN ) {
   71.32 +         pter->zoomOutActivated ();
   71.33 +     }
   71.34 ++    return TRUE;
   71.35 + }
   71.36 + 
    72.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    72.2 +++ b/epdfview/stuff/patches/no-stock-icons.patch	Thu May 10 21:12:00 2018 +0300
    72.3 @@ -0,0 +1,192 @@
    72.4 +--- a/src/gtk/FindView.cxx
    72.5 ++++ b/srv/gtk/FindView.cxx
    72.6 +@@ -50,7 +50,7 @@
    72.7 +     gtk_toolbar_set_style (GTK_TOOLBAR (m_FindBar), GTK_TOOLBAR_BOTH_HORIZ);
    72.8 + 
    72.9 +     // The "Close" button.
   72.10 +-    m_Close = gtk_tool_button_new_from_stock (GTK_STOCK_CLOSE);
   72.11 ++    m_Close = gtk_tool_button_new (gtk_image_new_from_icon_name ("window-close", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Close"));
   72.12 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_Close, -1);
   72.13 + 
   72.14 +     // The text to find entry.
   72.15 +@@ -65,13 +65,13 @@
   72.16 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), textToFindItem, -1);
   72.17 + 
   72.18 +     // The "Find Next" button.
   72.19 +-    m_FindNext = gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_NEXT);
   72.20 ++    m_FindNext = gtk_tool_button_new (gtk_image_new_from_icon_name ("go-next", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Next"));
   72.21 +     gtk_tool_item_set_is_important (m_FindNext, TRUE);
   72.22 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindNext, -1);
   72.23 + 
   72.24 +     // The "Find Previous" button.
   72.25 +     m_FindPrevious = 
   72.26 +-        gtk_tool_button_new_from_stock (EPDFVIEW_STOCK_FIND_PREVIOUS);
   72.27 ++        gtk_tool_button_new (gtk_image_new_from_icon_name ("go-previous", GTK_ICON_SIZE_SMALL_TOOLBAR), _("Find _Previous"));
   72.28 +     gtk_tool_item_set_is_important (m_FindPrevious, TRUE);
   72.29 +     gtk_toolbar_insert (GTK_TOOLBAR (m_FindBar), m_FindPrevious, -1);
   72.30 + 
   72.31 +--- a/src/gtk/MainView.cxx
   72.32 ++++ b/src/gtk/MainView.cxx
   72.33 +@@ -92,80 +92,80 @@
   72.34 +     { "GoMenu", NULL, N_("_Go"), NULL, NULL, NULL },
   72.35 +     { "HelpMenu", NULL, N_("_Help"), NULL, NULL, NULL },
   72.36 + 
   72.37 +-    { "OpenFile", GTK_STOCK_OPEN, N_("_Open"), "<control>O",
   72.38 ++    { "OpenFile", "document-open", N_("_Open"), "<control>O",
   72.39 +       N_("Open a PDF document"),
   72.40 +       G_CALLBACK (main_window_open_file_cb) },
   72.41 + 
   72.42 +-    { "ReloadFile", GTK_STOCK_REFRESH, N_("_Reload"), "<control>R",
   72.43 ++    { "ReloadFile", "view-refresh", N_("_Reload"), "<control>R",
   72.44 +       N_("Reload the current document"),
   72.45 +       G_CALLBACK (main_window_reload_cb) },
   72.46 + 
   72.47 +-    { "SaveFile", GTK_STOCK_SAVE, N_("_Save a Copy..."), "<control>S",
   72.48 ++    { "SaveFile", "document-save", N_("_Save a Copy..."), "<control>S",
   72.49 +       N_("Save a copy of the current document"),
   72.50 +       G_CALLBACK (main_window_save_file_cb) },
   72.51 + 
   72.52 + #if defined (HAVE_CUPS)
   72.53 +-    { "Print", GTK_STOCK_PRINT, N_("_Print..."), "<control>P",
   72.54 ++    { "Print", "document-print", N_("_Print..."), "<control>P",
   72.55 +       N_("Print the current document"),
   72.56 +       G_CALLBACK (main_window_print_cb) },
   72.57 + #endif // HAVE_CUPS
   72.58 + 
   72.59 +-    { "Quit", GTK_STOCK_CLOSE, N_("_Close"), "<control>W",
   72.60 ++    { "Quit", "window-close", N_("_Close"), "<control>W",
   72.61 +       N_("Close this window"),
   72.62 +       G_CALLBACK (main_window_quit_cb) },
   72.63 + 
   72.64 +-    { "Find", GTK_STOCK_FIND, N_("_Find"), "<control>F",
   72.65 ++    { "Find", "edit-find", N_("_Find"), "<control>F",
   72.66 +       N_("Find a word in the document"),
   72.67 +       G_CALLBACK (main_window_find_cb) },
   72.68 + 
   72.69 +-    { "Preferences", GTK_STOCK_PREFERENCES, N_("_Preferences..."), NULL,
   72.70 ++    { "Preferences", "preferences-system", N_("_Preferences..."), NULL,
   72.71 +       N_("Change the application's preferences"),
   72.72 +       G_CALLBACK (main_window_preferences_cb) },
   72.73 + 
   72.74 +-    { "ZoomIn", GTK_STOCK_ZOOM_IN, N_("Zoom _In"), "<control>plus",
   72.75 ++    { "ZoomIn", "zoom-in", N_("Zoom _In"), "<control>plus",
   72.76 +       N_("Enlarge the document"),
   72.77 +       G_CALLBACK (main_window_zoom_in_cb) },
   72.78 + 
   72.79 +-    { "ZoomOut", GTK_STOCK_ZOOM_OUT, N_("Zoom _Out"), "<control>minus",
   72.80 ++    { "ZoomOut", "zoom-out", N_("Zoom _Out"), "<control>minus",
   72.81 +       N_("Shrink the document"),
   72.82 +       G_CALLBACK (main_window_zoom_out_cb) },
   72.83 + 
   72.84 +-    { "RotateRight", EPDFVIEW_STOCK_ROTATE_RIGHT, N_("Rotate _Right"), "<control>bracketright",
   72.85 ++    { "RotateRight", "object-rotate-right", N_("Rotate _Right"), "<control>bracketright",
   72.86 +       N_("Rotate the document 90 degrees clockwise"),
   72.87 +       G_CALLBACK (main_window_rotate_right_cb) },
   72.88 + 
   72.89 +-    { "RotateLeft", EPDFVIEW_STOCK_ROTATE_LEFT, N_("Rotate _Left"), "<control>bracketleft",
   72.90 ++    { "RotateLeft", "object-rotate-left", N_("Rotate _Left"), "<control>bracketleft",
   72.91 +       N_("Rotate the document 90 degrees counter-clockwise"),
   72.92 +       G_CALLBACK (main_window_rotate_left_cb) },
   72.93 + 
   72.94 +-    { "GoToFirstPage", GTK_STOCK_GOTO_FIRST, N_("_First Page"), "<control>Home",
   72.95 ++    { "GoToFirstPage", "go-first", N_("_First Page"), "<control>Home",
   72.96 +       N_("Go to the first page"),
   72.97 +       G_CALLBACK (main_window_go_to_first_page_cb) },
   72.98 + 
   72.99 +-    { "GoToNextPage", GTK_STOCK_GO_FORWARD, N_("_Next Page"), "<Shift>Page_Down",
  72.100 ++    { "GoToNextPage", "go-next", N_("_Next Page"), "<Shift>Page_Down",
  72.101 +       N_("Go to the next page"),
  72.102 +       G_CALLBACK (main_window_go_to_next_page_cb) },
  72.103 + 
  72.104 +-    { "GoToPreviousPage", GTK_STOCK_GO_BACK, N_("_Previous Page"), "<Shift>Page_Up",
  72.105 ++    { "GoToPreviousPage", "go-previous", N_("_Previous Page"), "<Shift>Page_Up",
  72.106 +       N_("Go to the previous page"),
  72.107 +       G_CALLBACK (main_window_go_to_previous_page_cb) },
  72.108 + 
  72.109 +-    { "GoToLastPage", GTK_STOCK_GOTO_LAST, N_("_Last Page"), "<control>End",
  72.110 ++    { "GoToLastPage", "go-last", N_("_Last Page"), "<control>End",
  72.111 +       N_("Go to the last page"),
  72.112 +       G_CALLBACK (main_window_go_to_last_page_cb) },
  72.113 + 
  72.114 +-    { "About", GTK_STOCK_ABOUT, N_("_About"), NULL,
  72.115 ++    { "About", "help-about", N_("_About"), NULL,
  72.116 +       N_("Display application's credits"),
  72.117 +       G_CALLBACK (main_window_about_box_cb) },
  72.118 + 
  72.119 +     // Accelerator keys.
  72.120 +-    { "Slash", GTK_STOCK_FIND, NULL, "slash", NULL,
  72.121 ++    { "Slash", "edit-find", NULL, "slash", NULL,
  72.122 +       G_CALLBACK (main_window_find_cb) },
  72.123 + 
  72.124 +-    { "KPAdd", GTK_STOCK_ZOOM_IN, NULL, "<control>KP_Add", NULL,
  72.125 ++    { "KPAdd", "zoom-in", NULL, "<control>KP_Add", NULL,
  72.126 +       G_CALLBACK (main_window_zoom_in_cb) },
  72.127 + 
  72.128 +-    { "KPSubtract", GTK_STOCK_ZOOM_OUT, NULL, "<control>KP_Subtract",
  72.129 ++    { "KPSubtract", "zoom-out", NULL, "<control>KP_Subtract",
  72.130 +       NULL,
  72.131 +       G_CALLBACK (main_window_zoom_out_cb) }
  72.132 + };
  72.133 +@@ -188,21 +188,21 @@
  72.134 +       N_("Show or hide the document's outline"),
  72.135 +       G_CALLBACK (main_window_show_index_cb), FALSE },
  72.136 + 
  72.137 +-    { "ZoomFit", GTK_STOCK_ZOOM_FIT, N_("Zoom to _Fit"), NULL,
  72.138 ++    { "ZoomFit", "zoom-fit-best", N_("Zoom to _Fit"), NULL,
  72.139 +       N_("Make the current document fill the window"),
  72.140 +       G_CALLBACK (main_window_zoom_fit_cb), FALSE },
  72.141 + 
  72.142 +-    { "ZoomWidth", EPDFVIEW_STOCK_ZOOM_WIDTH, N_("Zoom to _Width"), NULL,
  72.143 ++    { "ZoomWidth", "format-justify-fill", N_("Zoom to _Width"), NULL,
  72.144 +       N_("Make the current document fill the window width"),
  72.145 +       G_CALLBACK (main_window_zoom_width_cb), FALSE },
  72.146 + };
  72.147 + 
  72.148 + static GtkRadioActionEntry g_PageScrollEntries[] =
  72.149 + {   
  72.150 +-    { "PageModeScroll", GTK_STOCK_FULLSCREEN, N_("Scroll"), NULL,
  72.151 ++    { "PageModeScroll", "view-fullscreen", N_("Scroll"), NULL,
  72.152 +       N_("Mouse scroll page"), (int)PagePterModeScroll },
  72.153 + 
  72.154 +-    { "PageModeText", GTK_STOCK_SELECT_ALL, N_("Select Text"), NULL,
  72.155 ++    { "PageModeText", "edit-select-all", N_("Select Text"), NULL,
  72.156 +       N_(" Mouse select text"), (int)PagePterModeSelectText },
  72.157 + };
  72.158 + 
  72.159 +@@ -1031,35 +1031,7 @@
  72.160 + void
  72.161 + MainView::setMainWindowIcon ()
  72.162 + {
  72.163 +-    const gchar *iconFiles[] =
  72.164 +-    {
  72.165 +-        "icon_epdfview-48.png",
  72.166 +-        "icon_epdfview-32.png",
  72.167 +-        "icon_epdfview-24.png",
  72.168 +-    };
  72.169 +-
  72.170 +-    GList *iconList = NULL;
  72.171 +-    int iconFilesNum = G_N_ELEMENTS (iconFiles);
  72.172 +-    for ( int iconIndex = 0 ; iconIndex < iconFilesNum ; iconIndex++ )
  72.173 +-    {
  72.174 +-        gchar *filename = g_strconcat (DATADIR, "/pixmaps/", 
  72.175 +-                                       iconFiles[iconIndex], NULL);
  72.176 +-        GError *error = NULL;
  72.177 +-        GdkPixbuf *iconPixbuf = gdk_pixbuf_new_from_file (filename, &error);
  72.178 +-        if ( NULL != iconPixbuf )
  72.179 +-        {
  72.180 +-            iconList = g_list_prepend (iconList, iconPixbuf);
  72.181 +-        }
  72.182 +-        else
  72.183 +-        {
  72.184 +-            g_warning ("Error loading icon: %s\n", error->message);
  72.185 +-            g_error_free (error);
  72.186 +-        }
  72.187 +-        g_free (filename);
  72.188 +-    }
  72.189 +-    gtk_window_set_default_icon_list (iconList);
  72.190 +-    g_list_foreach (iconList, (GFunc)g_object_unref, NULL);
  72.191 +-    g_list_free (iconList);
  72.192 ++    gtk_window_set_default_icon_name ("epdfview");
  72.193 + }
  72.194 + 
  72.195 + ///
    73.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    73.2 +++ b/epdfview/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    73.3 @@ -0,0 +1,2 @@
    73.4 +-Np1|0001-When-using-Poppler-0.17.0-I-needed-to-swap-the-blue-.patch
    73.5 +-p1|no-stock-icons.patch
    74.1 --- a/etherboot/receipt	Wed May 09 17:03:28 2018 +0300
    74.2 +++ b/etherboot/receipt	Thu May 10 21:12:00 2018 +0300
    74.3 @@ -16,14 +16,6 @@
    74.4  compile_rules()
    74.5  {
    74.6  	cd $src/src
    74.7 -	while read file; do
    74.8 -		[ -f done.$file ] && continue
    74.9 -		patch -p2 < $stuff/$file
   74.10 -		touch done.$file
   74.11 -	done <<EOT
   74.12 -etherboot-net.u
   74.13 -etherboot-prefix.u
   74.14 -EOT
   74.15  	make CC=gcc-49 bin/etherboot-net.bzImage
   74.16  }
   74.17  
    75.1 --- a/etherboot/stuff/etherboot-net.u	Wed May 09 17:03:28 2018 +0300
    75.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    75.3 @@ -1,46 +0,0 @@
    75.4 -Patch from network_boot_floppy+cd+hd_540.zip at http://sourceforge.net/projects/thinstation
    75.5 ---- etherboot-5.4.3/src/Makefile.main	2007-02-24 15:44:59.000000000 +0100
    75.6 -+++ etherboot-5.4.3/src/Makefile.main	2008-04-08 15:06:47.000000000 +0200
    75.7 -@@ -382,6 +382,27 @@
    75.8 - $(BIN)/%.zbin: $(BIN)/%.bin $(BIN)/nrv2b $(MAKEDEPS)
    75.9 - 	$(BIN)/nrv2b e $< $@
   75.10 - 
   75.11 -+# Rule for the multi-NIC image. (by Paolo Salvan)
   75.12 -+NETOBJS:=
   75.13 -+# Note: the 3c90x.o driver should be linked BEFORE the 3c595.o
   75.14 -+# otherwise 3c905b cards will be (badly) handled by the 3c595 driver as 3c900b cards
   75.15 -+NETOBJS+=		$(BIN)/3c90x.o
   75.16 -+# PCI cards...
   75.17 -+NETOBJS+=		$(BIN)/3c595.o $(BIN)/davicom.o $(BIN)/eepro100.o $(BIN)/ns8390.o $(BIN)/pcnet32.o $(BIN)/prism2_plx.o $(BIN)/rtl8139.o $(BIN)/sis900.o $(BIN)/tulip.o $(BIN)/via-rhine.o $(BIN)/r8169.o $(BIN)/forcedeth.o $(BIN)/ns83820.o $(BIN)/eepro.o $(BIN)/e1000.o
   75.18 -+# ISA cards...
   75.19 -+NETOBJS+=		$(BIN)/3c503.o $(BIN)/ne.o $(BIN)/wd.o $(BIN)/3c529.o $(BIN)/3c509.o
   75.20 -+# Exclude these drivers + the belows to create the .COM image, max 65280 byte...
   75.21 -+NETOBJS+=		$(BIN)/sk_g16.o $(BIN)/depca.o $(BIN)/cs89x0.o $(BIN)/prism2_pci.o $(BIN)/smc9000.o $(BIN)/natsemi.o $(BIN)/epic100.o $(BIN)/sundance.o $(BIN)/w89c840.o $(BIN)/tlan.o
   75.22 -+# Try excluding this big and rarely-used driver if you get "ERROR: code size exceeds limit!" at build-time
   75.23 -+# or system resets/hungs-up during image decompression at run-time
   75.24 -+# (uncompressed image could have exceeded low-memory...)
   75.25 -+NETOBJS+=		$(BIN)/tg3.o
   75.26 -+# This driver has slow autoprobing and is rarely used, so it is better to exclude it...
   75.27 -+#NETOBJS+=		$(BIN)/3c515.o
   75.28 -+
   75.29 -+$(BIN)/etherboot-net.o: $(NETOBJS)
   75.30 -+	$(LD) -r $(NETOBJS) -o $@
   75.31 -+
   75.32 - # Housekeeping
   75.33 - 
   75.34 - clean:
   75.35 -
   75.36 ---- etherboot-5.4.3/src/core/main.c	2007-02-24 15:44:59.000000000 +0100
   75.37 -+++ etherboot-5.4.3/src/core/main.c	2008-04-08 15:11:46.000000000 +0200
   75.38 -@@ -471,6 +471,11 @@
   75.39 - #ifdef	DNS_RESOLVER
   75.40 - 	const char *resolvt;
   75.41 - #endif
   75.42 -+        char *name_tmp = fname;
   75.43 -+        while ( *name_tmp != 0 ) {
   75.44 -+                if ( memcmp(name_tmp, ".zpxe", 6 ) == 0 ) {*name_tmp=0;} else {++name_tmp;}
   75.45 -+        }
   75.46 -+
   75.47 - 	ip.s_addr = arptable[ARP_SERVER].ipaddr.s_addr;
   75.48 - 	name = fname;
   75.49 - 	url_port = -1;
    76.1 --- a/etherboot/stuff/etherboot-prefix.u	Wed May 09 17:03:28 2018 +0300
    76.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    76.3 @@ -1,859 +0,0 @@
    76.4 ---- etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S
    76.5 -+++ etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S
    76.6 -@@ -1,92 +1,377 @@
    76.7 --/*
    76.8 --	Copyright (C) 2000, Entity Cyber, Inc.
    76.9 --
   76.10 --	Authors: Gary Byers (gb@thinguin.org)
   76.11 --		 Marty Connor (mdc@thinguin.org)
   76.12 --
   76.13 --	This software may be used and distributed according to the terms
   76.14 --	of the GNU Public License (GPL), incorporated herein by reference.
   76.15 --
   76.16 --	Description:	
   76.17 --
   76.18 --	This is just a little bit of code and data that can get prepended
   76.19 --	to an Etherboot ROM image in order to allow LILO to load the
   76.20 --	result as if it were a Linux kernel image.
   76.21 --
   76.22 --	A real Linux kernel image consists of a one-sector boot loader
   76.23 --	(to load the image from a floppy disk), followed a few sectors
   76.24 --	of setup code, followed by the kernel code itself.  There's
   76.25 --	a table in the first sector (starting at offset 497) that indicates
   76.26 --	how many sectors of setup code follow the first sector and which
   76.27 --	contains some other parameters that aren't interesting in this
   76.28 --	case.
   76.29 --
   76.30 --	When LILO loads the sectors that comprise a kernel image, it doesn't
   76.31 --	execute the code in the first sector (since that code would try to
   76.32 --	load the image from a floppy disk.)  The code in the first sector
   76.33 --	below doesn't expect to get executed (and prints an error message
   76.34 --	if it ever -is- executed.)  LILO's only interested in knowing the
   76.35 --	number of setup sectors advertised in the table (at offset 497 in
   76.36 --	the first sector.)
   76.37 --
   76.38 --	Etherboot doesn't require much in the way of setup code.
   76.39 --	Historically, the Linux kernel required at least 4 sectors of
   76.40 --	setup code.  Current versions of LILO look at the byte at
   76.41 --	offset 497 in the first sector to indicate how many sectors
   76.42 --	of setup code are contained in the image.
   76.43 --
   76.44 --*/
   76.45 -+/* SYS_SIZE is the number of clicks (16 bytes) to be loaded.  For Etherboot
   76.46 -+ * purposes, we need to load everything but the boot sector itself, i.e. 32
   76.47 -+ * clicks less than the size of the entire (verbatim) image.  The image size
   76.48 -+ * is practically limited only by the available base memory size.
   76.49 -+ */
   76.50 -+.globl	SYSSIZE
   76.51 -+.equ	SYSSIZE, _verbatim_size_pgh - 32
   76.52 -+
   76.53 -+/*	floppyload.S Copyright (C) 1991, 1992 Linus Torvalds
   76.54 -+ *	modified by Drew Eckhardt
   76.55 -+ *	modified by Bruce Evans (bde)
   76.56 -+ *
   76.57 -+ * floppyprefix.S is loaded at 0x0000:0x7c00 by the bios-startup routines.
   76.58 -+ *
   76.59 -+ * It then loads the system at SYSSEG<<4, using BIOS interrupts.
   76.60 -+ *
   76.61 -+ * The loader has been made as simple as possible, and continuous read errors
   76.62 -+ * will result in a unbreakable loop. Reboot by hand. It loads pretty fast by
   76.63 -+ * getting whole tracks at a time whenever possible.
   76.64 -+ */
   76.65 - 
   76.66 - #define	SETUPSECS 4		/* Minimal nr of setup-sectors */
   76.67 - #define PREFIXSIZE ((SETUPSECS+1)*512)
   76.68 - #define PREFIXPGH (PREFIXSIZE / 16 )
   76.69 --#define	BOOTSEG  0x07C0		/* original address of boot-sector */
   76.70 - #define	INITSEG  0x9000		/* we move boot here - out of the way */
   76.71 - #define	SETUPSEG 0x9020		/* setup starts here */
   76.72 --#define SYSSEG   0x1000		/* system loaded at 0x10000 (65536). */
   76.73 - 
   76.74 --	.text
   76.75 --	.code16
   76.76 --	.arch i386
   76.77 --	.org	0
   76.78 --	.section ".prefix", "ax", @progbits
   76.79 - 	.globl	_prefix
   76.80 - _prefix:
   76.81 -+.equ	BOOTSEG, 0x07C0			/* original address of boot-sector */
   76.82 - 
   76.83 --/* 
   76.84 --	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
   76.85 --	a .lilo file is dd'ed to a floppy), print an error message. 
   76.86 --*/
   76.87 -+.equ	SYSSEG, 0x1000			/* system loaded at SYSSEG<<4 */
   76.88 -+
   76.89 -+	.org	0
   76.90 -+	.arch i386
   76.91 -+	.text
   76.92 -+	.section ".prefix", "ax", @progbits
   76.93 -+	.code16
   76.94 -+
   76.95 -+	call	here
   76.96 -+here:
   76.97 -+	pop	%ax
   76.98 -+	cmpw	$0x103, %ax		/* COM entry point is cs:0x100 */
   76.99 -+	jne	bootsector
  76.100 -+
  76.101 -+/* We need a real mode stack that won't be stomped on by Etherboot
  76.102 -+   which starts at 0x20000. Choose something that's sufficiently high,
  76.103 -+   but not in DOC territory. Note that we couldn't do this in a real
  76.104 -+   .com program since stack variables are in the same segment as the
  76.105 -+   code and data, but this isn't really a .com program, it just looks
  76.106 -+   like one to make DOS load it into memory. It still has the 64kB
  76.107 -+   limitation of .com files though. */
  76.108 -+#define STACK_SEG	0x7000
  76.109 -+#define STACK_SIZE	0x4000
  76.110 -+	/* Set up temporary stack */ 
  76.111 -+	movw	$STACK_SEG, %ax
  76.112 -+	movw	%ax, %ss
  76.113 -+	movw	$STACK_SIZE, %sp
  76.114 -+
  76.115 -+	/* Calculate segment address of image start */
  76.116 -+	pushw	%cs
  76.117 -+	popw	%ax
  76.118 -+	addw	$(0x100/16), %ax
  76.119 -+	jmp	go_setup_code
  76.120 - 
  76.121 --bootsector: 
  76.122 --	jmp	$BOOTSEG, $go - _prefix	/* reload cs:ip to match relocation addr */
  76.123 -+bootsector:
  76.124 -+	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  76.125 - go: 
  76.126 --	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
  76.127 --					    of bootsect + room for stack */
  76.128 -+	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
  76.129 -+					/* of bootsect + room for stack + 12 for */
  76.130 -+					/* saved disk parm block */
  76.131 - 
  76.132 - 	movw	$BOOTSEG, %ax
  76.133 - 	movw	%ax,%ds
  76.134 - 	movw	%ax,%es
  76.135 --
  76.136 --	cli
  76.137 --	movw	%ax, %ss		/* put stack at BOOTSEG:0x2000. */
  76.138 -+	movw	%ax,%ss			/* put stack at initial position */
  76.139 - 	movw	%di,%sp
  76.140 --	sti
  76.141 - 
  76.142 --	movw	$why_end-why, %cx
  76.143 --	movw	$why - _prefix, %si
  76.144 -+/* Many BIOS's default disk parameter tables will not recognize multi-sector
  76.145 -+ * reads beyond the maximum sector number specified in the default diskette
  76.146 -+ * parameter tables - this may mean 7 sectors in some cases.
  76.147 -+ *
  76.148 -+ * Since single sector reads are slow and out of the question, we must take care
  76.149 -+ * of this by creating new parameter tables (for the first disk) in RAM.  We
  76.150 -+ * will set the maximum sector count to 36 - the most we will encounter on an
  76.151 -+ * ED 2.88.  High doesn't hurt.	Low does.
  76.152 -+ *
  76.153 -+ * Segments are as follows: ds=es=ss=cs - BOOTSEG
  76.154 -+ */
  76.155 -+
  76.156 -+	xorw	%cx,%cx
  76.157 -+	movw	%cx,%es			/* access segment 0 */
  76.158 -+	movw	$0x78, %bx		/* 0:bx is parameter table address */
  76.159 -+	pushw	%ds			/* save ds */
  76.160 -+/* 0:bx is parameter table address */
  76.161 -+	ldsw	%es:(%bx),%si		/* loads ds and si */
  76.162 -+
  76.163 -+	movw	%ax,%es			/* ax is BOOTSECT (loaded above) */
  76.164 -+	movb	$6, %cl			/* copy 12 bytes */
  76.165 -+	cld
  76.166 -+	pushw	%di			/* keep a copy for later */
  76.167 -+	rep
  76.168 -+	movsw				/* ds:si is source, es:di is dest */
  76.169 -+	popw	%di
  76.170 -+
  76.171 -+	movb	$36,%es:4(%di)
  76.172 -+
  76.173 -+	movw	%cx,%ds			/* access segment 0 */
  76.174 -+	xchgw	%di,(%bx)
  76.175 -+	movw	%es,%si
  76.176 -+	xchgw	%si,2(%bx)
  76.177 -+	popw	%ds			/* restore ds */
  76.178 -+	movw	%di, dpoff		/* save old parameters */
  76.179 -+	movw	%si, dpseg		/* to restore just before finishing */
  76.180 -+	pushw	%ds
  76.181 -+	popw	%es			/* reload es */
  76.182 -+
  76.183 -+/* Note that es is already set up.  Also cx is 0 from rep movsw above. */
  76.184 -+
  76.185 -+	xorb	%ah,%ah			/* reset FDC */
  76.186 -+	xorb	%dl,%dl
  76.187 -+	int	$0x13
  76.188 -+
  76.189 -+/* Get disk drive parameters, specifically number of sectors/track.
  76.190 -+ *
  76.191 -+ * It seems that there is no BIOS call to get the number of sectors.  Guess
  76.192 -+ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
  76.193 -+ * 15 if sector 15 can be read.	Otherwise guess 9.
  76.194 -+ */
  76.195 - 
  76.196 --	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  76.197 --	movb	$0x0e, %ah		/* write char, tty mode */
  76.198 --prloop: 
  76.199 -+	movw	$disksizes, %si		/* table of sizes to try */
  76.200 -+
  76.201 -+probe_loop: 
  76.202 - 	lodsb
  76.203 -+	orb	%al, %al
  76.204 -+	je	got_sectors		/* if all else fails, try 9 */
  76.205 -+	cbtw				/* extend to word */
  76.206 -+	movw	%ax, sectors
  76.207 -+	xchgw	%cx,%ax			/* cx = track and sector */
  76.208 -+	xorw	%dx,%dx			/* drive 0, head 0 */
  76.209 -+	movw	$0x0200, %bx		/* address after boot sector */
  76.210 -+					/*   (512 bytes from origin, es = cs) */
  76.211 -+	movw	$0x0201, %ax		/* service 2, 1 sector */
  76.212 -+	int	$0x13
  76.213 -+	jc	probe_loop		/* try next value */
  76.214 -+
  76.215 -+got_sectors: 
  76.216 -+	movw	$msg1end-msg1, %cx
  76.217 -+	movw	$msg1, %si
  76.218 -+	call	print_str
  76.219 -+
  76.220 -+/* ok, we've written the Loading... message, now we want to load the system */
  76.221 -+
  76.222 -+	pushw	%es			/* = ds */
  76.223 -+	movw	$SYSSEG, %ax
  76.224 -+	movw	%ax,%es			/* segment of SYSSEG<<4 */
  76.225 -+	pushw	%es
  76.226 -+	call	read_it
  76.227 -+
  76.228 -+/* This turns off the floppy drive motor, so that we enter the kernel in a
  76.229 -+ * known state, and don't have to worry about it later.
  76.230 -+ */
  76.231 -+	movw	$0x3f2, %dx
  76.232 -+	xorb	%al,%al
  76.233 -+	outb	%al,%dx
  76.234 -+
  76.235 -+	call	print_nl
  76.236 -+	pop	%es			/* = SYSSEG */
  76.237 -+	pop	%es			/* balance push/pop es */
  76.238 -+sigok: 
  76.239 -+
  76.240 -+/* Restore original disk parameters */
  76.241 -+	movw	$0x78, %bx
  76.242 -+	movw	dpoff, %di
  76.243 -+	movw	dpseg, %si
  76.244 -+	xorw	%ax,%ax
  76.245 -+	movw	%ax,%ds
  76.246 -+	movw	%di,(%bx)
  76.247 -+	movw	%si,2(%bx)
  76.248 -+
  76.249 -+/* after that (everything loaded), we call to the .ROM file loaded. */
  76.250 -+
  76.251 -+	movw	$SYSSEG, %ax
  76.252 -+	jmp	go_setup_code
  76.253 -+
  76.254 -+/* This routine loads the system at address SYSSEG<<4, making sure no 64kB
  76.255 -+ * boundaries are crossed. We try to load it as fast as possible, loading whole
  76.256 -+ * tracks whenever we can.
  76.257 -+ *
  76.258 -+ * in:	es - starting address segment (normally SYSSEG)
  76.259 -+ */
  76.260 -+read_it: 
  76.261 -+	movw	$0,sread		/* read whole image incl boot sector */
  76.262 -+	movw	%es,%ax
  76.263 -+	testw	$0x0fff, %ax
  76.264 -+die:	jne	die			/* es must be at 64kB boundary */
  76.265 -+	xorw	%bx,%bx			/* bx is starting address within segment */
  76.266 -+rp_read: 
  76.267 -+	movw	%es,%ax
  76.268 -+	movw	%bx,%dx
  76.269 -+	movb	$4, %cl
  76.270 -+	shrw	%cl,%dx			/* bx is always divisible by 16 */
  76.271 -+	addw	%dx,%ax
  76.272 -+	cmpw	$SYSSEG+SYSSIZE, %ax	/* have we loaded all yet? */
  76.273 -+	jb	ok1_read
  76.274 -+	ret
  76.275 -+ok1_read: 
  76.276 -+	movw	sectors, %ax
  76.277 -+	subw	sread, %ax
  76.278 -+	movw	%ax,%cx
  76.279 -+	shlw	$9, %cx			/* 80186 opcode */
  76.280 -+	addw	%bx,%cx
  76.281 -+	jnc	ok2_read
  76.282 -+	je	ok2_read
  76.283 -+	xorw	%ax,%ax
  76.284 -+	subw	%bx,%ax
  76.285 -+	shrw	$9, %ax			/* 80186 opcode */
  76.286 -+ok2_read: 
  76.287 -+	call	read_track
  76.288 -+	movw	%ax,%cx
  76.289 -+	addw	sread, %ax
  76.290 -+	cmpw	sectors, %ax
  76.291 -+	jne	ok3_read
  76.292 -+	movw	$1, %ax
  76.293 -+	subw	head, %ax
  76.294 -+	jne	ok4_read
  76.295 -+	incw	track
  76.296 -+ok4_read: 
  76.297 -+	movw	%ax, head
  76.298 -+	xorw	%ax,%ax
  76.299 -+ok3_read: 
  76.300 -+	movw	%ax, sread
  76.301 -+	shlw	$9, %cx			/* 80186 opcode */
  76.302 -+	addw	%cx,%bx
  76.303 -+	jnc	rp_read
  76.304 -+	movw	%es,%ax
  76.305 -+	addb	$0x10, %ah
  76.306 -+	movw	%ax,%es
  76.307 -+	xorw	%bx,%bx
  76.308 -+	jmp	rp_read
  76.309 -+
  76.310 -+read_track: 
  76.311 -+	pusha				/* 80186 opcode */
  76.312 -+	pushw	%ax
  76.313 -+	pushw	%bx
  76.314 -+	pushw	%bp			/* just in case the BIOS is buggy */
  76.315 -+	movb	$0x2e, %al		/* 0x2e = . */
  76.316 -+	call	print_char
  76.317 -+	popw	%bp
  76.318 -+	popw	%bx
  76.319 -+	popw	%ax
  76.320 -+
  76.321 -+	movw	sread, %cx
  76.322 -+	incw	%cx
  76.323 -+	movb	track, %ch
  76.324 -+	movw	$0x0100, %dx
  76.325 -+	andb	head, %dh
  76.326 -+	movb	$2, %ah
  76.327 -+
  76.328 -+	pushw	%dx			/* save for error dump */
  76.329 -+	pushw	%cx
  76.330 -+	pushw	%bx
  76.331 -+	pushw	%ax
  76.332 -+
  76.333 -+	int	$0x13
  76.334 -+	jc	bad_rt
  76.335 -+	addw	$8, %sp
  76.336 -+	popa				/* 80186 opcode */
  76.337 -+	ret
  76.338 -+
  76.339 -+bad_rt: pushw	%ax			/* save error code */
  76.340 -+	call	print_all		/* ah = error, al = read */
  76.341 -+
  76.342 -+	xorb	%ah,%ah
  76.343 -+	xorb	%dl,%dl
  76.344 -+	int	$0x13
  76.345 -+
  76.346 -+	addw	$10, %sp
  76.347 -+	popa				/* 80186 opcode */
  76.348 -+	jmp	read_track
  76.349 -+
  76.350 -+/* print_all is for debugging purposes.	It will print out all of the registers.
  76.351 -+ * The assumption is that this is called from a routine, with a stack frame like
  76.352 -+ *	dx
  76.353 -+ *	cx
  76.354 -+ *	bx
  76.355 -+ *	ax
  76.356 -+ *	error
  76.357 -+ *	ret <- sp
  76.358 -+ */
  76.359 -+
  76.360 -+print_all: 
  76.361 -+	call	print_nl		/* nl for readability */
  76.362 -+					/* print_nl update ah and bx */
  76.363 -+	movw	$5, %cx			/* error code + 4 registers */
  76.364 -+	movw	%sp,%bp
  76.365 -+
  76.366 -+print_loop: 
  76.367 -+	pushw	%cx			/* save count left */
  76.368 -+
  76.369 -+	cmpb	$5, %cl
  76.370 -+	jae	no_reg			/* see if register name is needed */
  76.371 -+
  76.372 -+	movb	$0x5+0x41-1, %al
  76.373 -+	subb	%cl,%al
  76.374 -+	int	$0x10
  76.375 -+
  76.376 -+	movb	$0x58, %al		/* 'X' */
  76.377 -+	int	$0x10
  76.378 -+
  76.379 -+	movb	$0x3A, %al		/* ':' */
  76.380 -+	int	$0x10
  76.381 -+
  76.382 -+no_reg: 
  76.383 -+	addw	$2, %bp			/* next register */
  76.384 -+	call	print_hex		/* print it */
  76.385 -+	movb	$0x20, %al		/* print a space */
  76.386 - 	int	$0x10
  76.387 -+	popw	%cx
  76.388 -+	loop	print_loop
  76.389 -+					/* nl for readability */
  76.390 -+print_nl: 
  76.391 -+	movb	$0xd, %al		/* CR */
  76.392 -+	call	print_char
  76.393 -+	movb	$0xa, %al		/* LF */
  76.394 -+	jmp	print_char
  76.395 -+
  76.396 -+
  76.397 -+print_str: 
  76.398 -+prloop: 
  76.399 -+	lodsb
  76.400 -+	call	print_char
  76.401 - 	loop	prloop
  76.402 --freeze: jmp	freeze
  76.403 -+	ret
  76.404 -+
  76.405 -+/* print_hex prints the word pointed to by ss:bp in hexadecimal. */
  76.406 -+
  76.407 -+print_hex: 
  76.408 -+	movw	(%bp),%dx		/* load word into dx */
  76.409 -+	movb	$4, %cl
  76.410 -+	call	print_2digits
  76.411 -+print_2digits: 
  76.412 -+	call	print_digit
  76.413 -+/* fall through */
  76.414 -+print_digit: 
  76.415 -+	rol	%cl,%dx			/* rotate to use lowest 4 bits */
  76.416 -+	movb	$0x0f, %al		/* mask for nybble */
  76.417 -+	andb	%dl,%al
  76.418 -+	addb	$0x90, %al		/* convert al to ascii hex */
  76.419 -+	daa				/* (four instructions) */
  76.420 -+	adcb	$0x40, %al
  76.421 -+	daa
  76.422 -+print_char:
  76.423 -+	movb	$0x0e, %ah		/* write char, tty mode */
  76.424 -+	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  76.425 -+	int	$0x10
  76.426 -+	ret
  76.427 -+
  76.428 -+sread:	.word 0				/* sectors read of current track */
  76.429 -+head:	.word 0				/* current head */
  76.430 -+track:	.word 0				/* current track */
  76.431 -+
  76.432 -+sectors: 
  76.433 -+	.word 0
  76.434 -+
  76.435 -+dpseg:	.word 0
  76.436 -+dpoff:	.word 0
  76.437 - 
  76.438 --why:	.ascii	"This image cannot be loaded from a floppy disk.\r\n"
  76.439 --why_end: 
  76.440 -+disksizes: 
  76.441 -+	.byte 36,18,15,9,0
  76.442 - 
  76.443 -+msg1: 
  76.444 -+	.ascii "Loading ROM image"
  76.445 -+msg1end: 
  76.446 - 
  76.447 - 	.org	497
  76.448 - setup_sects: 
  76.449 -@@ -117,15 +402,22 @@
  76.450 - 	whose entry point is SYSSEG:0.
  76.451 - */
  76.452 - setup_code: 
  76.453 --	pushl	$0		/* No parameters to preserve for exit path */
  76.454 --	pushw	$0		/* Use prefix exit path mechanism */
  76.455 -+	movw	$(SYSSEG-(PREFIXSIZE/16)), %ax
  76.456 - 	/* Etherboot expects to be contiguous in memory once loaded.
  76.457 - 	 * LILO doesn't do this, but since we don't need any
  76.458 - 	 * information that's left in the prefix, it doesn't matter:
  76.459 - 	 * we just have to ensure that %cs:0000 is where the start of
  76.460 - 	 * the Etherboot image *would* be.
  76.461 - 	 */
  76.462 --	ljmp	$(SYSSEG-(PREFIXSIZE/16)), $_start
  76.463 -+go_setup_code: 
  76.464 -+	xorw	%cx, %cx
  76.465 -+	pushw	%cx
  76.466 -+	pushw	%cx		/* No parameters to preserve for exit path */
  76.467 -+	pushw	%cx		/* Use prefix exit path mechanism */
  76.468 -+	pushw	%ax
  76.469 -+	pushw	$_start
  76.470 -+	/* Calculated lcall to _start with %cs:0000 = image start */
  76.471 -+	lret
  76.472 - 
  76.473 - 	.section ".text16", "ax", @progbits
  76.474 - 	.globl	prefix_exit
  76.475 -
  76.476 ---- etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S
  76.477 -+++ etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S
  76.478 -@@ -82,6 +82,14 @@
  76.479 - #define SIG1	0xAA55
  76.480 - #define SIG2	0x5A5A
  76.481 - 
  76.482 -+/* SYS_SIZE is the number of clicks (16 bytes) to be loaded.  For Etherboot
  76.483 -+ * purposes, we need to load everything but the boot sector itself, i.e. 32
  76.484 -+ * clicks less than the size of the entire (verbatim) image.  The image size
  76.485 -+ * is practically limited only by the available base memory size.
  76.486 -+ */
  76.487 -+.globl	SYSSIZE
  76.488 -+.equ	SYSSIZE, _verbatim_size_pgh - 32
  76.489 -+
  76.490 - 	.text
  76.491 - 	.code16
  76.492 - 	.arch i386
  76.493 -@@ -90,40 +98,349 @@
  76.494 - 	.globl	_prefix
  76.495 - _prefix:
  76.496 - 
  76.497 --/* 
  76.498 --	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
  76.499 --	a .lilo file is dd'ed to a floppy), print an error message. 
  76.500 --*/
  76.501 -+	call	here
  76.502 -+here:
  76.503 -+	pop	%ax
  76.504 -+	cmpw	$0x103, %ax		/* COM entry point is cs:0x100 */
  76.505 -+	jne	bootsector
  76.506 -+
  76.507 -+/* We need a real mode stack that won't be stomped on by Etherboot
  76.508 -+   which starts at 0x20000. Choose something that's sufficiently high,
  76.509 -+   but not in DOC territory. Note that we couldn't do this in a real
  76.510 -+   .com program since stack variables are in the same segment as the
  76.511 -+   code and data, but this isn't really a .com program, it just looks
  76.512 -+   like one to make DOS load it into memory. It still has the 64kB
  76.513 -+   limitation of .com files though. */
  76.514 -+#define STACK_SEG	0x7000
  76.515 -+#define STACK_SIZE	0x4000
  76.516 -+	/* Set up temporary stack */ 
  76.517 -+	movw	$STACK_SEG, %ax
  76.518 -+	movw	%ax, %ss
  76.519 -+	movw	$STACK_SIZE, %sp
  76.520 -+
  76.521 -+	/* Calculate segment address of image start */
  76.522 -+	pushw	%cs
  76.523 -+	popw	%ax
  76.524 -+	addw	$(0x100/16), %ax
  76.525 -+	jmp	go_setup_code
  76.526 - 
  76.527 --bootsector: 
  76.528 --	jmp	$BOOTSEG, $go - _prefix	/* reload cs:ip to match relocation addr */
  76.529 -+bootsector:
  76.530 -+	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  76.531 - go: 
  76.532 --	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
  76.533 --					    of bootsect + room for stack */
  76.534 -+	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
  76.535 -+					/* of bootsect + room for stack + 12 for */
  76.536 -+					/* saved disk parm block */
  76.537 - 
  76.538 - 	movw	$BOOTSEG, %ax
  76.539 - 	movw	%ax,%ds
  76.540 - 	movw	%ax,%es
  76.541 --
  76.542 --	cli
  76.543 --	movw	%ax, %ss		/* put stack at BOOTSEG:0x2000. */
  76.544 -+	movw	%ax,%ss			/* put stack at initial position */
  76.545 - 	movw	%di,%sp
  76.546 --	sti
  76.547 - 
  76.548 --	movw	$why_end-why, %cx
  76.549 --	movw	$why - _prefix, %si
  76.550 -+/* Many BIOS's default disk parameter tables will not recognize multi-sector
  76.551 -+ * reads beyond the maximum sector number specified in the default diskette
  76.552 -+ * parameter tables - this may mean 7 sectors in some cases.
  76.553 -+ *
  76.554 -+ * Since single sector reads are slow and out of the question, we must take care
  76.555 -+ * of this by creating new parameter tables (for the first disk) in RAM.  We
  76.556 -+ * will set the maximum sector count to 36 - the most we will encounter on an
  76.557 -+ * ED 2.88.  High doesn't hurt.	Low does.
  76.558 -+ *
  76.559 -+ * Segments are as follows: ds=es=ss=cs - BOOTSEG
  76.560 -+ */
  76.561 -+
  76.562 -+	xorw	%cx,%cx
  76.563 -+	movw	%cx,%es			/* access segment 0 */
  76.564 -+	movw	$0x78, %bx		/* 0:bx is parameter table address */
  76.565 -+	pushw	%ds			/* save ds */
  76.566 -+/* 0:bx is parameter table address */
  76.567 -+	ldsw	%es:(%bx),%si		/* loads ds and si */
  76.568 -+
  76.569 -+	movw	%ax,%es			/* ax is BOOTSECT (loaded above) */
  76.570 -+	movb	$6, %cl			/* copy 12 bytes */
  76.571 -+	cld
  76.572 -+	pushw	%di			/* keep a copy for later */
  76.573 -+	rep
  76.574 -+	movsw				/* ds:si is source, es:di is dest */
  76.575 -+	popw	%di
  76.576 - 
  76.577 --	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  76.578 --	movb	$0x0e, %ah		/* write char, tty mode */
  76.579 --prloop: 
  76.580 -+	movb	$36,%es:4(%di)
  76.581 -+
  76.582 -+	movw	%cx,%ds			/* access segment 0 */
  76.583 -+	xchgw	%di,(%bx)
  76.584 -+	movw	%es,%si
  76.585 -+	xchgw	%si,2(%bx)
  76.586 -+	popw	%ds			/* restore ds */
  76.587 -+	movw	%di, dpoff		/* save old parameters */
  76.588 -+	movw	%si, dpseg		/* to restore just before finishing */
  76.589 -+	pushw	%ds
  76.590 -+	popw	%es			/* reload es */
  76.591 -+
  76.592 -+/* Note that es is already set up.  Also cx is 0 from rep movsw above. */
  76.593 -+
  76.594 -+	xorb	%ah,%ah			/* reset FDC */
  76.595 -+	xorb	%dl,%dl
  76.596 -+	int	$0x13
  76.597 -+
  76.598 -+/* Get disk drive parameters, specifically number of sectors/track.
  76.599 -+ *
  76.600 -+ * It seems that there is no BIOS call to get the number of sectors.  Guess
  76.601 -+ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
  76.602 -+ * 15 if sector 15 can be read.	Otherwise guess 9.
  76.603 -+ */
  76.604 -+
  76.605 -+	movw	$disksizes, %si		/* table of sizes to try */
  76.606 -+
  76.607 -+probe_loop: 
  76.608 - 	lodsb
  76.609 -+	orb	%al, %al
  76.610 -+	je	got_sectors		/* if all else fails, try 9 */
  76.611 -+	cbtw				/* extend to word */
  76.612 -+	movw	%ax, sectors
  76.613 -+	xchgw	%cx,%ax			/* cx = track and sector */
  76.614 -+	xorw	%dx,%dx			/* drive 0, head 0 */
  76.615 -+	movw	$0x0200, %bx		/* address after boot sector */
  76.616 -+					/*   (512 bytes from origin, es = cs) */
  76.617 -+	movw	$0x0201, %ax		/* service 2, 1 sector */
  76.618 -+	int	$0x13
  76.619 -+	jc	probe_loop		/* try next value */
  76.620 -+
  76.621 -+got_sectors: 
  76.622 -+	movw	$msg1end-msg1, %cx
  76.623 -+	movw	$msg1, %si
  76.624 -+	call	print_str
  76.625 -+
  76.626 -+/* ok, we've written the Loading... message, now we want to load the system */
  76.627 -+
  76.628 -+	pushw	%es			/* = ds */
  76.629 -+	movw	$SYSSEG, %ax
  76.630 -+	movw	%ax,%es			/* segment of SYSSEG<<4 */
  76.631 -+	pushw	%es
  76.632 -+	call	read_it
  76.633 -+
  76.634 -+/* This turns off the floppy drive motor, so that we enter the kernel in a
  76.635 -+ * known state, and don't have to worry about it later.
  76.636 -+ */
  76.637 -+	movw	$0x3f2, %dx
  76.638 -+	xorb	%al,%al
  76.639 -+	outb	%al,%dx
  76.640 -+
  76.641 -+	call	print_nl
  76.642 -+	pop	%es			/* = SYSSEG */
  76.643 -+	pop	%es			/* balance push/pop es */
  76.644 -+sigok: 
  76.645 -+
  76.646 -+/* Restore original disk parameters */
  76.647 -+	movw	$0x78, %bx
  76.648 -+	movw	dpoff, %di
  76.649 -+	movw	dpseg, %si
  76.650 -+	xorw	%ax,%ax
  76.651 -+	movw	%ax,%ds
  76.652 -+	movw	%di,(%bx)
  76.653 -+	movw	%si,2(%bx)
  76.654 -+
  76.655 -+/* after that (everything loaded), we call to the .ROM file loaded. */
  76.656 -+
  76.657 -+	movw	$SYSSEG, %ax
  76.658 -+go_setup_code: 
  76.659 -+	xorw	%cx, %cx
  76.660 -+	pushw	%cx
  76.661 -+	pushw	%cx		/* No parameters to preserve for exit path */
  76.662 -+	pushw	%cx		/* Use prefix exit path mechanism */
  76.663 -+	pushw	%ax
  76.664 -+	pushw	$_start
  76.665 -+	/* Calculated lcall to _start with %cs:0000 = image start */
  76.666 -+	lret
  76.667 -+
  76.668 -+/* This routine loads the system at address SYSSEG<<4, making sure no 64kB
  76.669 -+ * boundaries are crossed. We try to load it as fast as possible, loading whole
  76.670 -+ * tracks whenever we can.
  76.671 -+ *
  76.672 -+ * in:	es - starting address segment (normally SYSSEG)
  76.673 -+ */
  76.674 -+read_it: 
  76.675 -+	movw	$0,sread		/* read whole image incl boot sector */
  76.676 -+	movw	%es,%ax
  76.677 -+	testw	$0x0fff, %ax
  76.678 -+die:	jne	die			/* es must be at 64kB boundary */
  76.679 -+	xorw	%bx,%bx			/* bx is starting address within segment */
  76.680 -+rp_read: 
  76.681 -+	movw	%es,%ax
  76.682 -+	movw	%bx,%dx
  76.683 -+	movb	$4, %cl
  76.684 -+	shrw	%cl,%dx			/* bx is always divisible by 16 */
  76.685 -+	addw	%dx,%ax
  76.686 -+	cmpw	$SYSSEG+SYSSIZE, %ax	/* have we loaded all yet? */
  76.687 -+	jb	ok1_read
  76.688 -+	ret
  76.689 -+ok1_read: 
  76.690 -+	movw	sectors, %ax
  76.691 -+	subw	sread, %ax
  76.692 -+	movw	%ax,%cx
  76.693 -+	shlw	$9, %cx			/* 80186 opcode */
  76.694 -+	addw	%bx,%cx
  76.695 -+	jnc	ok2_read
  76.696 -+	je	ok2_read
  76.697 -+	xorw	%ax,%ax
  76.698 -+	subw	%bx,%ax
  76.699 -+	shrw	$9, %ax			/* 80186 opcode */
  76.700 -+ok2_read: 
  76.701 -+	call	read_track
  76.702 -+	movw	%ax,%cx
  76.703 -+	addw	sread, %ax
  76.704 -+	cmpw	sectors, %ax
  76.705 -+	jne	ok3_read
  76.706 -+	movw	$1, %ax
  76.707 -+	subw	head, %ax
  76.708 -+	jne	ok4_read
  76.709 -+	incw	track
  76.710 -+ok4_read: 
  76.711 -+	movw	%ax, head
  76.712 -+	xorw	%ax,%ax
  76.713 -+ok3_read: 
  76.714 -+	movw	%ax, sread
  76.715 -+	shlw	$9, %cx			/* 80186 opcode */
  76.716 -+	addw	%cx,%bx
  76.717 -+	jnc	rp_read
  76.718 -+	movw	%es,%ax
  76.719 -+	addb	$0x10, %ah
  76.720 -+	movw	%ax,%es
  76.721 -+	xorw	%bx,%bx
  76.722 -+	jmp	rp_read
  76.723 -+
  76.724 -+read_track: 
  76.725 -+	pusha				/* 80186 opcode */
  76.726 -+	pushw	%ax
  76.727 -+	pushw	%bx
  76.728 -+	pushw	%bp			/* just in case the BIOS is buggy */
  76.729 -+	movb	$0x2e, %al		/* 0x2e = . */
  76.730 -+	call	print_char
  76.731 -+	popw	%bp
  76.732 -+	popw	%bx
  76.733 -+	popw	%ax
  76.734 -+
  76.735 -+	movw	sread, %cx
  76.736 -+	incw	%cx
  76.737 -+	movb	track, %ch
  76.738 -+	movw	$0x0100, %dx
  76.739 -+	andb	head, %dh
  76.740 -+	movb	$2, %ah
  76.741 -+
  76.742 -+	pushw	%dx			/* save for error dump */
  76.743 -+	pushw	%cx
  76.744 -+	pushw	%bx
  76.745 -+	pushw	%ax
  76.746 -+
  76.747 -+	int	$0x13
  76.748 -+	jc	bad_rt
  76.749 -+	addw	$8, %sp
  76.750 -+	popa				/* 80186 opcode */
  76.751 -+	ret
  76.752 -+
  76.753 -+bad_rt: pushw	%ax			/* save error code */
  76.754 -+	call	print_all		/* ah = error, al = read */
  76.755 -+
  76.756 -+	xorb	%ah,%ah
  76.757 -+	xorb	%dl,%dl
  76.758 -+	int	$0x13
  76.759 -+
  76.760 -+	addw	$10, %sp
  76.761 -+	popa				/* 80186 opcode */
  76.762 -+	jmp	read_track
  76.763 -+
  76.764 -+/* print_all is for debugging purposes.	It will print out all of the registers.
  76.765 -+ * The assumption is that this is called from a routine, with a stack frame like
  76.766 -+ *	dx
  76.767 -+ *	cx
  76.768 -+ *	bx
  76.769 -+ *	ax
  76.770 -+ *	error
  76.771 -+ *	ret <- sp
  76.772 -+ */
  76.773 -+
  76.774 -+print_all: 
  76.775 -+	call	print_nl		/* nl for readability */
  76.776 -+					/* print_nl update ah and bx */
  76.777 -+	movw	$5, %cx			/* error code + 4 registers */
  76.778 -+	movw	%sp,%bp
  76.779 -+
  76.780 -+print_loop: 
  76.781 -+	pushw	%cx			/* save count left */
  76.782 -+
  76.783 -+	cmpb	$5, %cl
  76.784 -+	jae	no_reg			/* see if register name is needed */
  76.785 -+
  76.786 -+	movb	$0x5+0x41-1, %al
  76.787 -+	subb	%cl,%al
  76.788 - 	int	$0x10
  76.789 -+
  76.790 -+	movb	$0x58, %al		/* 'X' */
  76.791 -+	int	$0x10
  76.792 -+
  76.793 -+	movb	$0x3A, %al		/* ':' */
  76.794 -+	int	$0x10
  76.795 -+
  76.796 -+no_reg: 
  76.797 -+	addw	$2, %bp			/* next register */
  76.798 -+	call	print_hex		/* print it */
  76.799 -+	movb	$0x20, %al		/* print a space */
  76.800 -+	int	$0x10
  76.801 -+	popw	%cx
  76.802 -+	loop	print_loop
  76.803 -+					/* nl for readability */
  76.804 -+print_nl: 
  76.805 -+	movb	$0xd, %al		/* CR */
  76.806 -+	call	print_char
  76.807 -+	movb	$0xa, %al		/* LF */
  76.808 -+	jmp	print_char
  76.809 -+
  76.810 -+
  76.811 -+print_str: 
  76.812 -+prloop: 
  76.813 -+	lodsb
  76.814 -+	call	print_char
  76.815 - 	loop	prloop
  76.816 --freeze: jmp	freeze
  76.817 -+	ret
  76.818 - 
  76.819 --why:	.ascii	"This image cannot be loaded from a floppy disk.\r\n"
  76.820 --why_end: 
  76.821 -+/* print_hex prints the word pointed to by ss:bp in hexadecimal. */
  76.822 -+
  76.823 -+print_hex: 
  76.824 -+	movw	(%bp),%dx		/* load word into dx */
  76.825 -+	movb	$4, %cl
  76.826 -+	call	print_2digits
  76.827 -+print_2digits: 
  76.828 -+	call	print_digit
  76.829 -+/* fall through */
  76.830 -+print_digit: 
  76.831 -+	rol	%cl,%dx			/* rotate to use lowest 4 bits */
  76.832 -+	movb	$0x0f, %al		/* mask for nybble */
  76.833 -+	andb	%dl,%al
  76.834 -+	addb	$0x90, %al		/* convert al to ascii hex */
  76.835 -+	daa				/* (four instructions) */
  76.836 -+	adcb	$0x40, %al
  76.837 -+	daa
  76.838 -+print_char:
  76.839 -+	movb	$0x0e, %ah		/* write char, tty mode */
  76.840 -+	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  76.841 -+	int	$0x10
  76.842 -+	ret
  76.843 - 
  76.844 -+sread:	.word 0				/* sectors read of current track */
  76.845 -+head:	.word 0				/* current head */
  76.846 -+track:	.word 0				/* current track */
  76.847 -+
  76.848 -+sectors: 
  76.849 -+	.word 0
  76.850 -+
  76.851 -+dpseg:	.word 0
  76.852 -+dpoff:	.word 0
  76.853 -+
  76.854 -+disksizes: 
  76.855 -+	.byte 36,18,15,9,0
  76.856 -+
  76.857 -+msg1: 
  76.858 -+	.ascii "Loading ROM image"
  76.859 -+msg1end: 
  76.860 - 
  76.861 - 	.org	497
  76.862 - setup_sects: 
    77.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    77.2 +++ b/etherboot/stuff/patches/etherboot-net.u	Thu May 10 21:12:00 2018 +0300
    77.3 @@ -0,0 +1,46 @@
    77.4 +Patch from network_boot_floppy+cd+hd_540.zip at http://sourceforge.net/projects/thinstation
    77.5 +--- etherboot-5.4.3/src/Makefile.main	2007-02-24 15:44:59.000000000 +0100
    77.6 ++++ etherboot-5.4.3/src/Makefile.main	2008-04-08 15:06:47.000000000 +0200
    77.7 +@@ -382,6 +382,27 @@
    77.8 + $(BIN)/%.zbin: $(BIN)/%.bin $(BIN)/nrv2b $(MAKEDEPS)
    77.9 + 	$(BIN)/nrv2b e $< $@
   77.10 + 
   77.11 ++# Rule for the multi-NIC image. (by Paolo Salvan)
   77.12 ++NETOBJS:=
   77.13 ++# Note: the 3c90x.o driver should be linked BEFORE the 3c595.o
   77.14 ++# otherwise 3c905b cards will be (badly) handled by the 3c595 driver as 3c900b cards
   77.15 ++NETOBJS+=		$(BIN)/3c90x.o
   77.16 ++# PCI cards...
   77.17 ++NETOBJS+=		$(BIN)/3c595.o $(BIN)/davicom.o $(BIN)/eepro100.o $(BIN)/ns8390.o $(BIN)/pcnet32.o $(BIN)/prism2_plx.o $(BIN)/rtl8139.o $(BIN)/sis900.o $(BIN)/tulip.o $(BIN)/via-rhine.o $(BIN)/r8169.o $(BIN)/forcedeth.o $(BIN)/ns83820.o $(BIN)/eepro.o $(BIN)/e1000.o
   77.18 ++# ISA cards...
   77.19 ++NETOBJS+=		$(BIN)/3c503.o $(BIN)/ne.o $(BIN)/wd.o $(BIN)/3c529.o $(BIN)/3c509.o
   77.20 ++# Exclude these drivers + the belows to create the .COM image, max 65280 byte...
   77.21 ++NETOBJS+=		$(BIN)/sk_g16.o $(BIN)/depca.o $(BIN)/cs89x0.o $(BIN)/prism2_pci.o $(BIN)/smc9000.o $(BIN)/natsemi.o $(BIN)/epic100.o $(BIN)/sundance.o $(BIN)/w89c840.o $(BIN)/tlan.o
   77.22 ++# Try excluding this big and rarely-used driver if you get "ERROR: code size exceeds limit!" at build-time
   77.23 ++# or system resets/hungs-up during image decompression at run-time
   77.24 ++# (uncompressed image could have exceeded low-memory...)
   77.25 ++NETOBJS+=		$(BIN)/tg3.o
   77.26 ++# This driver has slow autoprobing and is rarely used, so it is better to exclude it...
   77.27 ++#NETOBJS+=		$(BIN)/3c515.o
   77.28 ++
   77.29 ++$(BIN)/etherboot-net.o: $(NETOBJS)
   77.30 ++	$(LD) -r $(NETOBJS) -o $@
   77.31 ++
   77.32 + # Housekeeping
   77.33 + 
   77.34 + clean:
   77.35 +
   77.36 +--- etherboot-5.4.3/src/core/main.c	2007-02-24 15:44:59.000000000 +0100
   77.37 ++++ etherboot-5.4.3/src/core/main.c	2008-04-08 15:11:46.000000000 +0200
   77.38 +@@ -471,6 +471,11 @@
   77.39 + #ifdef	DNS_RESOLVER
   77.40 + 	const char *resolvt;
   77.41 + #endif
   77.42 ++        char *name_tmp = fname;
   77.43 ++        while ( *name_tmp != 0 ) {
   77.44 ++                if ( memcmp(name_tmp, ".zpxe", 6 ) == 0 ) {*name_tmp=0;} else {++name_tmp;}
   77.45 ++        }
   77.46 ++
   77.47 + 	ip.s_addr = arptable[ARP_SERVER].ipaddr.s_addr;
   77.48 + 	name = fname;
   77.49 + 	url_port = -1;
    78.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    78.2 +++ b/etherboot/stuff/patches/etherboot-prefix.u	Thu May 10 21:12:00 2018 +0300
    78.3 @@ -0,0 +1,859 @@
    78.4 +--- etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S
    78.5 ++++ etherboot-5.4.3/src/arch/i386/prefix/liloprefix.S
    78.6 +@@ -1,92 +1,377 @@
    78.7 +-/*
    78.8 +-	Copyright (C) 2000, Entity Cyber, Inc.
    78.9 +-
   78.10 +-	Authors: Gary Byers (gb@thinguin.org)
   78.11 +-		 Marty Connor (mdc@thinguin.org)
   78.12 +-
   78.13 +-	This software may be used and distributed according to the terms
   78.14 +-	of the GNU Public License (GPL), incorporated herein by reference.
   78.15 +-
   78.16 +-	Description:	
   78.17 +-
   78.18 +-	This is just a little bit of code and data that can get prepended
   78.19 +-	to an Etherboot ROM image in order to allow LILO to load the
   78.20 +-	result as if it were a Linux kernel image.
   78.21 +-
   78.22 +-	A real Linux kernel image consists of a one-sector boot loader
   78.23 +-	(to load the image from a floppy disk), followed a few sectors
   78.24 +-	of setup code, followed by the kernel code itself.  There's
   78.25 +-	a table in the first sector (starting at offset 497) that indicates
   78.26 +-	how many sectors of setup code follow the first sector and which
   78.27 +-	contains some other parameters that aren't interesting in this
   78.28 +-	case.
   78.29 +-
   78.30 +-	When LILO loads the sectors that comprise a kernel image, it doesn't
   78.31 +-	execute the code in the first sector (since that code would try to
   78.32 +-	load the image from a floppy disk.)  The code in the first sector
   78.33 +-	below doesn't expect to get executed (and prints an error message
   78.34 +-	if it ever -is- executed.)  LILO's only interested in knowing the
   78.35 +-	number of setup sectors advertised in the table (at offset 497 in
   78.36 +-	the first sector.)
   78.37 +-
   78.38 +-	Etherboot doesn't require much in the way of setup code.
   78.39 +-	Historically, the Linux kernel required at least 4 sectors of
   78.40 +-	setup code.  Current versions of LILO look at the byte at
   78.41 +-	offset 497 in the first sector to indicate how many sectors
   78.42 +-	of setup code are contained in the image.
   78.43 +-
   78.44 +-*/
   78.45 ++/* SYS_SIZE is the number of clicks (16 bytes) to be loaded.  For Etherboot
   78.46 ++ * purposes, we need to load everything but the boot sector itself, i.e. 32
   78.47 ++ * clicks less than the size of the entire (verbatim) image.  The image size
   78.48 ++ * is practically limited only by the available base memory size.
   78.49 ++ */
   78.50 ++.globl	SYSSIZE
   78.51 ++.equ	SYSSIZE, _verbatim_size_pgh - 32
   78.52 ++
   78.53 ++/*	floppyload.S Copyright (C) 1991, 1992 Linus Torvalds
   78.54 ++ *	modified by Drew Eckhardt
   78.55 ++ *	modified by Bruce Evans (bde)
   78.56 ++ *
   78.57 ++ * floppyprefix.S is loaded at 0x0000:0x7c00 by the bios-startup routines.
   78.58 ++ *
   78.59 ++ * It then loads the system at SYSSEG<<4, using BIOS interrupts.
   78.60 ++ *
   78.61 ++ * The loader has been made as simple as possible, and continuous read errors
   78.62 ++ * will result in a unbreakable loop. Reboot by hand. It loads pretty fast by
   78.63 ++ * getting whole tracks at a time whenever possible.
   78.64 ++ */
   78.65 + 
   78.66 + #define	SETUPSECS 4		/* Minimal nr of setup-sectors */
   78.67 + #define PREFIXSIZE ((SETUPSECS+1)*512)
   78.68 + #define PREFIXPGH (PREFIXSIZE / 16 )
   78.69 +-#define	BOOTSEG  0x07C0		/* original address of boot-sector */
   78.70 + #define	INITSEG  0x9000		/* we move boot here - out of the way */
   78.71 + #define	SETUPSEG 0x9020		/* setup starts here */
   78.72 +-#define SYSSEG   0x1000		/* system loaded at 0x10000 (65536). */
   78.73 + 
   78.74 +-	.text
   78.75 +-	.code16
   78.76 +-	.arch i386
   78.77 +-	.org	0
   78.78 +-	.section ".prefix", "ax", @progbits
   78.79 + 	.globl	_prefix
   78.80 + _prefix:
   78.81 ++.equ	BOOTSEG, 0x07C0			/* original address of boot-sector */
   78.82 + 
   78.83 +-/* 
   78.84 +-	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
   78.85 +-	a .lilo file is dd'ed to a floppy), print an error message. 
   78.86 +-*/
   78.87 ++.equ	SYSSEG, 0x1000			/* system loaded at SYSSEG<<4 */
   78.88 ++
   78.89 ++	.org	0
   78.90 ++	.arch i386
   78.91 ++	.text
   78.92 ++	.section ".prefix", "ax", @progbits
   78.93 ++	.code16
   78.94 ++
   78.95 ++	call	here
   78.96 ++here:
   78.97 ++	pop	%ax
   78.98 ++	cmpw	$0x103, %ax		/* COM entry point is cs:0x100 */
   78.99 ++	jne	bootsector
  78.100 ++
  78.101 ++/* We need a real mode stack that won't be stomped on by Etherboot
  78.102 ++   which starts at 0x20000. Choose something that's sufficiently high,
  78.103 ++   but not in DOC territory. Note that we couldn't do this in a real
  78.104 ++   .com program since stack variables are in the same segment as the
  78.105 ++   code and data, but this isn't really a .com program, it just looks
  78.106 ++   like one to make DOS load it into memory. It still has the 64kB
  78.107 ++   limitation of .com files though. */
  78.108 ++#define STACK_SEG	0x7000
  78.109 ++#define STACK_SIZE	0x4000
  78.110 ++	/* Set up temporary stack */ 
  78.111 ++	movw	$STACK_SEG, %ax
  78.112 ++	movw	%ax, %ss
  78.113 ++	movw	$STACK_SIZE, %sp
  78.114 ++
  78.115 ++	/* Calculate segment address of image start */
  78.116 ++	pushw	%cs
  78.117 ++	popw	%ax
  78.118 ++	addw	$(0x100/16), %ax
  78.119 ++	jmp	go_setup_code
  78.120 + 
  78.121 +-bootsector: 
  78.122 +-	jmp	$BOOTSEG, $go - _prefix	/* reload cs:ip to match relocation addr */
  78.123 ++bootsector:
  78.124 ++	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  78.125 + go: 
  78.126 +-	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
  78.127 +-					    of bootsect + room for stack */
  78.128 ++	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
  78.129 ++					/* of bootsect + room for stack + 12 for */
  78.130 ++					/* saved disk parm block */
  78.131 + 
  78.132 + 	movw	$BOOTSEG, %ax
  78.133 + 	movw	%ax,%ds
  78.134 + 	movw	%ax,%es
  78.135 +-
  78.136 +-	cli
  78.137 +-	movw	%ax, %ss		/* put stack at BOOTSEG:0x2000. */
  78.138 ++	movw	%ax,%ss			/* put stack at initial position */
  78.139 + 	movw	%di,%sp
  78.140 +-	sti
  78.141 + 
  78.142 +-	movw	$why_end-why, %cx
  78.143 +-	movw	$why - _prefix, %si
  78.144 ++/* Many BIOS's default disk parameter tables will not recognize multi-sector
  78.145 ++ * reads beyond the maximum sector number specified in the default diskette
  78.146 ++ * parameter tables - this may mean 7 sectors in some cases.
  78.147 ++ *
  78.148 ++ * Since single sector reads are slow and out of the question, we must take care
  78.149 ++ * of this by creating new parameter tables (for the first disk) in RAM.  We
  78.150 ++ * will set the maximum sector count to 36 - the most we will encounter on an
  78.151 ++ * ED 2.88.  High doesn't hurt.	Low does.
  78.152 ++ *
  78.153 ++ * Segments are as follows: ds=es=ss=cs - BOOTSEG
  78.154 ++ */
  78.155 ++
  78.156 ++	xorw	%cx,%cx
  78.157 ++	movw	%cx,%es			/* access segment 0 */
  78.158 ++	movw	$0x78, %bx		/* 0:bx is parameter table address */
  78.159 ++	pushw	%ds			/* save ds */
  78.160 ++/* 0:bx is parameter table address */
  78.161 ++	ldsw	%es:(%bx),%si		/* loads ds and si */
  78.162 ++
  78.163 ++	movw	%ax,%es			/* ax is BOOTSECT (loaded above) */
  78.164 ++	movb	$6, %cl			/* copy 12 bytes */
  78.165 ++	cld
  78.166 ++	pushw	%di			/* keep a copy for later */
  78.167 ++	rep
  78.168 ++	movsw				/* ds:si is source, es:di is dest */
  78.169 ++	popw	%di
  78.170 ++
  78.171 ++	movb	$36,%es:4(%di)
  78.172 ++
  78.173 ++	movw	%cx,%ds			/* access segment 0 */
  78.174 ++	xchgw	%di,(%bx)
  78.175 ++	movw	%es,%si
  78.176 ++	xchgw	%si,2(%bx)
  78.177 ++	popw	%ds			/* restore ds */
  78.178 ++	movw	%di, dpoff		/* save old parameters */
  78.179 ++	movw	%si, dpseg		/* to restore just before finishing */
  78.180 ++	pushw	%ds
  78.181 ++	popw	%es			/* reload es */
  78.182 ++
  78.183 ++/* Note that es is already set up.  Also cx is 0 from rep movsw above. */
  78.184 ++
  78.185 ++	xorb	%ah,%ah			/* reset FDC */
  78.186 ++	xorb	%dl,%dl
  78.187 ++	int	$0x13
  78.188 ++
  78.189 ++/* Get disk drive parameters, specifically number of sectors/track.
  78.190 ++ *
  78.191 ++ * It seems that there is no BIOS call to get the number of sectors.  Guess
  78.192 ++ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
  78.193 ++ * 15 if sector 15 can be read.	Otherwise guess 9.
  78.194 ++ */
  78.195 + 
  78.196 +-	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  78.197 +-	movb	$0x0e, %ah		/* write char, tty mode */
  78.198 +-prloop: 
  78.199 ++	movw	$disksizes, %si		/* table of sizes to try */
  78.200 ++
  78.201 ++probe_loop: 
  78.202 + 	lodsb
  78.203 ++	orb	%al, %al
  78.204 ++	je	got_sectors		/* if all else fails, try 9 */
  78.205 ++	cbtw				/* extend to word */
  78.206 ++	movw	%ax, sectors
  78.207 ++	xchgw	%cx,%ax			/* cx = track and sector */
  78.208 ++	xorw	%dx,%dx			/* drive 0, head 0 */
  78.209 ++	movw	$0x0200, %bx		/* address after boot sector */
  78.210 ++					/*   (512 bytes from origin, es = cs) */
  78.211 ++	movw	$0x0201, %ax		/* service 2, 1 sector */
  78.212 ++	int	$0x13
  78.213 ++	jc	probe_loop		/* try next value */
  78.214 ++
  78.215 ++got_sectors: 
  78.216 ++	movw	$msg1end-msg1, %cx
  78.217 ++	movw	$msg1, %si
  78.218 ++	call	print_str
  78.219 ++
  78.220 ++/* ok, we've written the Loading... message, now we want to load the system */
  78.221 ++
  78.222 ++	pushw	%es			/* = ds */
  78.223 ++	movw	$SYSSEG, %ax
  78.224 ++	movw	%ax,%es			/* segment of SYSSEG<<4 */
  78.225 ++	pushw	%es
  78.226 ++	call	read_it
  78.227 ++
  78.228 ++/* This turns off the floppy drive motor, so that we enter the kernel in a
  78.229 ++ * known state, and don't have to worry about it later.
  78.230 ++ */
  78.231 ++	movw	$0x3f2, %dx
  78.232 ++	xorb	%al,%al
  78.233 ++	outb	%al,%dx
  78.234 ++
  78.235 ++	call	print_nl
  78.236 ++	pop	%es			/* = SYSSEG */
  78.237 ++	pop	%es			/* balance push/pop es */
  78.238 ++sigok: 
  78.239 ++
  78.240 ++/* Restore original disk parameters */
  78.241 ++	movw	$0x78, %bx
  78.242 ++	movw	dpoff, %di
  78.243 ++	movw	dpseg, %si
  78.244 ++	xorw	%ax,%ax
  78.245 ++	movw	%ax,%ds
  78.246 ++	movw	%di,(%bx)
  78.247 ++	movw	%si,2(%bx)
  78.248 ++
  78.249 ++/* after that (everything loaded), we call to the .ROM file loaded. */
  78.250 ++
  78.251 ++	movw	$SYSSEG, %ax
  78.252 ++	jmp	go_setup_code
  78.253 ++
  78.254 ++/* This routine loads the system at address SYSSEG<<4, making sure no 64kB
  78.255 ++ * boundaries are crossed. We try to load it as fast as possible, loading whole
  78.256 ++ * tracks whenever we can.
  78.257 ++ *
  78.258 ++ * in:	es - starting address segment (normally SYSSEG)
  78.259 ++ */
  78.260 ++read_it: 
  78.261 ++	movw	$0,sread		/* read whole image incl boot sector */
  78.262 ++	movw	%es,%ax
  78.263 ++	testw	$0x0fff, %ax
  78.264 ++die:	jne	die			/* es must be at 64kB boundary */
  78.265 ++	xorw	%bx,%bx			/* bx is starting address within segment */
  78.266 ++rp_read: 
  78.267 ++	movw	%es,%ax
  78.268 ++	movw	%bx,%dx
  78.269 ++	movb	$4, %cl
  78.270 ++	shrw	%cl,%dx			/* bx is always divisible by 16 */
  78.271 ++	addw	%dx,%ax
  78.272 ++	cmpw	$SYSSEG+SYSSIZE, %ax	/* have we loaded all yet? */
  78.273 ++	jb	ok1_read
  78.274 ++	ret
  78.275 ++ok1_read: 
  78.276 ++	movw	sectors, %ax
  78.277 ++	subw	sread, %ax
  78.278 ++	movw	%ax,%cx
  78.279 ++	shlw	$9, %cx			/* 80186 opcode */
  78.280 ++	addw	%bx,%cx
  78.281 ++	jnc	ok2_read
  78.282 ++	je	ok2_read
  78.283 ++	xorw	%ax,%ax
  78.284 ++	subw	%bx,%ax
  78.285 ++	shrw	$9, %ax			/* 80186 opcode */
  78.286 ++ok2_read: 
  78.287 ++	call	read_track
  78.288 ++	movw	%ax,%cx
  78.289 ++	addw	sread, %ax
  78.290 ++	cmpw	sectors, %ax
  78.291 ++	jne	ok3_read
  78.292 ++	movw	$1, %ax
  78.293 ++	subw	head, %ax
  78.294 ++	jne	ok4_read
  78.295 ++	incw	track
  78.296 ++ok4_read: 
  78.297 ++	movw	%ax, head
  78.298 ++	xorw	%ax,%ax
  78.299 ++ok3_read: 
  78.300 ++	movw	%ax, sread
  78.301 ++	shlw	$9, %cx			/* 80186 opcode */
  78.302 ++	addw	%cx,%bx
  78.303 ++	jnc	rp_read
  78.304 ++	movw	%es,%ax
  78.305 ++	addb	$0x10, %ah
  78.306 ++	movw	%ax,%es
  78.307 ++	xorw	%bx,%bx
  78.308 ++	jmp	rp_read
  78.309 ++
  78.310 ++read_track: 
  78.311 ++	pusha				/* 80186 opcode */
  78.312 ++	pushw	%ax
  78.313 ++	pushw	%bx
  78.314 ++	pushw	%bp			/* just in case the BIOS is buggy */
  78.315 ++	movb	$0x2e, %al		/* 0x2e = . */
  78.316 ++	call	print_char
  78.317 ++	popw	%bp
  78.318 ++	popw	%bx
  78.319 ++	popw	%ax
  78.320 ++
  78.321 ++	movw	sread, %cx
  78.322 ++	incw	%cx
  78.323 ++	movb	track, %ch
  78.324 ++	movw	$0x0100, %dx
  78.325 ++	andb	head, %dh
  78.326 ++	movb	$2, %ah
  78.327 ++
  78.328 ++	pushw	%dx			/* save for error dump */
  78.329 ++	pushw	%cx
  78.330 ++	pushw	%bx
  78.331 ++	pushw	%ax
  78.332 ++
  78.333 ++	int	$0x13
  78.334 ++	jc	bad_rt
  78.335 ++	addw	$8, %sp
  78.336 ++	popa				/* 80186 opcode */
  78.337 ++	ret
  78.338 ++
  78.339 ++bad_rt: pushw	%ax			/* save error code */
  78.340 ++	call	print_all		/* ah = error, al = read */
  78.341 ++
  78.342 ++	xorb	%ah,%ah
  78.343 ++	xorb	%dl,%dl
  78.344 ++	int	$0x13
  78.345 ++
  78.346 ++	addw	$10, %sp
  78.347 ++	popa				/* 80186 opcode */
  78.348 ++	jmp	read_track
  78.349 ++
  78.350 ++/* print_all is for debugging purposes.	It will print out all of the registers.
  78.351 ++ * The assumption is that this is called from a routine, with a stack frame like
  78.352 ++ *	dx
  78.353 ++ *	cx
  78.354 ++ *	bx
  78.355 ++ *	ax
  78.356 ++ *	error
  78.357 ++ *	ret <- sp
  78.358 ++ */
  78.359 ++
  78.360 ++print_all: 
  78.361 ++	call	print_nl		/* nl for readability */
  78.362 ++					/* print_nl update ah and bx */
  78.363 ++	movw	$5, %cx			/* error code + 4 registers */
  78.364 ++	movw	%sp,%bp
  78.365 ++
  78.366 ++print_loop: 
  78.367 ++	pushw	%cx			/* save count left */
  78.368 ++
  78.369 ++	cmpb	$5, %cl
  78.370 ++	jae	no_reg			/* see if register name is needed */
  78.371 ++
  78.372 ++	movb	$0x5+0x41-1, %al
  78.373 ++	subb	%cl,%al
  78.374 ++	int	$0x10
  78.375 ++
  78.376 ++	movb	$0x58, %al		/* 'X' */
  78.377 ++	int	$0x10
  78.378 ++
  78.379 ++	movb	$0x3A, %al		/* ':' */
  78.380 ++	int	$0x10
  78.381 ++
  78.382 ++no_reg: 
  78.383 ++	addw	$2, %bp			/* next register */
  78.384 ++	call	print_hex		/* print it */
  78.385 ++	movb	$0x20, %al		/* print a space */
  78.386 + 	int	$0x10
  78.387 ++	popw	%cx
  78.388 ++	loop	print_loop
  78.389 ++					/* nl for readability */
  78.390 ++print_nl: 
  78.391 ++	movb	$0xd, %al		/* CR */
  78.392 ++	call	print_char
  78.393 ++	movb	$0xa, %al		/* LF */
  78.394 ++	jmp	print_char
  78.395 ++
  78.396 ++
  78.397 ++print_str: 
  78.398 ++prloop: 
  78.399 ++	lodsb
  78.400 ++	call	print_char
  78.401 + 	loop	prloop
  78.402 +-freeze: jmp	freeze
  78.403 ++	ret
  78.404 ++
  78.405 ++/* print_hex prints the word pointed to by ss:bp in hexadecimal. */
  78.406 ++
  78.407 ++print_hex: 
  78.408 ++	movw	(%bp),%dx		/* load word into dx */
  78.409 ++	movb	$4, %cl
  78.410 ++	call	print_2digits
  78.411 ++print_2digits: 
  78.412 ++	call	print_digit
  78.413 ++/* fall through */
  78.414 ++print_digit: 
  78.415 ++	rol	%cl,%dx			/* rotate to use lowest 4 bits */
  78.416 ++	movb	$0x0f, %al		/* mask for nybble */
  78.417 ++	andb	%dl,%al
  78.418 ++	addb	$0x90, %al		/* convert al to ascii hex */
  78.419 ++	daa				/* (four instructions) */
  78.420 ++	adcb	$0x40, %al
  78.421 ++	daa
  78.422 ++print_char:
  78.423 ++	movb	$0x0e, %ah		/* write char, tty mode */
  78.424 ++	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  78.425 ++	int	$0x10
  78.426 ++	ret
  78.427 ++
  78.428 ++sread:	.word 0				/* sectors read of current track */
  78.429 ++head:	.word 0				/* current head */
  78.430 ++track:	.word 0				/* current track */
  78.431 ++
  78.432 ++sectors: 
  78.433 ++	.word 0
  78.434 ++
  78.435 ++dpseg:	.word 0
  78.436 ++dpoff:	.word 0
  78.437 + 
  78.438 +-why:	.ascii	"This image cannot be loaded from a floppy disk.\r\n"
  78.439 +-why_end: 
  78.440 ++disksizes: 
  78.441 ++	.byte 36,18,15,9,0
  78.442 + 
  78.443 ++msg1: 
  78.444 ++	.ascii "Loading ROM image"
  78.445 ++msg1end: 
  78.446 + 
  78.447 + 	.org	497
  78.448 + setup_sects: 
  78.449 +@@ -117,15 +402,22 @@
  78.450 + 	whose entry point is SYSSEG:0.
  78.451 + */
  78.452 + setup_code: 
  78.453 +-	pushl	$0		/* No parameters to preserve for exit path */
  78.454 +-	pushw	$0		/* Use prefix exit path mechanism */
  78.455 ++	movw	$(SYSSEG-(PREFIXSIZE/16)), %ax
  78.456 + 	/* Etherboot expects to be contiguous in memory once loaded.
  78.457 + 	 * LILO doesn't do this, but since we don't need any
  78.458 + 	 * information that's left in the prefix, it doesn't matter:
  78.459 + 	 * we just have to ensure that %cs:0000 is where the start of
  78.460 + 	 * the Etherboot image *would* be.
  78.461 + 	 */
  78.462 +-	ljmp	$(SYSSEG-(PREFIXSIZE/16)), $_start
  78.463 ++go_setup_code: 
  78.464 ++	xorw	%cx, %cx
  78.465 ++	pushw	%cx
  78.466 ++	pushw	%cx		/* No parameters to preserve for exit path */
  78.467 ++	pushw	%cx		/* Use prefix exit path mechanism */
  78.468 ++	pushw	%ax
  78.469 ++	pushw	$_start
  78.470 ++	/* Calculated lcall to _start with %cs:0000 = image start */
  78.471 ++	lret
  78.472 + 
  78.473 + 	.section ".text16", "ax", @progbits
  78.474 + 	.globl	prefix_exit
  78.475 +
  78.476 +--- etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S
  78.477 ++++ etherboot-5.4.3/src/arch/i386/prefix/bImageprefix.S
  78.478 +@@ -82,6 +82,14 @@
  78.479 + #define SIG1	0xAA55
  78.480 + #define SIG2	0x5A5A
  78.481 + 
  78.482 ++/* SYS_SIZE is the number of clicks (16 bytes) to be loaded.  For Etherboot
  78.483 ++ * purposes, we need to load everything but the boot sector itself, i.e. 32
  78.484 ++ * clicks less than the size of the entire (verbatim) image.  The image size
  78.485 ++ * is practically limited only by the available base memory size.
  78.486 ++ */
  78.487 ++.globl	SYSSIZE
  78.488 ++.equ	SYSSIZE, _verbatim_size_pgh - 32
  78.489 ++
  78.490 + 	.text
  78.491 + 	.code16
  78.492 + 	.arch i386
  78.493 +@@ -90,40 +98,349 @@
  78.494 + 	.globl	_prefix
  78.495 + _prefix:
  78.496 + 
  78.497 +-/* 
  78.498 +-	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
  78.499 +-	a .lilo file is dd'ed to a floppy), print an error message. 
  78.500 +-*/
  78.501 ++	call	here
  78.502 ++here:
  78.503 ++	pop	%ax
  78.504 ++	cmpw	$0x103, %ax		/* COM entry point is cs:0x100 */
  78.505 ++	jne	bootsector
  78.506 ++
  78.507 ++/* We need a real mode stack that won't be stomped on by Etherboot
  78.508 ++   which starts at 0x20000. Choose something that's sufficiently high,
  78.509 ++   but not in DOC territory. Note that we couldn't do this in a real
  78.510 ++   .com program since stack variables are in the same segment as the
  78.511 ++   code and data, but this isn't really a .com program, it just looks
  78.512 ++   like one to make DOS load it into memory. It still has the 64kB
  78.513 ++   limitation of .com files though. */
  78.514 ++#define STACK_SEG	0x7000
  78.515 ++#define STACK_SIZE	0x4000
  78.516 ++	/* Set up temporary stack */ 
  78.517 ++	movw	$STACK_SEG, %ax
  78.518 ++	movw	%ax, %ss
  78.519 ++	movw	$STACK_SIZE, %sp
  78.520 ++
  78.521 ++	/* Calculate segment address of image start */
  78.522 ++	pushw	%cs
  78.523 ++	popw	%ax
  78.524 ++	addw	$(0x100/16), %ax
  78.525 ++	jmp	go_setup_code
  78.526 + 
  78.527 +-bootsector: 
  78.528 +-	jmp	$BOOTSEG, $go - _prefix	/* reload cs:ip to match relocation addr */
  78.529 ++bootsector:
  78.530 ++	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  78.531 + go: 
  78.532 +-	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
  78.533 +-					    of bootsect + room for stack */
  78.534 ++	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
  78.535 ++					/* of bootsect + room for stack + 12 for */
  78.536 ++					/* saved disk parm block */
  78.537 + 
  78.538 + 	movw	$BOOTSEG, %ax
  78.539 + 	movw	%ax,%ds
  78.540 + 	movw	%ax,%es
  78.541 +-
  78.542 +-	cli
  78.543 +-	movw	%ax, %ss		/* put stack at BOOTSEG:0x2000. */
  78.544 ++	movw	%ax,%ss			/* put stack at initial position */
  78.545 + 	movw	%di,%sp
  78.546 +-	sti
  78.547 + 
  78.548 +-	movw	$why_end-why, %cx
  78.549 +-	movw	$why - _prefix, %si
  78.550 ++/* Many BIOS's default disk parameter tables will not recognize multi-sector
  78.551 ++ * reads beyond the maximum sector number specified in the default diskette
  78.552 ++ * parameter tables - this may mean 7 sectors in some cases.
  78.553 ++ *
  78.554 ++ * Since single sector reads are slow and out of the question, we must take care
  78.555 ++ * of this by creating new parameter tables (for the first disk) in RAM.  We
  78.556 ++ * will set the maximum sector count to 36 - the most we will encounter on an
  78.557 ++ * ED 2.88.  High doesn't hurt.	Low does.
  78.558 ++ *
  78.559 ++ * Segments are as follows: ds=es=ss=cs - BOOTSEG
  78.560 ++ */
  78.561 ++
  78.562 ++	xorw	%cx,%cx
  78.563 ++	movw	%cx,%es			/* access segment 0 */
  78.564 ++	movw	$0x78, %bx		/* 0:bx is parameter table address */
  78.565 ++	pushw	%ds			/* save ds */
  78.566 ++/* 0:bx is parameter table address */
  78.567 ++	ldsw	%es:(%bx),%si		/* loads ds and si */
  78.568 ++
  78.569 ++	movw	%ax,%es			/* ax is BOOTSECT (loaded above) */
  78.570 ++	movb	$6, %cl			/* copy 12 bytes */
  78.571 ++	cld
  78.572 ++	pushw	%di			/* keep a copy for later */
  78.573 ++	rep
  78.574 ++	movsw				/* ds:si is source, es:di is dest */
  78.575 ++	popw	%di
  78.576 + 
  78.577 +-	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  78.578 +-	movb	$0x0e, %ah		/* write char, tty mode */
  78.579 +-prloop: 
  78.580 ++	movb	$36,%es:4(%di)
  78.581 ++
  78.582 ++	movw	%cx,%ds			/* access segment 0 */
  78.583 ++	xchgw	%di,(%bx)
  78.584 ++	movw	%es,%si
  78.585 ++	xchgw	%si,2(%bx)
  78.586 ++	popw	%ds			/* restore ds */
  78.587 ++	movw	%di, dpoff		/* save old parameters */
  78.588 ++	movw	%si, dpseg		/* to restore just before finishing */
  78.589 ++	pushw	%ds
  78.590 ++	popw	%es			/* reload es */
  78.591 ++
  78.592 ++/* Note that es is already set up.  Also cx is 0 from rep movsw above. */
  78.593 ++
  78.594 ++	xorb	%ah,%ah			/* reset FDC */
  78.595 ++	xorb	%dl,%dl
  78.596 ++	int	$0x13
  78.597 ++
  78.598 ++/* Get disk drive parameters, specifically number of sectors/track.
  78.599 ++ *
  78.600 ++ * It seems that there is no BIOS call to get the number of sectors.  Guess
  78.601 ++ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
  78.602 ++ * 15 if sector 15 can be read.	Otherwise guess 9.
  78.603 ++ */
  78.604 ++
  78.605 ++	movw	$disksizes, %si		/* table of sizes to try */
  78.606 ++
  78.607 ++probe_loop: 
  78.608 + 	lodsb
  78.609 ++	orb	%al, %al
  78.610 ++	je	got_sectors		/* if all else fails, try 9 */
  78.611 ++	cbtw				/* extend to word */
  78.612 ++	movw	%ax, sectors
  78.613 ++	xchgw	%cx,%ax			/* cx = track and sector */
  78.614 ++	xorw	%dx,%dx			/* drive 0, head 0 */
  78.615 ++	movw	$0x0200, %bx		/* address after boot sector */
  78.616 ++					/*   (512 bytes from origin, es = cs) */
  78.617 ++	movw	$0x0201, %ax		/* service 2, 1 sector */
  78.618 ++	int	$0x13
  78.619 ++	jc	probe_loop		/* try next value */
  78.620 ++
  78.621 ++got_sectors: 
  78.622 ++	movw	$msg1end-msg1, %cx
  78.623 ++	movw	$msg1, %si
  78.624 ++	call	print_str
  78.625 ++
  78.626 ++/* ok, we've written the Loading... message, now we want to load the system */
  78.627 ++
  78.628 ++	pushw	%es			/* = ds */
  78.629 ++	movw	$SYSSEG, %ax
  78.630 ++	movw	%ax,%es			/* segment of SYSSEG<<4 */
  78.631 ++	pushw	%es
  78.632 ++	call	read_it
  78.633 ++
  78.634 ++/* This turns off the floppy drive motor, so that we enter the kernel in a
  78.635 ++ * known state, and don't have to worry about it later.
  78.636 ++ */
  78.637 ++	movw	$0x3f2, %dx
  78.638 ++	xorb	%al,%al
  78.639 ++	outb	%al,%dx
  78.640 ++
  78.641 ++	call	print_nl
  78.642 ++	pop	%es			/* = SYSSEG */
  78.643 ++	pop	%es			/* balance push/pop es */
  78.644 ++sigok: 
  78.645 ++
  78.646 ++/* Restore original disk parameters */
  78.647 ++	movw	$0x78, %bx
  78.648 ++	movw	dpoff, %di
  78.649 ++	movw	dpseg, %si
  78.650 ++	xorw	%ax,%ax
  78.651 ++	movw	%ax,%ds
  78.652 ++	movw	%di,(%bx)
  78.653 ++	movw	%si,2(%bx)
  78.654 ++
  78.655 ++/* after that (everything loaded), we call to the .ROM file loaded. */
  78.656 ++
  78.657 ++	movw	$SYSSEG, %ax
  78.658 ++go_setup_code: 
  78.659 ++	xorw	%cx, %cx
  78.660 ++	pushw	%cx
  78.661 ++	pushw	%cx		/* No parameters to preserve for exit path */
  78.662 ++	pushw	%cx		/* Use prefix exit path mechanism */
  78.663 ++	pushw	%ax
  78.664 ++	pushw	$_start
  78.665 ++	/* Calculated lcall to _start with %cs:0000 = image start */
  78.666 ++	lret
  78.667 ++
  78.668 ++/* This routine loads the system at address SYSSEG<<4, making sure no 64kB
  78.669 ++ * boundaries are crossed. We try to load it as fast as possible, loading whole
  78.670 ++ * tracks whenever we can.
  78.671 ++ *
  78.672 ++ * in:	es - starting address segment (normally SYSSEG)
  78.673 ++ */
  78.674 ++read_it: 
  78.675 ++	movw	$0,sread		/* read whole image incl boot sector */
  78.676 ++	movw	%es,%ax
  78.677 ++	testw	$0x0fff, %ax
  78.678 ++die:	jne	die			/* es must be at 64kB boundary */
  78.679 ++	xorw	%bx,%bx			/* bx is starting address within segment */
  78.680 ++rp_read: 
  78.681 ++	movw	%es,%ax
  78.682 ++	movw	%bx,%dx
  78.683 ++	movb	$4, %cl
  78.684 ++	shrw	%cl,%dx			/* bx is always divisible by 16 */
  78.685 ++	addw	%dx,%ax
  78.686 ++	cmpw	$SYSSEG+SYSSIZE, %ax	/* have we loaded all yet? */
  78.687 ++	jb	ok1_read
  78.688 ++	ret
  78.689 ++ok1_read: 
  78.690 ++	movw	sectors, %ax
  78.691 ++	subw	sread, %ax
  78.692 ++	movw	%ax,%cx
  78.693 ++	shlw	$9, %cx			/* 80186 opcode */
  78.694 ++	addw	%bx,%cx
  78.695 ++	jnc	ok2_read
  78.696 ++	je	ok2_read
  78.697 ++	xorw	%ax,%ax
  78.698 ++	subw	%bx,%ax
  78.699 ++	shrw	$9, %ax			/* 80186 opcode */
  78.700 ++ok2_read: 
  78.701 ++	call	read_track
  78.702 ++	movw	%ax,%cx
  78.703 ++	addw	sread, %ax
  78.704 ++	cmpw	sectors, %ax
  78.705 ++	jne	ok3_read
  78.706 ++	movw	$1, %ax
  78.707 ++	subw	head, %ax
  78.708 ++	jne	ok4_read
  78.709 ++	incw	track
  78.710 ++ok4_read: 
  78.711 ++	movw	%ax, head
  78.712 ++	xorw	%ax,%ax
  78.713 ++ok3_read: 
  78.714 ++	movw	%ax, sread
  78.715 ++	shlw	$9, %cx			/* 80186 opcode */
  78.716 ++	addw	%cx,%bx
  78.717 ++	jnc	rp_read
  78.718 ++	movw	%es,%ax
  78.719 ++	addb	$0x10, %ah
  78.720 ++	movw	%ax,%es
  78.721 ++	xorw	%bx,%bx
  78.722 ++	jmp	rp_read
  78.723 ++
  78.724 ++read_track: 
  78.725 ++	pusha				/* 80186 opcode */
  78.726 ++	pushw	%ax
  78.727 ++	pushw	%bx
  78.728 ++	pushw	%bp			/* just in case the BIOS is buggy */
  78.729 ++	movb	$0x2e, %al		/* 0x2e = . */
  78.730 ++	call	print_char
  78.731 ++	popw	%bp
  78.732 ++	popw	%bx
  78.733 ++	popw	%ax
  78.734 ++
  78.735 ++	movw	sread, %cx
  78.736 ++	incw	%cx
  78.737 ++	movb	track, %ch
  78.738 ++	movw	$0x0100, %dx
  78.739 ++	andb	head, %dh
  78.740 ++	movb	$2, %ah
  78.741 ++
  78.742 ++	pushw	%dx			/* save for error dump */
  78.743 ++	pushw	%cx
  78.744 ++	pushw	%bx
  78.745 ++	pushw	%ax
  78.746 ++
  78.747 ++	int	$0x13
  78.748 ++	jc	bad_rt
  78.749 ++	addw	$8, %sp
  78.750 ++	popa				/* 80186 opcode */
  78.751 ++	ret
  78.752 ++
  78.753 ++bad_rt: pushw	%ax			/* save error code */
  78.754 ++	call	print_all		/* ah = error, al = read */
  78.755 ++
  78.756 ++	xorb	%ah,%ah
  78.757 ++	xorb	%dl,%dl
  78.758 ++	int	$0x13
  78.759 ++
  78.760 ++	addw	$10, %sp
  78.761 ++	popa				/* 80186 opcode */
  78.762 ++	jmp	read_track
  78.763 ++
  78.764 ++/* print_all is for debugging purposes.	It will print out all of the registers.
  78.765 ++ * The assumption is that this is called from a routine, with a stack frame like
  78.766 ++ *	dx
  78.767 ++ *	cx
  78.768 ++ *	bx
  78.769 ++ *	ax
  78.770 ++ *	error
  78.771 ++ *	ret <- sp
  78.772 ++ */
  78.773 ++
  78.774 ++print_all: 
  78.775 ++	call	print_nl		/* nl for readability */
  78.776 ++					/* print_nl update ah and bx */
  78.777 ++	movw	$5, %cx			/* error code + 4 registers */
  78.778 ++	movw	%sp,%bp
  78.779 ++
  78.780 ++print_loop: 
  78.781 ++	pushw	%cx			/* save count left */
  78.782 ++
  78.783 ++	cmpb	$5, %cl
  78.784 ++	jae	no_reg			/* see if register name is needed */
  78.785 ++
  78.786 ++	movb	$0x5+0x41-1, %al
  78.787 ++	subb	%cl,%al
  78.788 + 	int	$0x10
  78.789 ++
  78.790 ++	movb	$0x58, %al		/* 'X' */
  78.791 ++	int	$0x10
  78.792 ++
  78.793 ++	movb	$0x3A, %al		/* ':' */
  78.794 ++	int	$0x10
  78.795 ++
  78.796 ++no_reg: 
  78.797 ++	addw	$2, %bp			/* next register */
  78.798 ++	call	print_hex		/* print it */
  78.799 ++	movb	$0x20, %al		/* print a space */
  78.800 ++	int	$0x10
  78.801 ++	popw	%cx
  78.802 ++	loop	print_loop
  78.803 ++					/* nl for readability */
  78.804 ++print_nl: 
  78.805 ++	movb	$0xd, %al		/* CR */
  78.806 ++	call	print_char
  78.807 ++	movb	$0xa, %al		/* LF */
  78.808 ++	jmp	print_char
  78.809 ++
  78.810 ++
  78.811 ++print_str: 
  78.812 ++prloop: 
  78.813 ++	lodsb
  78.814 ++	call	print_char
  78.815 + 	loop	prloop
  78.816 +-freeze: jmp	freeze
  78.817 ++	ret
  78.818 + 
  78.819 +-why:	.ascii	"This image cannot be loaded from a floppy disk.\r\n"
  78.820 +-why_end: 
  78.821 ++/* print_hex prints the word pointed to by ss:bp in hexadecimal. */
  78.822 ++
  78.823 ++print_hex: 
  78.824 ++	movw	(%bp),%dx		/* load word into dx */
  78.825 ++	movb	$4, %cl
  78.826 ++	call	print_2digits
  78.827 ++print_2digits: 
  78.828 ++	call	print_digit
  78.829 ++/* fall through */
  78.830 ++print_digit: 
  78.831 ++	rol	%cl,%dx			/* rotate to use lowest 4 bits */
  78.832 ++	movb	$0x0f, %al		/* mask for nybble */
  78.833 ++	andb	%dl,%al
  78.834 ++	addb	$0x90, %al		/* convert al to ascii hex */
  78.835 ++	daa				/* (four instructions) */
  78.836 ++	adcb	$0x40, %al
  78.837 ++	daa
  78.838 ++print_char:
  78.839 ++	movb	$0x0e, %ah		/* write char, tty mode */
  78.840 ++	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
  78.841 ++	int	$0x10
  78.842 ++	ret
  78.843 + 
  78.844 ++sread:	.word 0				/* sectors read of current track */
  78.845 ++head:	.word 0				/* current head */
  78.846 ++track:	.word 0				/* current track */
  78.847 ++
  78.848 ++sectors: 
  78.849 ++	.word 0
  78.850 ++
  78.851 ++dpseg:	.word 0
  78.852 ++dpoff:	.word 0
  78.853 ++
  78.854 ++disksizes: 
  78.855 ++	.byte 36,18,15,9,0
  78.856 ++
  78.857 ++msg1: 
  78.858 ++	.ascii "Loading ROM image"
  78.859 ++msg1end: 
  78.860 + 
  78.861 + 	.org	497
  78.862 + setup_sects: 
    79.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    79.2 +++ b/etherboot/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    79.3 @@ -0,0 +1,2 @@
    79.4 +-p1|etherboot-net.u
    79.5 +-p1|etherboot-prefix.u
    80.1 --- a/fbvnc/receipt	Wed May 09 17:03:28 2018 +0300
    80.2 +++ b/fbvnc/receipt	Thu May 10 21:12:00 2018 +0300
    80.3 @@ -17,7 +17,6 @@
    80.4  #BUILD_DEPENDS="git"
    80.5  
    80.6  compile_rules() {
    80.7 -	#patch -p0 < $stuff/fbvnc.u &&
    80.8  	sed -i s"/cc/${HOST_SYSTEM}-gcc/" Makefile &&
    80.9  	make &&
   80.10  	install -Dm755 $src/fbvnc $install/usr/bin/fbvnc
    81.1 --- a/fbvnc/stuff/fbvnc.u	Wed May 09 17:03:28 2018 +0300
    81.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    81.3 @@ -1,612 +0,0 @@
    81.4 ---- draw.h
    81.5 -+++ draw.h
    81.6 -@@ -15,5 +15,11 @@
    81.7 - void fb_cmap(void);
    81.8 - 
    81.9 - /* helper functions */
   81.10 -+struct rgb_conv {
   81.11 -+	int rshl, gshl;
   81.12 -+	int rskp, gskp, bskp;
   81.13 -+	int rmax, gmax, bmax;
   81.14 -+};
   81.15 -+void fill_rgb_conv(int mode, struct rgb_conv *s);
   81.16 - void fb_set(int r, int c, void *mem, int len);
   81.17 - unsigned fb_val(int r, int g, int b);
   81.18 ---- draw.c
   81.19 -+++ draw.c
   81.20 -@@ -10,14 +10,13 @@
   81.21 - 
   81.22 - #define MIN(a, b)	((a) < (b) ? (a) : (b))
   81.23 - #define MAX(a, b)	((a) > (b) ? (a) : (b))
   81.24 --#define NLEVELS		(1 << 8)
   81.25 -+#define NLEVELS		(1 << 16)
   81.26 - 
   81.27 - static int fd;
   81.28 - static void *fb;
   81.29 - static struct fb_var_screeninfo vinfo;
   81.30 - static struct fb_fix_screeninfo finfo;
   81.31 --static int bpp;
   81.32 --static int nr, ng, nb;
   81.33 -+static int bytes_per_pixel;
   81.34 - 
   81.35 - static int fb_len(void)
   81.36 - {
   81.37 -@@ -28,10 +27,12 @@
   81.38 - {
   81.39 - 	static unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS];
   81.40 - 	struct fb_cmap cmap;
   81.41 -+
   81.42 - 	if (finfo.visual == FB_VISUAL_TRUECOLOR)
   81.43 - 		return;
   81.44 -+
   81.45 - 	cmap.start = 0;
   81.46 --	cmap.len = MAX(nr, MAX(ng, nb));
   81.47 -+	cmap.len = NLEVELS;
   81.48 - 	cmap.red = red;
   81.49 - 	cmap.green = green;
   81.50 - 	cmap.blue = blue;
   81.51 -@@ -41,24 +42,39 @@
   81.52 - 
   81.53 - void fb_cmap(void)
   81.54 - {
   81.55 --	unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS];
   81.56 -+	struct fb_bitfield *color[3] = {
   81.57 -+		&vinfo.blue, &vinfo.green, &vinfo.red
   81.58 -+	};
   81.59 -+	int eye_sensibility[3] = { 2, 0, 1 }; // higher=red, blue, lower=green
   81.60 - 	struct fb_cmap cmap;
   81.61 --	int i;
   81.62 -+	unsigned short map[3][NLEVELS];
   81.63 -+	int i, j, n, offset;
   81.64 -+
   81.65 - 	if (finfo.visual == FB_VISUAL_TRUECOLOR)
   81.66 - 		return;
   81.67 - 
   81.68 --	for (i = 0; i < nr; i++)
   81.69 --		red[i] = (65535 / (nr - 1)) * i;
   81.70 --	for (i = 0; i < ng; i++)
   81.71 --		green[i] = (65535 / (ng - 1)) * i;
   81.72 --	for (i = 0; i < nb; i++)
   81.73 --		blue[i] = (65535 / (nb - 1)) * i;
   81.74 --
   81.75 -+	for (i = 0, n = vinfo.bits_per_pixel; i < 3; i++) {
   81.76 -+		n -= color[eye_sensibility[i]]->length = n / (3 - i);
   81.77 -+	}
   81.78 -+	n = (1 << vinfo.bits_per_pixel);
   81.79 -+	if (n > NLEVELS)
   81.80 -+		n = NLEVELS;
   81.81 -+	for (i = offset = 0; i < 3; i++) {
   81.82 -+		int length = color[i]->length;
   81.83 -+		color[i]->offset = offset;
   81.84 -+		for (j = 0; j < n; j++) {
   81.85 -+			int k = (j >> offset) << (16 - length);
   81.86 -+			if (k == (0xFFFF << (16 - length)))
   81.87 -+				k = 0xFFFF;
   81.88 -+			map[i][j] = k;
   81.89 -+		}
   81.90 -+		offset += length;
   81.91 -+	}
   81.92 - 	cmap.start = 0;
   81.93 --	cmap.len = MAX(nr, MAX(ng, nb));
   81.94 --	cmap.red = red;
   81.95 --	cmap.green = green;
   81.96 --	cmap.blue = blue;
   81.97 -+	cmap.len = n;
   81.98 -+	cmap.red = map[2];
   81.99 -+	cmap.green = map[1];
  81.100 -+	cmap.blue = map[0];
  81.101 - 	cmap.transp = NULL;
  81.102 - 
  81.103 - 	ioctl(fd, FBIOPUTCMAP, &cmap);
  81.104 -@@ -66,25 +82,26 @@
  81.105 - 
  81.106 - unsigned fb_mode(void)
  81.107 - {
  81.108 --	return (bpp << 16) | (vinfo.red.length << 8) |
  81.109 -+	return (bytes_per_pixel << 16) | (vinfo.red.length << 8) |
  81.110 - 		(vinfo.green.length << 4) | (vinfo.blue.length);
  81.111 - }
  81.112 - 
  81.113 - int fb_init(void)
  81.114 - {
  81.115 -+	int err = 1;
  81.116 - 	fd = open(FBDEV_PATH, O_RDWR);
  81.117 - 	if (fd == -1)
  81.118 - 		goto failed;
  81.119 -+	err++;
  81.120 - 	if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1)
  81.121 - 		goto failed;
  81.122 -+	err++;
  81.123 - 	if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1)
  81.124 - 		goto failed;
  81.125 - 	fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
  81.126 --	bpp = (vinfo.bits_per_pixel + 7) >> 3;
  81.127 --	nr = 1 << vinfo.red.length;
  81.128 --	ng = 1 << vinfo.blue.length;
  81.129 --	nb = 1 << vinfo.green.length;
  81.130 -+	bytes_per_pixel = (vinfo.bits_per_pixel + 7) >> 3;
  81.131 - 	fb = mmap(NULL, fb_len(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  81.132 -+	err++;
  81.133 - 	if (fb == MAP_FAILED)
  81.134 - 		goto failed;
  81.135 - 	fb_cmap_save(1);
  81.136 -@@ -93,7 +110,7 @@
  81.137 - failed:
  81.138 - 	perror("fb_init()");
  81.139 - 	close(fd);
  81.140 --	return 1;
  81.141 -+	return err;
  81.142 - }
  81.143 - 
  81.144 - void fb_free(void)
  81.145 -@@ -120,19 +137,30 @@
  81.146 - 
  81.147 - void fb_set(int r, int c, void *mem, int len)
  81.148 - {
  81.149 --	memcpy(fb_mem(r) + (c + vinfo.xoffset) * bpp, mem, len * bpp);
  81.150 -+	memcpy(fb_mem(r) + (c + vinfo.xoffset) * bytes_per_pixel,
  81.151 -+		mem, len * bytes_per_pixel);
  81.152 - }
  81.153 - 
  81.154 -+void fill_rgb_conv(int mode, struct rgb_conv *s)
  81.155 -+{
  81.156 -+	int bits;
  81.157 -+
  81.158 -+	bits = mode & 0xF;  mode >>= 4;
  81.159 -+	s->rshl = s->gshl = bits;
  81.160 -+	s->bskp = 8 - bits; s->bmax = (1 << bits) -1;
  81.161 -+	bits = mode & 0xF;  mode >>= 4;
  81.162 -+	s->rshl += bits;
  81.163 -+	s->gskp = 8 - bits; s->gmax = (1 << bits) -1;
  81.164 -+	bits = mode & 0xF;
  81.165 -+	s->rskp = 8 - bits; s->rmax = (1 << bits) -1;
  81.166 -+}
  81.167 -+
  81.168 - unsigned fb_val(int r, int g, int b)
  81.169 - {
  81.170 --	switch (fb_mode() & 0x0fff) {
  81.171 --	default:
  81.172 --		fprintf(stderr, "fb_val: unknown fb_mode()\n");
  81.173 --	case 0x0888:
  81.174 --		return (r << 16) | (g << 8) | b;
  81.175 --	case 0x0565:
  81.176 --		return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
  81.177 --	case 0x0233:
  81.178 --		return ((r >> 6) << 6) | ((g >> 5) << 3) | (b >> 5);
  81.179 --	}
  81.180 -+	static struct rgb_conv c;
  81.181 -+	
  81.182 -+	if (c.rshl == 0)
  81.183 -+		fill_rgb_conv(fb_mode(), &c);
  81.184 -+	return ((r >> c.rskp) << c.rshl) | ((g >> c.gskp) << c.gshl) 
  81.185 -+					 | (b >> c.bskp);
  81.186 - }
  81.187 ---- fbvnc.c
  81.188 -+++ fbvnc.c
  81.189 -@@ -36,13 +36,15 @@
  81.190 - 
  81.191 - #define VNC_PORT		"5900"
  81.192 - 
  81.193 --#define MAXRES			(1 << 21)
  81.194 --#define MIN(a, b)		((a) < (b) ? (a) : (b))
  81.195 -+#define MAXRES			(1 << 12)
  81.196 - 
  81.197 - static int cols, rows;
  81.198 -+static int srv_cols, srv_rows;
  81.199 -+static int or, oc;
  81.200 - static int mr, mc;		/* mouse position */
  81.201 - 
  81.202 - static char buf[MAXRES];
  81.203 -+#define MAXPIX		(MAXRES/sizeof(fbval_t))
  81.204 - 
  81.205 - static int vnc_connect(char *addr, char *port)
  81.206 - {
  81.207 -@@ -61,22 +63,26 @@
  81.208 - 
  81.209 - 	if (connect(fd, addrinfo->ai_addr, addrinfo->ai_addrlen) == -1) {
  81.210 - 		close(fd);
  81.211 --		freeaddrinfo(addrinfo);
  81.212 --		return -1;
  81.213 -+		fd = -2;
  81.214 - 	}
  81.215 - 	freeaddrinfo(addrinfo);
  81.216 - 	return fd;
  81.217 - }
  81.218 - 
  81.219 -+static int bpp, vnc_mode;
  81.220 -+static struct rgb_conv format;
  81.221 - static int vnc_init(int fd)
  81.222 - {
  81.223 --	char vncver[] = "RFB 003.003\n";
  81.224 -+	static int vncfmt[] = { 0x40888, 0x20565, 0x10233, 0 };
  81.225 -+	char vncver[12];
  81.226 -+	int i;
  81.227 -+
  81.228 - 	struct vnc_client_init clientinit;
  81.229 - 	struct vnc_server_init serverinit;
  81.230 - 	struct vnc_client_pixelfmt pixfmt_cmd;
  81.231 - 	int connstat = VNC_CONN_FAILED;
  81.232 - 
  81.233 --	write(fd, vncver, 12);
  81.234 -+	write(fd, "RFB 003.003\n", 12);
  81.235 - 	read(fd, vncver, 12);
  81.236 - 
  81.237 - 	read(fd, &connstat, sizeof(connstat));
  81.238 -@@ -88,68 +94,78 @@
  81.239 - 	write(fd, &clientinit, sizeof(clientinit));
  81.240 - 	read(fd, &serverinit, sizeof(serverinit));
  81.241 - 
  81.242 --	if (fb_init())
  81.243 --		return -1;
  81.244 --	if (FBM_BPP(fb_mode()) != sizeof(fbval_t)) {
  81.245 --		fprintf(stderr, "fbvnc: fbval_t doesn't match fb depth\n");
  81.246 --		exit(1);
  81.247 --	}
  81.248 --	cols = MIN(ntohs(serverinit.w), fb_cols());
  81.249 --	rows = MIN(ntohs(serverinit.h), fb_rows());
  81.250 -+	i = fb_init();
  81.251 -+	if (i)
  81.252 -+		return -1 - i;
  81.253 -+	srv_cols = ntohs(serverinit.w);
  81.254 -+	srv_rows = ntohs(serverinit.h);
  81.255 -+	cols = MIN(srv_cols, fb_cols());
  81.256 -+	rows = MIN(srv_rows, fb_rows());
  81.257 - 	mr = rows / 2;
  81.258 - 	mc = cols / 2;
  81.259 -+	or = oc = 0;
  81.260 - 
  81.261 - 	read(fd, buf, ntohl(serverinit.len));
  81.262 - 	pixfmt_cmd.type = VNC_CLIENT_PIXFMT;
  81.263 --	pixfmt_cmd.format.bpp = 8;
  81.264 --	pixfmt_cmd.format.depth = 8;
  81.265 - 	pixfmt_cmd.format.bigendian = 0;
  81.266 - 	pixfmt_cmd.format.truecolor = 1;
  81.267 - 
  81.268 --	pixfmt_cmd.format.rmax = htons(3);
  81.269 --	pixfmt_cmd.format.gmax = htons(7);
  81.270 --	pixfmt_cmd.format.bmax = htons(7);
  81.271 --	pixfmt_cmd.format.rshl = 0;
  81.272 --	pixfmt_cmd.format.gshl = 2;
  81.273 --	pixfmt_cmd.format.bshl = 5;
  81.274 -+	if (bpp < 1)
  81.275 -+	  	bpp = FBM_BPP(fb_mode());
  81.276 -+	if (bpp >= 3)
  81.277 -+		bpp = 4;
  81.278 -+	for (i = 0; bpp <= FBM_BPP(vncfmt[i]); i++)
  81.279 -+		vnc_mode = vncfmt[i];
  81.280 -+	bpp = FBM_BPP(vnc_mode);
  81.281 -+	pixfmt_cmd.format.bpp =
  81.282 -+	pixfmt_cmd.format.depth = bpp << 3;
  81.283 - 
  81.284 -+	fill_rgb_conv(FBM_COLORS(vnc_mode), &format);
  81.285 -+	pixfmt_cmd.format.rmax = htons(format.rmax);
  81.286 -+	pixfmt_cmd.format.gmax = htons(format.gmax);
  81.287 -+	pixfmt_cmd.format.bmax = htons(format.bmax);
  81.288 -+	pixfmt_cmd.format.rshl = format.rshl;
  81.289 -+	pixfmt_cmd.format.gshl = format.gshl;
  81.290 -+	pixfmt_cmd.format.bshl = 0;
  81.291 - 	write(fd, &pixfmt_cmd, sizeof(pixfmt_cmd));
  81.292 - 	return fd;
  81.293 - }
  81.294 - 
  81.295 --static int vnc_free(void)
  81.296 -+static void vnc_free(void)
  81.297 - {
  81.298 - 	fb_free();
  81.299 --	return 0;
  81.300 - }
  81.301 - 
  81.302 --static int vnc_refresh(int fd, int inc)
  81.303 -+static void vnc_refresh(int fd, int inc)
  81.304 - {
  81.305 - 	struct vnc_client_fbup fbup_req;
  81.306 - 	fbup_req.type = VNC_CLIENT_FBUP;
  81.307 - 	fbup_req.inc = inc;
  81.308 --	fbup_req.x = htons(0);
  81.309 --	fbup_req.y = htons(0);
  81.310 --	fbup_req.w = htons(cols);
  81.311 --	fbup_req.h = htons(rows);
  81.312 -+	fbup_req.x = htons(oc);
  81.313 -+	fbup_req.y = htons(or);
  81.314 -+	fbup_req.w = htons(oc + cols);
  81.315 -+	fbup_req.h = htons(or + rows);
  81.316 - 	write(fd, &fbup_req, sizeof(fbup_req));
  81.317 --	return 0;
  81.318 - }
  81.319 - 
  81.320 --static void drawfb(char *s, int x, int y, int w, int h)
  81.321 -+static void drawfb(char *s, int x, int y, int w)
  81.322 - {
  81.323 --	fbval_t slice[1 << 14];
  81.324 --	int i, j;
  81.325 --	for (i = 0; i < h; i++) {
  81.326 --		for (j = 0; j < w; j++) {
  81.327 --			int c = *(unsigned char *) &s[i * w + j];
  81.328 --			int r = (c & 0x3) << 6;
  81.329 --			int g = ((c >> 2) & 0x7) << 5;
  81.330 --			int b = ((c >> 5) & 0x7) << 5;
  81.331 --			slice[j] = FB_VAL(r, g, b);
  81.332 -+	int mode = fb_mode();
  81.333 -+	if (mode != vnc_mode) {
  81.334 -+		fbval_t slice[MAXRES];
  81.335 -+		unsigned char *byte = (unsigned char *) slice;
  81.336 -+		int j;
  81.337 -+		int fb_bpp = FBM_BPP(mode);
  81.338 -+		for (j = 0; j < w; j++, byte += fb_bpp, s += bpp) {
  81.339 -+			fbval_t c = * (fbval_t *) s;
  81.340 -+			int r = ((c >> format.rshl) & format.rmax) << format.rskp;
  81.341 -+			int g = ((c >> format.gshl) & format.gmax) << format.gskp;
  81.342 -+			int b = (c & format.bmax) << format.bskp;
  81.343 -+			* (fbval_t *) byte = FB_VAL(r, g, b);
  81.344 - 		}
  81.345 --		fb_set(y + i, x, slice, w);
  81.346 -+		s = (void *) slice;
  81.347 - 	}
  81.348 -+	fb_set(y, x, s, w);
  81.349 - }
  81.350 - 
  81.351 - static void xread(int fd, void *buf, int len)
  81.352 -@@ -159,54 +175,84 @@
  81.353 - 	while (nr < len && (n = read(fd, buf + nr, len - nr)) > 0)
  81.354 - 		nr += n;
  81.355 - 	if (nr < len) {
  81.356 --		printf("partial vnc read!\n");
  81.357 --		exit(1);
  81.358 -+		fprintf(stderr,"partial vnc read!\n");
  81.359 -+		exit(99);
  81.360 - 	}
  81.361 - }
  81.362 - 
  81.363 -+static void skip(int fd, int len)
  81.364 -+{
  81.365 -+	int n;
  81.366 -+	while (len > 0 && (n = read(fd, buf, MIN(len, sizeof(buf)))) > 0)
  81.367 -+		len -= n;
  81.368 -+}
  81.369 -+
  81.370 - static int vnc_event(int fd)
  81.371 - {
  81.372 - 	struct vnc_rect uprect;
  81.373 --	char msg[1 << 12];
  81.374 --	struct vnc_server_fbup *fbup = (void *) msg;
  81.375 --	struct vnc_server_cuttext *cuttext = (void *) msg;
  81.376 --	struct vnc_server_colormap *colormap = (void *) msg;
  81.377 --	int j;
  81.378 --	int n;
  81.379 -+	union {
  81.380 -+		struct vnc_server_fbup fbup;
  81.381 -+		struct vnc_server_cuttext cuttext;
  81.382 -+		struct vnc_server_colormap colormap;
  81.383 -+	} msg;
  81.384 -+	int j, n;
  81.385 - 
  81.386 --	if (read(fd, msg, 1) != 1)
  81.387 -+	if (read(fd, &msg.fbup.type, 1) != 1)
  81.388 - 		return -1;
  81.389 --	switch (msg[0]) {
  81.390 -+	switch (msg.fbup.type) {
  81.391 - 	case VNC_SERVER_FBUP:
  81.392 --		xread(fd, msg + 1, sizeof(*fbup) - 1);
  81.393 --		n = ntohs(fbup->n);
  81.394 -+		xread(fd, &msg.fbup.pad, sizeof(msg.fbup) - 1);
  81.395 -+		n = ntohs(msg.fbup.n);
  81.396 - 		for (j = 0; j < n; j++) {
  81.397 --			int x, y, w, h;
  81.398 -+			int x, y, w, h, l, i;
  81.399 - 			xread(fd, &uprect, sizeof(uprect));
  81.400 -+			if (uprect.enc != 0) {
  81.401 -+				fprintf(stderr,"Encoding not RAW: %d\n",
  81.402 -+					ntohl(uprect.enc));
  81.403 -+				return -1;
  81.404 -+			}
  81.405 - 			x = ntohs(uprect.x);
  81.406 - 			y = ntohs(uprect.y);
  81.407 - 			w = ntohs(uprect.w);
  81.408 - 			h = ntohs(uprect.h);
  81.409 --			if (x >= cols || x + w > cols)
  81.410 --				return -1;
  81.411 --			if (y >= rows || y + h > rows)
  81.412 --				return -1;
  81.413 --			xread(fd, buf, w * h);
  81.414 --			drawfb(buf, x, y, w, h);
  81.415 -+			x -= oc;
  81.416 -+			y -= or;
  81.417 -+			i = 0;
  81.418 -+			l = MIN(w, cols - x);
  81.419 -+			if (x < 0) {
  81.420 -+				l = MIN(w + x, cols);
  81.421 -+				i = MIN(w, -x);
  81.422 -+				x = 0;
  81.423 -+			}
  81.424 -+			if (l < 0)
  81.425 -+				l = 0;
  81.426 -+			for (; h--; y++) {
  81.427 -+				int n = l;
  81.428 -+				int xj = x;
  81.429 -+				skip(fd, i * bpp);
  81.430 -+				while (n > 0) {
  81.431 -+					int j = MIN(n, MAXPIX);
  81.432 -+					xread(fd, buf, j * bpp);
  81.433 -+					if (y >= 0 && y < rows)
  81.434 -+						drawfb(buf, xj, y, j);
  81.435 -+					xj += j; n -= j;
  81.436 -+				}
  81.437 -+				skip(fd, (w - l - i) * bpp);
  81.438 -+			}
  81.439 - 		}
  81.440 - 		break;
  81.441 - 	case VNC_SERVER_BELL:
  81.442 - 		break;
  81.443 - 	case VNC_SERVER_CUTTEXT:
  81.444 --		xread(fd, msg + 1, sizeof(*cuttext) - 1);
  81.445 --		xread(fd, buf, ntohl(cuttext->len));
  81.446 -+		xread(fd, &msg.cuttext.pad1, sizeof(msg.cuttext) - 1);
  81.447 -+		skip(fd, ntohl(msg.cuttext.len));
  81.448 - 		break;
  81.449 - 	case VNC_SERVER_COLORMAP:
  81.450 --		xread(fd, msg + 1, sizeof(*colormap) - 1);
  81.451 --		xread(fd, buf, ntohs(colormap->n) * 3 * 2);
  81.452 -+		xread(fd, &msg.colormap.pad, sizeof(msg.colormap) - 1);
  81.453 -+		skip(fd, ntohs(msg.colormap.n) * 3 * 2);
  81.454 - 		break;
  81.455 - 	default:
  81.456 --		fprintf(stderr, "unknown vnc msg: %d\n", msg[0]);
  81.457 -+		fprintf(stderr, "unknown vnc msg: %d\n", msg.fbup.type);
  81.458 - 		return -1;
  81.459 - 	}
  81.460 - 	return 0;
  81.461 -@@ -217,12 +263,31 @@
  81.462 - 	char ie[3];
  81.463 - 	struct vnc_client_ratevent me = {VNC_CLIENT_RATEVENT};
  81.464 - 	int mask = 0;
  81.465 -+	int refresh = 2;
  81.466 - 	if (read(ratfd, &ie, sizeof(ie)) != 3)
  81.467 - 		return -1;
  81.468 - 	mc += ie[1];
  81.469 - 	mr -= ie[2];
  81.470 --	mc = MAX(0, MIN(cols - 1, mc));
  81.471 --	mr = MAX(0, MIN(rows - 1, mr));
  81.472 -+	if (mc < oc) {
  81.473 -+		if ((oc -= cols / 5) < 0)
  81.474 -+			oc = 0;
  81.475 -+	}
  81.476 -+	else if (mc >= oc + cols && oc + cols < srv_cols) {
  81.477 -+		if ((oc += cols / 5) > srv_cols - cols)
  81.478 -+			oc = srv_cols - cols;
  81.479 -+	}
  81.480 -+	else refresh--;
  81.481 -+	if (mr < or) {
  81.482 -+		if ((or -= rows / 5) < 0)
  81.483 -+			or = 0;
  81.484 -+	}
  81.485 -+	else if (mr >= or + rows && or + rows < srv_rows) {
  81.486 -+		if ((or += rows / 5) > srv_rows - rows)
  81.487 -+			or = srv_rows - rows;
  81.488 -+	}
  81.489 -+	else refresh--;
  81.490 -+	mc = MAX(oc, MIN(oc + cols - 1, mc));
  81.491 -+	mr = MAX(or, MIN(or + rows - 1, mr));
  81.492 - 	if (ie[0] & 0x01)
  81.493 - 		mask |= VNC_BUTTON1_MASK;
  81.494 - 	if (ie[0] & 0x04)
  81.495 -@@ -233,6 +298,8 @@
  81.496 - 	me.x = htons(mc);
  81.497 - 	me.mask = mask;
  81.498 - 	write(fd, &me, sizeof(me));
  81.499 -+	if (refresh)
  81.500 -+		vnc_refresh(fd, 0);
  81.501 - 	return 0;
  81.502 - }
  81.503 - 
  81.504 -@@ -292,12 +359,11 @@
  81.505 - 			k = 0xff0d;
  81.506 - 			break;
  81.507 - 		case 0x0c:	/* ^L: redraw */
  81.508 --			if (vnc_refresh(fd, 0))
  81.509 --				return -1;
  81.510 -+			vnc_refresh(fd, 0);
  81.511 - 		default:
  81.512 - 			k = (unsigned char) key[i];
  81.513 - 		}
  81.514 --		if (k >= 'A' && k <= 'Z' || strchr(":\"<>?{}|+_()*&^%$#@!~", k))
  81.515 -+		if ((k >= 'A' && k <= 'Z') || strchr(":\"<>?{}|+_()*&^%$#@!~", k))
  81.516 - 			mod[nmod++] = 0xffe1;
  81.517 - 		if (k >= 1 && k <= 26) {
  81.518 - 			k = 'a' + k - 1;
  81.519 -@@ -339,40 +405,42 @@
  81.520 - 	write(STDIN_FILENO, show, strlen(show));
  81.521 - }
  81.522 - 
  81.523 --static void mainloop(int vnc_fd, int kbd_fd, int rat_fd)
  81.524 -+static int mainloop(int vnc_fd, int kbd_fd, int rat_fd)
  81.525 - {
  81.526 - 	struct pollfd ufds[3];
  81.527 - 	int pending = 0;
  81.528 - 	int err;
  81.529 - 	ufds[0].fd = kbd_fd;
  81.530 --	ufds[0].events = POLLIN;
  81.531 - 	ufds[1].fd = vnc_fd;
  81.532 --	ufds[1].events = POLLIN;
  81.533 - 	ufds[2].fd = rat_fd;
  81.534 -+	ufds[0].events =
  81.535 -+	ufds[1].events =
  81.536 - 	ufds[2].events = POLLIN;
  81.537 --	if (vnc_refresh(vnc_fd, 0))
  81.538 --		return;
  81.539 -+	vnc_refresh(vnc_fd, 0);
  81.540 - 	while (1) {
  81.541 - 		err = poll(ufds, 3, 500);
  81.542 - 		if (err == -1 && errno != EINTR)
  81.543 - 			break;
  81.544 - 		if (!err)
  81.545 - 			continue;
  81.546 -+		err = -2;
  81.547 - 		if (ufds[0].revents & POLLIN)
  81.548 - 			if (kbd_event(vnc_fd, kbd_fd) == -1)
  81.549 - 				break;
  81.550 -+		err--;
  81.551 - 		if (ufds[1].revents & POLLIN) {
  81.552 - 			if (vnc_event(vnc_fd) == -1)
  81.553 - 				break;
  81.554 - 			pending = 0;
  81.555 - 		}
  81.556 -+		err--;
  81.557 - 		if (ufds[2].revents & POLLIN)
  81.558 - 			if (rat_event(vnc_fd, rat_fd) == -1)
  81.559 - 				break;
  81.560 - 		if (!pending++)
  81.561 --			if (vnc_refresh(vnc_fd, 1))
  81.562 --				break;
  81.563 -+			vnc_refresh(vnc_fd, 1);
  81.564 - 	}
  81.565 -+	return err;
  81.566 - }
  81.567 - 
  81.568 - int main(int argc, char * argv[])
  81.569 -@@ -380,27 +448,38 @@
  81.570 - 	char *port = VNC_PORT;
  81.571 - 	char *host = "127.0.0.1";
  81.572 - 	struct termios ti;
  81.573 --	int vnc_fd, rat_fd;
  81.574 -+	int vnc_fd, rat_fd, status;
  81.575 -+	
  81.576 -+	if (argc < 2) {
  81.577 -+		fprintf(stderr, "Usage : fbvnc [-bpp bits] server [port]\n");
  81.578 -+		return 0;
  81.579 -+  	}
  81.580 -+  	if (*argv[1] == '-' && argc >= 3) {
  81.581 -+  		argc -= 2; argv += 2;
  81.582 -+  		bpp = atoi(argv[0]) >> 3;
  81.583 -+  	} 
  81.584 - 	if (argc >= 2)
  81.585 - 		host = argv[1];
  81.586 - 	if (argc >= 3)
  81.587 - 		port = argv[2];
  81.588 --	if ((vnc_fd = vnc_connect(host, port)) == -1) {
  81.589 --		fprintf(stderr, "could not connect!\n");
  81.590 -+	if ((vnc_fd = vnc_connect(host, port)) < 0) {
  81.591 -+		fprintf(stderr, "could not connect! %s %s : %d\n",
  81.592 -+			host,port,vnc_fd);
  81.593 - 		return 1;
  81.594 - 	}
  81.595 --	if (vnc_init(vnc_fd) == -1) {
  81.596 --		fprintf(stderr, "vnc init failed!\n");
  81.597 --		return 1;
  81.598 -+	status = vnc_init(vnc_fd);
  81.599 -+	if (status < 0) {
  81.600 -+		fprintf(stderr, "vnc init failed! %d\n", status);
  81.601 -+		return 2;
  81.602 - 	}
  81.603 - 	term_setup(&ti);
  81.604 - 	rat_fd = open("/dev/input/mice", O_RDONLY);
  81.605 - 
  81.606 --	mainloop(vnc_fd, 0, rat_fd);
  81.607 -+	status = mainloop(vnc_fd, 0, rat_fd);
  81.608 - 
  81.609 - 	term_cleanup(&ti);
  81.610 - 	vnc_free();
  81.611 - 	close(vnc_fd);
  81.612 - 	close(rat_fd);
  81.613 --	return 0;
  81.614 -+	return 2 - status;
  81.615 - }
    82.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    82.2 +++ b/fbvnc/stuff/patches/fbvnc.u	Thu May 10 21:12:00 2018 +0300
    82.3 @@ -0,0 +1,612 @@
    82.4 +--- draw.h
    82.5 ++++ draw.h
    82.6 +@@ -15,5 +15,11 @@
    82.7 + void fb_cmap(void);
    82.8 + 
    82.9 + /* helper functions */
   82.10 ++struct rgb_conv {
   82.11 ++	int rshl, gshl;
   82.12 ++	int rskp, gskp, bskp;
   82.13 ++	int rmax, gmax, bmax;
   82.14 ++};
   82.15 ++void fill_rgb_conv(int mode, struct rgb_conv *s);
   82.16 + void fb_set(int r, int c, void *mem, int len);
   82.17 + unsigned fb_val(int r, int g, int b);
   82.18 +--- draw.c
   82.19 ++++ draw.c
   82.20 +@@ -10,14 +10,13 @@
   82.21 + 
   82.22 + #define MIN(a, b)	((a) < (b) ? (a) : (b))
   82.23 + #define MAX(a, b)	((a) > (b) ? (a) : (b))
   82.24 +-#define NLEVELS		(1 << 8)
   82.25 ++#define NLEVELS		(1 << 16)
   82.26 + 
   82.27 + static int fd;
   82.28 + static void *fb;
   82.29 + static struct fb_var_screeninfo vinfo;
   82.30 + static struct fb_fix_screeninfo finfo;
   82.31 +-static int bpp;
   82.32 +-static int nr, ng, nb;
   82.33 ++static int bytes_per_pixel;
   82.34 + 
   82.35 + static int fb_len(void)
   82.36 + {
   82.37 +@@ -28,10 +27,12 @@
   82.38 + {
   82.39 + 	static unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS];
   82.40 + 	struct fb_cmap cmap;
   82.41 ++
   82.42 + 	if (finfo.visual == FB_VISUAL_TRUECOLOR)
   82.43 + 		return;
   82.44 ++
   82.45 + 	cmap.start = 0;
   82.46 +-	cmap.len = MAX(nr, MAX(ng, nb));
   82.47 ++	cmap.len = NLEVELS;
   82.48 + 	cmap.red = red;
   82.49 + 	cmap.green = green;
   82.50 + 	cmap.blue = blue;
   82.51 +@@ -41,24 +42,39 @@
   82.52 + 
   82.53 + void fb_cmap(void)
   82.54 + {
   82.55 +-	unsigned short red[NLEVELS], green[NLEVELS], blue[NLEVELS];
   82.56 ++	struct fb_bitfield *color[3] = {
   82.57 ++		&vinfo.blue, &vinfo.green, &vinfo.red
   82.58 ++	};
   82.59 ++	int eye_sensibility[3] = { 2, 0, 1 }; // higher=red, blue, lower=green
   82.60 + 	struct fb_cmap cmap;
   82.61 +-	int i;
   82.62 ++	unsigned short map[3][NLEVELS];
   82.63 ++	int i, j, n, offset;
   82.64 ++
   82.65 + 	if (finfo.visual == FB_VISUAL_TRUECOLOR)
   82.66 + 		return;
   82.67 + 
   82.68 +-	for (i = 0; i < nr; i++)
   82.69 +-		red[i] = (65535 / (nr - 1)) * i;
   82.70 +-	for (i = 0; i < ng; i++)
   82.71 +-		green[i] = (65535 / (ng - 1)) * i;
   82.72 +-	for (i = 0; i < nb; i++)
   82.73 +-		blue[i] = (65535 / (nb - 1)) * i;
   82.74 +-
   82.75 ++	for (i = 0, n = vinfo.bits_per_pixel; i < 3; i++) {
   82.76 ++		n -= color[eye_sensibility[i]]->length = n / (3 - i);
   82.77 ++	}
   82.78 ++	n = (1 << vinfo.bits_per_pixel);
   82.79 ++	if (n > NLEVELS)
   82.80 ++		n = NLEVELS;
   82.81 ++	for (i = offset = 0; i < 3; i++) {
   82.82 ++		int length = color[i]->length;
   82.83 ++		color[i]->offset = offset;
   82.84 ++		for (j = 0; j < n; j++) {
   82.85 ++			int k = (j >> offset) << (16 - length);
   82.86 ++			if (k == (0xFFFF << (16 - length)))
   82.87 ++				k = 0xFFFF;
   82.88 ++			map[i][j] = k;
   82.89 ++		}
   82.90 ++		offset += length;
   82.91 ++	}
   82.92 + 	cmap.start = 0;
   82.93 +-	cmap.len = MAX(nr, MAX(ng, nb));
   82.94 +-	cmap.red = red;
   82.95 +-	cmap.green = green;
   82.96 +-	cmap.blue = blue;
   82.97 ++	cmap.len = n;
   82.98 ++	cmap.red = map[2];
   82.99 ++	cmap.green = map[1];
  82.100 ++	cmap.blue = map[0];
  82.101 + 	cmap.transp = NULL;
  82.102 + 
  82.103 + 	ioctl(fd, FBIOPUTCMAP, &cmap);
  82.104 +@@ -66,25 +82,26 @@
  82.105 + 
  82.106 + unsigned fb_mode(void)
  82.107 + {
  82.108 +-	return (bpp << 16) | (vinfo.red.length << 8) |
  82.109 ++	return (bytes_per_pixel << 16) | (vinfo.red.length << 8) |
  82.110 + 		(vinfo.green.length << 4) | (vinfo.blue.length);
  82.111 + }
  82.112 + 
  82.113 + int fb_init(void)
  82.114 + {
  82.115 ++	int err = 1;
  82.116 + 	fd = open(FBDEV_PATH, O_RDWR);
  82.117 + 	if (fd == -1)
  82.118 + 		goto failed;
  82.119 ++	err++;
  82.120 + 	if (ioctl(fd, FBIOGET_VSCREENINFO, &vinfo) == -1)
  82.121 + 		goto failed;
  82.122 ++	err++;
  82.123 + 	if (ioctl(fd, FBIOGET_FSCREENINFO, &finfo) == -1)
  82.124 + 		goto failed;
  82.125 + 	fcntl(fd, F_SETFD, fcntl(fd, F_GETFD) | FD_CLOEXEC);
  82.126 +-	bpp = (vinfo.bits_per_pixel + 7) >> 3;
  82.127 +-	nr = 1 << vinfo.red.length;
  82.128 +-	ng = 1 << vinfo.blue.length;
  82.129 +-	nb = 1 << vinfo.green.length;
  82.130 ++	bytes_per_pixel = (vinfo.bits_per_pixel + 7) >> 3;
  82.131 + 	fb = mmap(NULL, fb_len(), PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
  82.132 ++	err++;
  82.133 + 	if (fb == MAP_FAILED)
  82.134 + 		goto failed;
  82.135 + 	fb_cmap_save(1);
  82.136 +@@ -93,7 +110,7 @@
  82.137 + failed:
  82.138 + 	perror("fb_init()");
  82.139 + 	close(fd);
  82.140 +-	return 1;
  82.141 ++	return err;
  82.142 + }
  82.143 + 
  82.144 + void fb_free(void)
  82.145 +@@ -120,19 +137,30 @@
  82.146 + 
  82.147 + void fb_set(int r, int c, void *mem, int len)
  82.148 + {
  82.149 +-	memcpy(fb_mem(r) + (c + vinfo.xoffset) * bpp, mem, len * bpp);
  82.150 ++	memcpy(fb_mem(r) + (c + vinfo.xoffset) * bytes_per_pixel,
  82.151 ++		mem, len * bytes_per_pixel);
  82.152 + }
  82.153 + 
  82.154 ++void fill_rgb_conv(int mode, struct rgb_conv *s)
  82.155 ++{
  82.156 ++	int bits;
  82.157 ++
  82.158 ++	bits = mode & 0xF;  mode >>= 4;
  82.159 ++	s->rshl = s->gshl = bits;
  82.160 ++	s->bskp = 8 - bits; s->bmax = (1 << bits) -1;
  82.161 ++	bits = mode & 0xF;  mode >>= 4;
  82.162 ++	s->rshl += bits;
  82.163 ++	s->gskp = 8 - bits; s->gmax = (1 << bits) -1;
  82.164 ++	bits = mode & 0xF;
  82.165 ++	s->rskp = 8 - bits; s->rmax = (1 << bits) -1;
  82.166 ++}
  82.167 ++
  82.168 + unsigned fb_val(int r, int g, int b)
  82.169 + {
  82.170 +-	switch (fb_mode() & 0x0fff) {
  82.171 +-	default:
  82.172 +-		fprintf(stderr, "fb_val: unknown fb_mode()\n");
  82.173 +-	case 0x0888:
  82.174 +-		return (r << 16) | (g << 8) | b;
  82.175 +-	case 0x0565:
  82.176 +-		return ((r >> 3) << 11) | ((g >> 2) << 5) | (b >> 3);
  82.177 +-	case 0x0233:
  82.178 +-		return ((r >> 6) << 6) | ((g >> 5) << 3) | (b >> 5);
  82.179 +-	}
  82.180 ++	static struct rgb_conv c;
  82.181 ++	
  82.182 ++	if (c.rshl == 0)
  82.183 ++		fill_rgb_conv(fb_mode(), &c);
  82.184 ++	return ((r >> c.rskp) << c.rshl) | ((g >> c.gskp) << c.gshl) 
  82.185 ++					 | (b >> c.bskp);
  82.186 + }
  82.187 +--- fbvnc.c
  82.188 ++++ fbvnc.c
  82.189 +@@ -36,13 +36,15 @@
  82.190 + 
  82.191 + #define VNC_PORT		"5900"
  82.192 + 
  82.193 +-#define MAXRES			(1 << 21)
  82.194 +-#define MIN(a, b)		((a) < (b) ? (a) : (b))
  82.195 ++#define MAXRES			(1 << 12)
  82.196 + 
  82.197 + static int cols, rows;
  82.198 ++static int srv_cols, srv_rows;
  82.199 ++static int or, oc;
  82.200 + static int mr, mc;		/* mouse position */
  82.201 + 
  82.202 + static char buf[MAXRES];
  82.203 ++#define MAXPIX		(MAXRES/sizeof(fbval_t))
  82.204 + 
  82.205 + static int vnc_connect(char *addr, char *port)
  82.206 + {
  82.207 +@@ -61,22 +63,26 @@
  82.208 + 
  82.209 + 	if (connect(fd, addrinfo->ai_addr, addrinfo->ai_addrlen) == -1) {
  82.210 + 		close(fd);
  82.211 +-		freeaddrinfo(addrinfo);
  82.212 +-		return -1;
  82.213 ++		fd = -2;
  82.214 + 	}
  82.215 + 	freeaddrinfo(addrinfo);
  82.216 + 	return fd;
  82.217 + }
  82.218 + 
  82.219 ++static int bpp, vnc_mode;
  82.220 ++static struct rgb_conv format;
  82.221 + static int vnc_init(int fd)
  82.222 + {
  82.223 +-	char vncver[] = "RFB 003.003\n";
  82.224 ++	static int vncfmt[] = { 0x40888, 0x20565, 0x10233, 0 };
  82.225 ++	char vncver[12];
  82.226 ++	int i;
  82.227 ++
  82.228 + 	struct vnc_client_init clientinit;
  82.229 + 	struct vnc_server_init serverinit;
  82.230 + 	struct vnc_client_pixelfmt pixfmt_cmd;
  82.231 + 	int connstat = VNC_CONN_FAILED;
  82.232 + 
  82.233 +-	write(fd, vncver, 12);
  82.234 ++	write(fd, "RFB 003.003\n", 12);
  82.235 + 	read(fd, vncver, 12);
  82.236 + 
  82.237 + 	read(fd, &connstat, sizeof(connstat));
  82.238 +@@ -88,68 +94,78 @@
  82.239 + 	write(fd, &clientinit, sizeof(clientinit));
  82.240 + 	read(fd, &serverinit, sizeof(serverinit));
  82.241 + 
  82.242 +-	if (fb_init())
  82.243 +-		return -1;
  82.244 +-	if (FBM_BPP(fb_mode()) != sizeof(fbval_t)) {
  82.245 +-		fprintf(stderr, "fbvnc: fbval_t doesn't match fb depth\n");
  82.246 +-		exit(1);
  82.247 +-	}
  82.248 +-	cols = MIN(ntohs(serverinit.w), fb_cols());
  82.249 +-	rows = MIN(ntohs(serverinit.h), fb_rows());
  82.250 ++	i = fb_init();
  82.251 ++	if (i)
  82.252 ++		return -1 - i;
  82.253 ++	srv_cols = ntohs(serverinit.w);
  82.254 ++	srv_rows = ntohs(serverinit.h);
  82.255 ++	cols = MIN(srv_cols, fb_cols());
  82.256 ++	rows = MIN(srv_rows, fb_rows());
  82.257 + 	mr = rows / 2;
  82.258 + 	mc = cols / 2;
  82.259 ++	or = oc = 0;
  82.260 + 
  82.261 + 	read(fd, buf, ntohl(serverinit.len));
  82.262 + 	pixfmt_cmd.type = VNC_CLIENT_PIXFMT;
  82.263 +-	pixfmt_cmd.format.bpp = 8;
  82.264 +-	pixfmt_cmd.format.depth = 8;
  82.265 + 	pixfmt_cmd.format.bigendian = 0;
  82.266 + 	pixfmt_cmd.format.truecolor = 1;
  82.267 + 
  82.268 +-	pixfmt_cmd.format.rmax = htons(3);
  82.269 +-	pixfmt_cmd.format.gmax = htons(7);
  82.270 +-	pixfmt_cmd.format.bmax = htons(7);
  82.271 +-	pixfmt_cmd.format.rshl = 0;
  82.272 +-	pixfmt_cmd.format.gshl = 2;
  82.273 +-	pixfmt_cmd.format.bshl = 5;
  82.274 ++	if (bpp < 1)
  82.275 ++	  	bpp = FBM_BPP(fb_mode());
  82.276 ++	if (bpp >= 3)
  82.277 ++		bpp = 4;
  82.278 ++	for (i = 0; bpp <= FBM_BPP(vncfmt[i]); i++)
  82.279 ++		vnc_mode = vncfmt[i];
  82.280 ++	bpp = FBM_BPP(vnc_mode);
  82.281 ++	pixfmt_cmd.format.bpp =
  82.282 ++	pixfmt_cmd.format.depth = bpp << 3;
  82.283 + 
  82.284 ++	fill_rgb_conv(FBM_COLORS(vnc_mode), &format);
  82.285 ++	pixfmt_cmd.format.rmax = htons(format.rmax);
  82.286 ++	pixfmt_cmd.format.gmax = htons(format.gmax);
  82.287 ++	pixfmt_cmd.format.bmax = htons(format.bmax);
  82.288 ++	pixfmt_cmd.format.rshl = format.rshl;
  82.289 ++	pixfmt_cmd.format.gshl = format.gshl;
  82.290 ++	pixfmt_cmd.format.bshl = 0;
  82.291 + 	write(fd, &pixfmt_cmd, sizeof(pixfmt_cmd));
  82.292 + 	return fd;
  82.293 + }
  82.294 + 
  82.295 +-static int vnc_free(void)
  82.296 ++static void vnc_free(void)
  82.297 + {
  82.298 + 	fb_free();
  82.299 +-	return 0;
  82.300 + }
  82.301 + 
  82.302 +-static int vnc_refresh(int fd, int inc)
  82.303 ++static void vnc_refresh(int fd, int inc)
  82.304 + {
  82.305 + 	struct vnc_client_fbup fbup_req;
  82.306 + 	fbup_req.type = VNC_CLIENT_FBUP;
  82.307 + 	fbup_req.inc = inc;
  82.308 +-	fbup_req.x = htons(0);
  82.309 +-	fbup_req.y = htons(0);
  82.310 +-	fbup_req.w = htons(cols);
  82.311 +-	fbup_req.h = htons(rows);
  82.312 ++	fbup_req.x = htons(oc);
  82.313 ++	fbup_req.y = htons(or);
  82.314 ++	fbup_req.w = htons(oc + cols);
  82.315 ++	fbup_req.h = htons(or + rows);
  82.316 + 	write(fd, &fbup_req, sizeof(fbup_req));
  82.317 +-	return 0;
  82.318 + }
  82.319 + 
  82.320 +-static void drawfb(char *s, int x, int y, int w, int h)
  82.321 ++static void drawfb(char *s, int x, int y, int w)
  82.322 + {
  82.323 +-	fbval_t slice[1 << 14];
  82.324 +-	int i, j;
  82.325 +-	for (i = 0; i < h; i++) {
  82.326 +-		for (j = 0; j < w; j++) {
  82.327 +-			int c = *(unsigned char *) &s[i * w + j];
  82.328 +-			int r = (c & 0x3) << 6;
  82.329 +-			int g = ((c >> 2) & 0x7) << 5;
  82.330 +-			int b = ((c >> 5) & 0x7) << 5;
  82.331 +-			slice[j] = FB_VAL(r, g, b);
  82.332 ++	int mode = fb_mode();
  82.333 ++	if (mode != vnc_mode) {
  82.334 ++		fbval_t slice[MAXRES];
  82.335 ++		unsigned char *byte = (unsigned char *) slice;
  82.336 ++		int j;
  82.337 ++		int fb_bpp = FBM_BPP(mode);
  82.338 ++		for (j = 0; j < w; j++, byte += fb_bpp, s += bpp) {
  82.339 ++			fbval_t c = * (fbval_t *) s;
  82.340 ++			int r = ((c >> format.rshl) & format.rmax) << format.rskp;
  82.341 ++			int g = ((c >> format.gshl) & format.gmax) << format.gskp;
  82.342 ++			int b = (c & format.bmax) << format.bskp;
  82.343 ++			* (fbval_t *) byte = FB_VAL(r, g, b);
  82.344 + 		}
  82.345 +-		fb_set(y + i, x, slice, w);
  82.346 ++		s = (void *) slice;
  82.347 + 	}
  82.348 ++	fb_set(y, x, s, w);
  82.349 + }
  82.350 + 
  82.351 + static void xread(int fd, void *buf, int len)
  82.352 +@@ -159,54 +175,84 @@
  82.353 + 	while (nr < len && (n = read(fd, buf + nr, len - nr)) > 0)
  82.354 + 		nr += n;
  82.355 + 	if (nr < len) {
  82.356 +-		printf("partial vnc read!\n");
  82.357 +-		exit(1);
  82.358 ++		fprintf(stderr,"partial vnc read!\n");
  82.359 ++		exit(99);
  82.360 + 	}
  82.361 + }
  82.362 + 
  82.363 ++static void skip(int fd, int len)
  82.364 ++{
  82.365 ++	int n;
  82.366 ++	while (len > 0 && (n = read(fd, buf, MIN(len, sizeof(buf)))) > 0)
  82.367 ++		len -= n;
  82.368 ++}
  82.369 ++
  82.370 + static int vnc_event(int fd)
  82.371 + {
  82.372 + 	struct vnc_rect uprect;
  82.373 +-	char msg[1 << 12];
  82.374 +-	struct vnc_server_fbup *fbup = (void *) msg;
  82.375 +-	struct vnc_server_cuttext *cuttext = (void *) msg;
  82.376 +-	struct vnc_server_colormap *colormap = (void *) msg;
  82.377 +-	int j;
  82.378 +-	int n;
  82.379 ++	union {
  82.380 ++		struct vnc_server_fbup fbup;
  82.381 ++		struct vnc_server_cuttext cuttext;
  82.382 ++		struct vnc_server_colormap colormap;
  82.383 ++	} msg;
  82.384 ++	int j, n;
  82.385 + 
  82.386 +-	if (read(fd, msg, 1) != 1)
  82.387 ++	if (read(fd, &msg.fbup.type, 1) != 1)
  82.388 + 		return -1;
  82.389 +-	switch (msg[0]) {
  82.390 ++	switch (msg.fbup.type) {
  82.391 + 	case VNC_SERVER_FBUP:
  82.392 +-		xread(fd, msg + 1, sizeof(*fbup) - 1);
  82.393 +-		n = ntohs(fbup->n);
  82.394 ++		xread(fd, &msg.fbup.pad, sizeof(msg.fbup) - 1);
  82.395 ++		n = ntohs(msg.fbup.n);
  82.396 + 		for (j = 0; j < n; j++) {
  82.397 +-			int x, y, w, h;
  82.398 ++			int x, y, w, h, l, i;
  82.399 + 			xread(fd, &uprect, sizeof(uprect));
  82.400 ++			if (uprect.enc != 0) {
  82.401 ++				fprintf(stderr,"Encoding not RAW: %d\n",
  82.402 ++					ntohl(uprect.enc));
  82.403 ++				return -1;
  82.404 ++			}
  82.405 + 			x = ntohs(uprect.x);
  82.406 + 			y = ntohs(uprect.y);
  82.407 + 			w = ntohs(uprect.w);
  82.408 + 			h = ntohs(uprect.h);
  82.409 +-			if (x >= cols || x + w > cols)
  82.410 +-				return -1;
  82.411 +-			if (y >= rows || y + h > rows)
  82.412 +-				return -1;
  82.413 +-			xread(fd, buf, w * h);
  82.414 +-			drawfb(buf, x, y, w, h);
  82.415 ++			x -= oc;
  82.416 ++			y -= or;
  82.417 ++			i = 0;
  82.418 ++			l = MIN(w, cols - x);
  82.419 ++			if (x < 0) {
  82.420 ++				l = MIN(w + x, cols);
  82.421 ++				i = MIN(w, -x);
  82.422 ++				x = 0;
  82.423 ++			}
  82.424 ++			if (l < 0)
  82.425 ++				l = 0;
  82.426 ++			for (; h--; y++) {
  82.427 ++				int n = l;
  82.428 ++				int xj = x;
  82.429 ++				skip(fd, i * bpp);
  82.430 ++				while (n > 0) {
  82.431 ++					int j = MIN(n, MAXPIX);
  82.432 ++					xread(fd, buf, j * bpp);
  82.433 ++					if (y >= 0 && y < rows)
  82.434 ++						drawfb(buf, xj, y, j);
  82.435 ++					xj += j; n -= j;
  82.436 ++				}
  82.437 ++				skip(fd, (w - l - i) * bpp);
  82.438 ++			}
  82.439 + 		}
  82.440 + 		break;
  82.441 + 	case VNC_SERVER_BELL:
  82.442 + 		break;
  82.443 + 	case VNC_SERVER_CUTTEXT:
  82.444 +-		xread(fd, msg + 1, sizeof(*cuttext) - 1);
  82.445 +-		xread(fd, buf, ntohl(cuttext->len));
  82.446 ++		xread(fd, &msg.cuttext.pad1, sizeof(msg.cuttext) - 1);
  82.447 ++		skip(fd, ntohl(msg.cuttext.len));
  82.448 + 		break;
  82.449 + 	case VNC_SERVER_COLORMAP:
  82.450 +-		xread(fd, msg + 1, sizeof(*colormap) - 1);
  82.451 +-		xread(fd, buf, ntohs(colormap->n) * 3 * 2);
  82.452 ++		xread(fd, &msg.colormap.pad, sizeof(msg.colormap) - 1);
  82.453 ++		skip(fd, ntohs(msg.colormap.n) * 3 * 2);
  82.454 + 		break;
  82.455 + 	default:
  82.456 +-		fprintf(stderr, "unknown vnc msg: %d\n", msg[0]);
  82.457 ++		fprintf(stderr, "unknown vnc msg: %d\n", msg.fbup.type);
  82.458 + 		return -1;
  82.459 + 	}
  82.460 + 	return 0;
  82.461 +@@ -217,12 +263,31 @@
  82.462 + 	char ie[3];
  82.463 + 	struct vnc_client_ratevent me = {VNC_CLIENT_RATEVENT};
  82.464 + 	int mask = 0;
  82.465 ++	int refresh = 2;
  82.466 + 	if (read(ratfd, &ie, sizeof(ie)) != 3)
  82.467 + 		return -1;
  82.468 + 	mc += ie[1];
  82.469 + 	mr -= ie[2];
  82.470 +-	mc = MAX(0, MIN(cols - 1, mc));
  82.471 +-	mr = MAX(0, MIN(rows - 1, mr));
  82.472 ++	if (mc < oc) {
  82.473 ++		if ((oc -= cols / 5) < 0)
  82.474 ++			oc = 0;
  82.475 ++	}
  82.476 ++	else if (mc >= oc + cols && oc + cols < srv_cols) {
  82.477 ++		if ((oc += cols / 5) > srv_cols - cols)
  82.478 ++			oc = srv_cols - cols;
  82.479 ++	}
  82.480 ++	else refresh--;
  82.481 ++	if (mr < or) {
  82.482 ++		if ((or -= rows / 5) < 0)
  82.483 ++			or = 0;
  82.484 ++	}
  82.485 ++	else if (mr >= or + rows && or + rows < srv_rows) {
  82.486 ++		if ((or += rows / 5) > srv_rows - rows)
  82.487 ++			or = srv_rows - rows;
  82.488 ++	}
  82.489 ++	else refresh--;
  82.490 ++	mc = MAX(oc, MIN(oc + cols - 1, mc));
  82.491 ++	mr = MAX(or, MIN(or + rows - 1, mr));
  82.492 + 	if (ie[0] & 0x01)
  82.493 + 		mask |= VNC_BUTTON1_MASK;
  82.494 + 	if (ie[0] & 0x04)
  82.495 +@@ -233,6 +298,8 @@
  82.496 + 	me.x = htons(mc);
  82.497 + 	me.mask = mask;
  82.498 + 	write(fd, &me, sizeof(me));
  82.499 ++	if (refresh)
  82.500 ++		vnc_refresh(fd, 0);
  82.501 + 	return 0;
  82.502 + }
  82.503 + 
  82.504 +@@ -292,12 +359,11 @@
  82.505 + 			k = 0xff0d;
  82.506 + 			break;
  82.507 + 		case 0x0c:	/* ^L: redraw */
  82.508 +-			if (vnc_refresh(fd, 0))
  82.509 +-				return -1;
  82.510 ++			vnc_refresh(fd, 0);
  82.511 + 		default:
  82.512 + 			k = (unsigned char) key[i];
  82.513 + 		}
  82.514 +-		if (k >= 'A' && k <= 'Z' || strchr(":\"<>?{}|+_()*&^%$#@!~", k))
  82.515 ++		if ((k >= 'A' && k <= 'Z') || strchr(":\"<>?{}|+_()*&^%$#@!~", k))
  82.516 + 			mod[nmod++] = 0xffe1;
  82.517 + 		if (k >= 1 && k <= 26) {
  82.518 + 			k = 'a' + k - 1;
  82.519 +@@ -339,40 +405,42 @@
  82.520 + 	write(STDIN_FILENO, show, strlen(show));
  82.521 + }
  82.522 + 
  82.523 +-static void mainloop(int vnc_fd, int kbd_fd, int rat_fd)
  82.524 ++static int mainloop(int vnc_fd, int kbd_fd, int rat_fd)
  82.525 + {
  82.526 + 	struct pollfd ufds[3];
  82.527 + 	int pending = 0;
  82.528 + 	int err;
  82.529 + 	ufds[0].fd = kbd_fd;
  82.530 +-	ufds[0].events = POLLIN;
  82.531 + 	ufds[1].fd = vnc_fd;
  82.532 +-	ufds[1].events = POLLIN;
  82.533 + 	ufds[2].fd = rat_fd;
  82.534 ++	ufds[0].events =
  82.535 ++	ufds[1].events =
  82.536 + 	ufds[2].events = POLLIN;
  82.537 +-	if (vnc_refresh(vnc_fd, 0))
  82.538 +-		return;
  82.539 ++	vnc_refresh(vnc_fd, 0);
  82.540 + 	while (1) {
  82.541 + 		err = poll(ufds, 3, 500);
  82.542 + 		if (err == -1 && errno != EINTR)
  82.543 + 			break;
  82.544 + 		if (!err)
  82.545 + 			continue;
  82.546 ++		err = -2;
  82.547 + 		if (ufds[0].revents & POLLIN)
  82.548 + 			if (kbd_event(vnc_fd, kbd_fd) == -1)
  82.549 + 				break;
  82.550 ++		err--;
  82.551 + 		if (ufds[1].revents & POLLIN) {
  82.552 + 			if (vnc_event(vnc_fd) == -1)
  82.553 + 				break;
  82.554 + 			pending = 0;
  82.555 + 		}
  82.556 ++		err--;
  82.557 + 		if (ufds[2].revents & POLLIN)
  82.558 + 			if (rat_event(vnc_fd, rat_fd) == -1)
  82.559 + 				break;
  82.560 + 		if (!pending++)
  82.561 +-			if (vnc_refresh(vnc_fd, 1))
  82.562 +-				break;
  82.563 ++			vnc_refresh(vnc_fd, 1);
  82.564 + 	}
  82.565 ++	return err;
  82.566 + }
  82.567 + 
  82.568 + int main(int argc, char * argv[])
  82.569 +@@ -380,27 +448,38 @@
  82.570 + 	char *port = VNC_PORT;
  82.571 + 	char *host = "127.0.0.1";
  82.572 + 	struct termios ti;
  82.573 +-	int vnc_fd, rat_fd;
  82.574 ++	int vnc_fd, rat_fd, status;
  82.575 ++	
  82.576 ++	if (argc < 2) {
  82.577 ++		fprintf(stderr, "Usage : fbvnc [-bpp bits] server [port]\n");
  82.578 ++		return 0;
  82.579 ++  	}
  82.580 ++  	if (*argv[1] == '-' && argc >= 3) {
  82.581 ++  		argc -= 2; argv += 2;
  82.582 ++  		bpp = atoi(argv[0]) >> 3;
  82.583 ++  	} 
  82.584 + 	if (argc >= 2)
  82.585 + 		host = argv[1];
  82.586 + 	if (argc >= 3)
  82.587 + 		port = argv[2];
  82.588 +-	if ((vnc_fd = vnc_connect(host, port)) == -1) {
  82.589 +-		fprintf(stderr, "could not connect!\n");
  82.590 ++	if ((vnc_fd = vnc_connect(host, port)) < 0) {
  82.591 ++		fprintf(stderr, "could not connect! %s %s : %d\n",
  82.592 ++			host,port,vnc_fd);
  82.593 + 		return 1;
  82.594 + 	}
  82.595 +-	if (vnc_init(vnc_fd) == -1) {
  82.596 +-		fprintf(stderr, "vnc init failed!\n");
  82.597 +-		return 1;
  82.598 ++	status = vnc_init(vnc_fd);
  82.599 ++	if (status < 0) {
  82.600 ++		fprintf(stderr, "vnc init failed! %d\n", status);
  82.601 ++		return 2;
  82.602 + 	}
  82.603 + 	term_setup(&ti);
  82.604 + 	rat_fd = open("/dev/input/mice", O_RDONLY);
  82.605 + 
  82.606 +-	mainloop(vnc_fd, 0, rat_fd);
  82.607 ++	status = mainloop(vnc_fd, 0, rat_fd);
  82.608 + 
  82.609 + 	term_cleanup(&ti);
  82.610 + 	vnc_free();
  82.611 + 	close(vnc_fd);
  82.612 + 	close(rat_fd);
  82.613 +-	return 0;
  82.614 ++	return 2 - status;
  82.615 + }
    83.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    83.2 +++ b/fbvnc/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    83.3 @@ -0,0 +1,1 @@
    83.4 +#-p0|fbvnc.u
    84.1 --- a/foobillard/receipt	Wed May 09 17:03:28 2018 +0300
    84.2 +++ b/foobillard/receipt	Thu May 10 21:12:00 2018 +0300
    84.3 @@ -18,11 +18,6 @@
    84.4  compile_rules()
    84.5  {
    84.6  	sed -i -e 's/-lXaw//' -e 's/-lXi//' src/Makefile.in
    84.7 -	patch -p1 < $stuff/03_bugfixes
    84.8 -	patch -p1 < $stuff/05_foul_explanation
    84.9 -	patch -p1 < $stuff/06_show_ball_to_hit
   84.10 -	patch -p0 < $stuff/snooker_reset.patch
   84.11 -	patch -p0 < $stuff/snooker_draw.patch
   84.12  
   84.13  	./configure \
   84.14  		--prefix=/usr \
    85.1 --- a/foobillard/stuff/03_bugfixes	Wed May 09 17:03:28 2018 +0300
    85.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    85.3 @@ -1,36 +0,0 @@
    85.4 -Index: foobillard-3.0a/src/ball.c
    85.5 -===================================================================
    85.6 ---- foobillard-3.0a.orig/src/ball.c	2006-10-12 16:42:39.000000000 +0200
    85.7 -+++ foobillard-3.0a/src/ball.c	2006-10-12 16:42:48.000000000 +0200
    85.8 -@@ -1821,6 +1821,7 @@
    85.9 -             } else if( options_cuberef && cuberef_binds!=0 ){
   85.10 -                 glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, cuberef_binds[i]);
   85.11 - #ifdef GL_VERTEX_PROGRAM_NV
   85.12 -+#ifdef USE_BALL_FRESNEL
   85.13 -                 {
   85.14 -                     myvec cam_pos2;
   85.15 - //                    cam_pos2=vec_scale(vec_unit(vec_diff(cam_pos,balls.ball[i].r)),BALL_D/2.5);
   85.16 -@@ -1829,6 +1830,7 @@
   85.17 -                                            BALL_D/2.0,BALL_D/2.5,0,0 );
   85.18 -                 }
   85.19 - #endif
   85.20 -+#endif
   85.21 -                 draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0);
   85.22 -             }else{
   85.23 -                 draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0);
   85.24 -Index: foobillard-3.0a/src/evaluate_move.c
   85.25 -===================================================================
   85.26 ---- foobillard-3.0a.orig/src/evaluate_move.c	2006-10-12 16:42:43.000000000 +0200
   85.27 -+++ foobillard-3.0a/src/evaluate_move.c	2006-10-12 16:42:48.000000000 +0200
   85.28 -@@ -385,6 +385,11 @@
   85.29 -     int ball_out;
   85.30 -     int other_player=(act_player==1)?0:1;
   85.31 -     int b1hit = BM_get_1st_ball_hit();  if (b1hit>=8) b1hit=1;
   85.32 -+    if(st.to_play==SN_DONE)
   85.33 -+    {
   85.34 -+        BM_reset_move_info();
   85.35 -+        return;
   85.36 -+    }
   85.37 - 
   85.38 -     if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0;
   85.39 -     printf("EVAL start\n");
    86.1 --- a/foobillard/stuff/05_foul_explanation	Wed May 09 17:03:28 2018 +0300
    86.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    86.3 @@ -1,262 +0,0 @@
    86.4 -Index: foobillard-3.0a/src/billard3d.c
    86.5 -===================================================================
    86.6 ---- foobillard-3.0a.orig/src/billard3d.c	2006-10-12 16:44:17.000000000 +0200
    86.7 -+++ foobillard-3.0a/src/billard3d.c	2006-10-12 16:44:31.000000000 +0200
    86.8 -@@ -331,6 +331,8 @@
    86.9 - static textObj * winner_name_text_obj;
   86.10 - static textObj * winner_text_obj;
   86.11 - 
   86.12 -+textObj * last_fault_text;
   86.13 -+
   86.14 - #ifndef _WIN32
   86.15 - 
   86.16 - enum optionType
   86.17 -@@ -3322,6 +3324,13 @@
   86.18 -        if( player[act_player].text != 0 ){
   86.19 -            textObj_draw( player[act_player].text );
   86.20 -        }
   86.21 -+       /* last fault */
   86.22 -+       if (strcmp("x", last_fault_text->str)!=0) {
   86.23 -+             glTranslatef(0.0, 70.0, 0.0);
   86.24 -+             textObj_draw(last_fault_text);
   86.25 -+             glTranslatef(0.0,-70.0,0.0);
   86.26 -+       }
   86.27 -+
   86.28 -        glTranslatef(0,30,0);
   86.29 -        if        (gametype==GAME_8BALL){
   86.30 -            switch(player[act_player].half_full){
   86.31 -@@ -5197,6 +5206,9 @@
   86.32 -    }
   86.33 -    DPRINTF("created winner text obj's\n");
   86.34 - 
   86.35 -+
   86.36 -+   last_fault_text = textObj_new( "x", options_help_fontname, 20 );
   86.37 -+
   86.38 -    init_menu();
   86.39 - 
   86.40 -    sys_set_timer(frametime_ms, Idle_timer);     /* assure a framerate of max 50 fps (1frame/20ms) */
   86.41 -Index: foobillard-3.0a/src/evaluate_move.c
   86.42 -===================================================================
   86.43 ---- foobillard-3.0a.orig/src/evaluate_move.c	2006-10-12 16:44:22.000000000 +0200
   86.44 -+++ foobillard-3.0a/src/evaluate_move.c	2006-10-12 16:44:31.000000000 +0200
   86.45 -@@ -4,6 +4,9 @@
   86.46 - **    Copyright (C) 2001  Florian Berger
   86.47 - **    Email: harpin_floh@yahoo.de, florian.berger@jk.uni-linz.ac.at
   86.48 - **
   86.49 -+**    Small changes to output a reason why the last shot was a fault by
   86.50 -+**    Thorsten Gunkel <tgunkel-lists@tgunkel.de>
   86.51 -+**
   86.52 - **    This program is free software; you can redistribute it and/or modify
   86.53 - **    it under the terms of the GNU General Public License Version 2 as
   86.54 - **    published by the Free Software Foundation;
   86.55 -@@ -108,11 +111,12 @@
   86.56 - 
   86.57 -     /* wenn fremde kugel zuerst angespielt -> foul */
   86.58 -     first_ball_hit=BM_get_1st_ball_hit();
   86.59 --    if( player[act_player].half_full == BALL_FULL ){
   86.60 --        if ( first_ball_hit>8 && first_ball_hit<16 ) foul=1;
   86.61 --    }
   86.62 --    if( player[act_player].half_full == BALL_HALF ){
   86.63 --        if ( first_ball_hit>0 && first_ball_hit<8 ) foul=1;
   86.64 -+    if(
   86.65 -+       ( player[act_player].half_full == BALL_FULL && first_ball_hit>8 && first_ball_hit<16 ) ||
   86.66 -+       ( player[act_player].half_full == BALL_HALF && first_ball_hit>0 && first_ball_hit<8  )
   86.67 -+       ){
   86.68 -+      foul=1;
   86.69 -+      textObj_setText(last_fault_text, "First ball hit was not one of yours");
   86.70 -     }
   86.71 - 
   86.72 -     /* erst an 2. stelle, da oben kein foul bei break */
   86.73 -@@ -146,7 +150,10 @@
   86.74 -                 }
   86.75 -             }
   86.76 -         }
   86.77 --        if(eigene_da) foul=1;
   86.78 -+        if(eigene_da){
   86.79 -+          foul=1;
   86.80 -+          textObj_setText(last_fault_text, "You hit the 8-Ball too soon");
   86.81 -+        }
   86.82 -     }
   86.83 - 
   86.84 -     /* wenn angespielte kugel im strafraum */
   86.85 -@@ -154,6 +161,7 @@
   86.86 -         in_strafraum(BM_get_1st_ball_hit_pos()) &&
   86.87 -         !BM_get_non_strafraum_wall_hit_before_1st_ball(in_strafraum) ){
   86.88 -         foul=1;
   86.89 -+        textObj_setText(last_fault_text, "You hit a ball not behind the head string");
   86.90 -     }
   86.91 - 
   86.92 -     /* wenn eigene rein naechster */
   86.93 -@@ -169,7 +177,10 @@
   86.94 -     }
   86.95 - 
   86.96 - 
   86.97 --    if( BM_get_balls_hit()==0 ) foul=1;
   86.98 -+    if( BM_get_balls_hit()==0 ){
   86.99 -+      foul=1;
  86.100 -+      textObj_setText(last_fault_text, "No Ball hit");
  86.101 -+    }
  86.102 - 
  86.103 -     /* wenn weisse rein */
  86.104 -     if( BM_get_white_out() ){
  86.105 -@@ -177,6 +188,7 @@
  86.106 -         foul=1;
  86.107 -         balls.ball[0].in_game=1;
  86.108 -         balls.ball[0].in_hole=0;
  86.109 -+        textObj_setText(last_fault_text, "White ball potted");
  86.110 -     }
  86.111 - 
  86.112 -     /* wenn foul */
  86.113 -@@ -188,6 +200,8 @@
  86.114 -         balls.ball[0].w=vec_xyz(0.0,0.0,0.0);
  86.115 -         balls.ball[0].r=vec_xyz(0.0,-TABLE_L/4.0,0.0);
  86.116 - //        balls.ball[0].r=vec_xyz(x,y,0.0);
  86.117 -+    } else {
  86.118 -+      textObj_setText(last_fault_text, "x");
  86.119 -     }
  86.120 - 
  86.121 -     /* if 8 out */
  86.122 -@@ -221,6 +235,7 @@
  86.123 -         else
  86.124 -         {
  86.125 -             player[(act_player==1)?0:1].winner=1;
  86.126 -+            textObj_setText(last_fault_text, "8 ball potted too soon");
  86.127 -         }
  86.128 - 
  86.129 -     }
  86.130 -@@ -277,9 +292,15 @@
  86.131 -         nextplayer=0;
  86.132 -     }
  86.133 - 
  86.134 --    if( BM_get_balls_hit()==0 ) foul=1;
  86.135 --
  86.136 --    if( BM_get_1st_ball_hit()!=minball ) foul=1;
  86.137 -+    if( BM_get_balls_hit()==0 ){
  86.138 -+      textObj_setText(last_fault_text, "No Ball hit");
  86.139 -+      foul=1;
  86.140 -+    } else {
  86.141 -+      if( BM_get_1st_ball_hit()!=minball ){
  86.142 -+        textObj_setText(last_fault_text, "First ball hit was not the lowest");
  86.143 -+        foul=1;
  86.144 -+      }
  86.145 -+    }
  86.146 - 
  86.147 -     /* wenn weisse rein */
  86.148 -     if( BM_get_white_out() ){
  86.149 -@@ -287,6 +308,7 @@
  86.150 -         nextplayer=1;
  86.151 -         pballs->ball[0].in_game=1;
  86.152 -         pballs->ball[0].in_hole=0;
  86.153 -+        textObj_setText(last_fault_text, "White ball is potted");
  86.154 -     }
  86.155 - 
  86.156 -     /* wenn foul - weisse platzieren */
  86.157 -@@ -297,6 +319,8 @@
  86.158 -         pballs->ball[0].v=vec_xyz(0.0,0.0,0.0);
  86.159 -         pballs->ball[0].w=vec_xyz(0.0,0.0,0.0);
  86.160 -         pballs->ball[0].r=vec_xyz(0,-TABLE_L/4.0,0.0);
  86.161 -+    } else {
  86.162 -+      textObj_setText(last_fault_text, "x");
  86.163 -     }
  86.164 - 
  86.165 -     fprintf(stderr,"foul:%d, nextplayer:%d, BM_get_ball_out(9):%d\n",foul,nextplayer,BM_get_ball_out(9));
  86.166 -@@ -409,6 +433,7 @@
  86.167 -         act_penalty =MAX(act_penalty,(BM_get_1st_ball_hit()<=7?BM_get_1st_ball_hit():4));
  86.168 -         spot_snooker_ball(pballs,0);
  86.169 -         player[other_player].place_cue_ball=1;
  86.170 -+        textObj_setText(last_fault_text, "White ball is potted");
  86.171 -     }
  86.172 - 
  86.173 -     switch(st.to_play)
  86.174 -@@ -420,6 +445,11 @@
  86.175 -             foul=1;
  86.176 -             act_penalty=MAX(act_penalty,b1hit);
  86.177 -             printf("EVAL foul 1\n");
  86.178 -+            if( BM_get_balls_hit()==0 ){
  86.179 -+              textObj_setText(last_fault_text, "No Ball hit");
  86.180 -+            } else {
  86.181 -+              textObj_setText(last_fault_text, "First ball hit was not a red one");
  86.182 -+            }
  86.183 -         }
  86.184 -         i=1;
  86.185 -         while((ball_out=BM_get_nth_ball_out(i++))>=0)
  86.186 -@@ -434,6 +464,11 @@
  86.187 -                 act_penalty=MAX(act_penalty,ball_out);
  86.188 -                 foul=1;
  86.189 -                 printf("EVAL foul 2\n");
  86.190 -+                if (BM_get_white_out()){
  86.191 -+                  textObj_setText(last_fault_text, "White ball potted");
  86.192 -+                } else {
  86.193 -+                  textObj_setText(last_fault_text, "Potted ball was not a red one");
  86.194 -+                }
  86.195 -             }
  86.196 -         }
  86.197 -         for(i=2;i<8;i++)
  86.198 -@@ -449,6 +484,11 @@
  86.199 -             foul=1;
  86.200 -             printf("EVAL foul 3\n");
  86.201 -             act_penalty=MAX(act_penalty,7);
  86.202 -+            if( BM_get_balls_hit()==0 ){
  86.203 -+              textObj_setText(last_fault_text, "No Ball hit");
  86.204 -+            } else {
  86.205 -+              textObj_setText(last_fault_text, "First ball hit was not a colored one");
  86.206 -+            }
  86.207 -         }
  86.208 -         color_to_pot=b1hit;
  86.209 -         i=1;
  86.210 -@@ -464,6 +504,11 @@
  86.211 -                 foul=1;
  86.212 -                 printf("EVAL foul 4\n");
  86.213 -                 act_penalty=MAX(act_penalty,ball_out==1?7:ball_out);
  86.214 -+                if (BM_get_white_out()){
  86.215 -+                  textObj_setText(last_fault_text, "White ball potted");
  86.216 -+                } else {
  86.217 -+                  textObj_setText(last_fault_text, "Potted ball was not a colored one");
  86.218 -+                }
  86.219 -             }
  86.220 -         }
  86.221 -         if(red_balls_are_in_game)
  86.222 -@@ -490,6 +535,11 @@
  86.223 -             printf("EVAL foul 5\n");
  86.224 -             act_penalty=MAX(act_penalty,b1hit);
  86.225 -             act_penalty=MAX(act_penalty,color_to_pot);
  86.226 -+            if( BM_get_balls_hit()==0 ){
  86.227 -+              textObj_setText(last_fault_text, "No Ball hit");
  86.228 -+            } else {
  86.229 -+              textObj_setText(last_fault_text, "First ball hit was not the correct one");
  86.230 -+            }
  86.231 -         }
  86.232 -         i=1;
  86.233 -         while((ball_out=BM_get_nth_ball_out(i++))>=0)
  86.234 -@@ -505,6 +555,11 @@
  86.235 -                 printf("EVAL foul 6\n");
  86.236 -                 act_penalty=MAX(act_penalty,b1hit);
  86.237 -                 act_penalty=MAX(act_penalty,color_to_pot);
  86.238 -+                if (BM_get_white_out()){
  86.239 -+                  textObj_setText(last_fault_text, "White ball potted");
  86.240 -+                } else {
  86.241 -+                  textObj_setText(last_fault_text, "Potted ball was not the correct one");
  86.242 -+                }
  86.243 -             }
  86.244 -         }
  86.245 -         if(!foul && act_score>0) st.to_play++;
  86.246 -@@ -528,6 +583,7 @@
  86.247 -     {
  86.248 -         player[act_player].score += act_score ;
  86.249 -         printf("EVAL no foul\n");
  86.250 -+        textObj_setText(last_fault_text, "x");
  86.251 -     }
  86.252 -     if(act_score==0 || foul)
  86.253 -     {
  86.254 -Index: foobillard-3.0a/src/evaluate_move.h
  86.255 -===================================================================
  86.256 ---- foobillard-3.0a.orig/src/evaluate_move.h	2006-10-12 16:44:24.000000000 +0200
  86.257 -+++ foobillard-3.0a/src/evaluate_move.h	2006-10-12 16:44:31.000000000 +0200
  86.258 -@@ -31,6 +31,7 @@
  86.259 -                                     BallsType * pballs, int * pqueue_view, float * pXque );
  86.260 - #endif
  86.261 - 
  86.262 -+extern textObj * last_fault_text;
  86.263 - 
  86.264 - void evaluate_last_move_8ball    ( struct Player * player, int * actual_player,
  86.265 -                                    BallsType * pballs, int * pqueue_view, float * pXque );
    87.1 --- a/foobillard/stuff/06_show_ball_to_hit	Wed May 09 17:03:28 2018 +0300
    87.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    87.3 @@ -1,255 +0,0 @@
    87.4 -Index: foobillard-3.0a/src/billard.c
    87.5 -===================================================================
    87.6 ---- foobillard-3.0a.orig/src/billard.c	2006-10-12 16:45:04.000000000 +0200
    87.7 -+++ foobillard-3.0a/src/billard.c	2006-10-12 16:45:23.000000000 +0200
    87.8 -@@ -31,6 +31,8 @@
    87.9 - void * (*billard_malloc)( size_t size ) = malloc;
   87.10 - void (*billard_free)( void * ptr ) = free;
   87.11 - 
   87.12 -+SnookerState snooker_state={SN_PLAY_RED};
   87.13 -+
   87.14 - void setfunc_create_scene( void (*func)( BallsType * balls ) )
   87.15 - {
   87.16 -     create_scene=func;
   87.17 -Index: foobillard-3.0a/src/billard.h
   87.18 -===================================================================
   87.19 ---- foobillard-3.0a.orig/src/billard.h	2006-10-12 16:45:05.000000000 +0200
   87.20 -+++ foobillard-3.0a/src/billard.h	2006-10-12 16:45:23.000000000 +0200
   87.21 -@@ -76,9 +76,30 @@
   87.22 - #define BALL_HALF 2
   87.23 - #define BALL_ANY  0
   87.24 - 
   87.25 -+typedef enum
   87.26 -+{
   87.27 -+   SN_PLAY_RED,
   87.28 -+   SN_PLAY_ANY_COLOR,
   87.29 -+   SN_PLAY_YELLOW,
   87.30 -+   SN_PLAY_GREEN,
   87.31 -+   SN_PLAY_BROWN,
   87.32 -+   SN_PLAY_BLUE,
   87.33 -+   SN_PLAY_PINK,
   87.34 -+   SN_PLAY_BLACK,
   87.35 -+   SN_DONE
   87.36 -+}
   87.37 -+SnookerBallToPlay;
   87.38 -+
   87.39 -+typedef struct
   87.40 -+{
   87.41 -+   SnookerBallToPlay to_play;
   87.42 -+}
   87.43 -+SnookerState;
   87.44 -+
   87.45 - #ifndef BILLARD_C
   87.46 - extern void (*create_scene)( BallsType * balls );
   87.47 - extern void (*create_walls)( BordersType * walls );
   87.48 -+extern SnookerState snooker_state;
   87.49 - #endif
   87.50 - 
   87.51 - void create_0hole_walls( BordersType * walls );   /* carambol */
   87.52 -Index: foobillard-3.0a/src/billard3d.c
   87.53 -===================================================================
   87.54 ---- foobillard-3.0a.orig/src/billard3d.c	2006-10-12 16:45:08.000000000 +0200
   87.55 -+++ foobillard-3.0a/src/billard3d.c	2006-10-12 16:45:23.000000000 +0200
   87.56 -@@ -829,6 +829,7 @@
   87.57 -         player[act_player].place_cue_ball=1;
   87.58 -         human_player_roster.player[0].cue_ball=0;   human_player_roster.player[1].cue_ball=0;
   87.59 -         human_player_roster.player[act_player].place_cue_ball=1;
   87.60 -+        snooker_state.to_play=SN_PLAY_RED;
   87.61 -     }
   87.62 - }
   87.63 - 
   87.64 -@@ -1787,6 +1788,7 @@
   87.65 -            /* score text */
   87.66 -            for(i=0;i<2;i++){
   87.67 -                char str[256];
   87.68 -+               char *color;
   87.69 -                switch(gametype){
   87.70 -                case GAME_8BALL: strcpy(str,"0"); break;
   87.71 -                case GAME_9BALL:
   87.72 -@@ -1805,7 +1807,44 @@
   87.73 -                    sprintf( str, "%d", player[i].score );
   87.74 -                    break;
   87.75 -                case GAME_SNOOKER:
   87.76 --                   sprintf( str, "%c%03d  %s", (player[i].score<0)?'-':'+', abs(player[i].score), player[i].snooker_on_red ? "red":"col" );
   87.77 -+                   switch(snooker_state.to_play)
   87.78 -+                   {
   87.79 -+                   case SN_PLAY_RED:
   87.80 -+                       color="red";
   87.81 -+                       break;
   87.82 -+                   case SN_PLAY_ANY_COLOR:
   87.83 -+                       color="color";
   87.84 -+                       break;
   87.85 -+                   case SN_PLAY_YELLOW:
   87.86 -+                       color="yellow";
   87.87 -+                       break;
   87.88 -+                   case SN_PLAY_GREEN:
   87.89 -+                       color="green";
   87.90 -+                       break;
   87.91 -+                   case SN_PLAY_BROWN:
   87.92 -+                       color="brown";
   87.93 -+                       break;
   87.94 -+                   case SN_PLAY_BLUE:
   87.95 -+                       color="blue";
   87.96 -+                       break;
   87.97 -+                   case SN_PLAY_PINK:
   87.98 -+                       color="pink";
   87.99 -+                       break;
  87.100 -+                   case SN_PLAY_BLACK:
  87.101 -+                       color="black";
  87.102 -+                       break;
  87.103 -+                   case SN_DONE:
  87.104 -+                       color="";
  87.105 -+                       break;
  87.106 -+                   }
  87.107 -+                   if(i==act_player)
  87.108 -+                   {
  87.109 -+                       sprintf( str, "%.3d  %s", player[i].score, color);
  87.110 -+                   }
  87.111 -+                   else
  87.112 -+                   {
  87.113 -+                       sprintf( str, "%.3d", player[i].score);
  87.114 -+                   }
  87.115 -                    break;
  87.116 -                }
  87.117 -                textObj_setText( player[i].score_text, str );
  87.118 -Index: foobillard-3.0a/src/evaluate_move.c
  87.119 -===================================================================
  87.120 ---- foobillard-3.0a.orig/src/evaluate_move.c	2006-10-12 16:45:12.000000000 +0200
  87.121 -+++ foobillard-3.0a/src/evaluate_move.c	2006-10-12 16:45:23.000000000 +0200
  87.122 -@@ -30,26 +30,6 @@
  87.123 - 
  87.124 - #define MAX(x,y) ((x)>(y)?(x):(y));
  87.125 - 
  87.126 --typedef enum
  87.127 --{
  87.128 --   SN_PLAY_RED,
  87.129 --   SN_PLAY_ANY_COLOR,
  87.130 --   SN_PLAY_YELLOW,
  87.131 --   SN_PLAY_GREEN,
  87.132 --   SN_PLAY_BROWN,
  87.133 --   SN_PLAY_BLUE,
  87.134 --   SN_PLAY_PINK,
  87.135 --   SN_PLAY_BLACK,
  87.136 --   SN_DONE
  87.137 --}
  87.138 --SnookerBallToPlay;
  87.139 --
  87.140 --typedef struct
  87.141 --{
  87.142 --   SnookerBallToPlay to_play;
  87.143 --}
  87.144 --SnookerState;
  87.145 --
  87.146 - 
  87.147 - void spot_snooker_ball(BallsType *balls,int nr);
  87.148 - 
  87.149 -@@ -400,7 +380,6 @@
  87.150 - #define act_player (*pact_player)
  87.151 - #define IS_RED(x) ( x==1 || x>=8 )
  87.152 -     int red_balls_are_in_game=0;
  87.153 --    static SnookerState st={SN_PLAY_RED};
  87.154 -     int color_to_pot;
  87.155 -     int i;
  87.156 -     int act_score=0;
  87.157 -@@ -409,7 +388,7 @@
  87.158 -     int ball_out;
  87.159 -     int other_player=(act_player==1)?0:1;
  87.160 -     int b1hit = BM_get_1st_ball_hit();  if (b1hit>=8) b1hit=1;
  87.161 --    if(st.to_play==SN_DONE)
  87.162 -+    if(snooker_state.to_play==SN_DONE)
  87.163 -     {
  87.164 -         BM_reset_move_info();
  87.165 -         return;
  87.166 -@@ -417,7 +396,7 @@
  87.167 - 
  87.168 -     if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0;
  87.169 -     printf("EVAL start\n");
  87.170 --    printf("EVAL to_play=%d\n",st.to_play);
  87.171 -+    printf("EVAL to_play=%d\n",snooker_state.to_play);
  87.172 -     printf("EVAL b1hit=%d\n",b1hit);
  87.173 -     for(i=0;i<pballs->nr;i++){
  87.174 -         if( IS_RED(pballs->ball[i].nr) && pballs->ball[i].in_game ){
  87.175 -@@ -436,7 +415,7 @@
  87.176 -         textObj_setText(last_fault_text, "White ball is potted");
  87.177 -     }
  87.178 - 
  87.179 --    switch(st.to_play)
  87.180 -+    switch(snooker_state.to_play)
  87.181 -     {
  87.182 -     case SN_PLAY_RED:
  87.183 -         color_to_pot=1;
  87.184 -@@ -476,7 +455,7 @@
  87.185 -             if( BM_get_ball_out(i))
  87.186 -                 spot_snooker_ball(pballs,i);
  87.187 -         }
  87.188 --        st.to_play=SN_PLAY_ANY_COLOR;
  87.189 -+        snooker_state.to_play=SN_PLAY_ANY_COLOR;
  87.190 -         break;
  87.191 -     case SN_PLAY_ANY_COLOR:
  87.192 -         if(b1hit==1)
  87.193 -@@ -512,9 +491,9 @@
  87.194 -             }
  87.195 -         }
  87.196 -         if(red_balls_are_in_game)
  87.197 --            st.to_play=SN_PLAY_RED;
  87.198 -+            snooker_state.to_play=SN_PLAY_RED;
  87.199 -         else
  87.200 --            st.to_play=SN_PLAY_YELLOW;
  87.201 -+            snooker_state.to_play=SN_PLAY_YELLOW;
  87.202 - 
  87.203 -         for(i=2;i<8;i++)
  87.204 -         {
  87.205 -@@ -528,7 +507,7 @@
  87.206 -     case SN_PLAY_BLUE:
  87.207 -     case SN_PLAY_PINK:
  87.208 -     case SN_PLAY_BLACK:
  87.209 --        color_to_pot=st.to_play;
  87.210 -+        color_to_pot=snooker_state.to_play;
  87.211 -         if(b1hit!=color_to_pot)
  87.212 -         {
  87.213 -             foul=1;
  87.214 -@@ -562,9 +541,9 @@
  87.215 -                 }
  87.216 -             }
  87.217 -         }
  87.218 --        if(!foul && act_score>0) st.to_play++;
  87.219 -+        if(!foul && act_score>0) snooker_state.to_play++;
  87.220 - 
  87.221 --        for(i=st.to_play;i<8;i++)
  87.222 -+        for(i=snooker_state.to_play;i<8;i++)
  87.223 -         {
  87.224 -             if( BM_get_ball_out(i))
  87.225 -                 spot_snooker_ball(pballs,i);
  87.226 -@@ -590,13 +569,13 @@
  87.227 -         printf("EVAL next player\n");
  87.228 -         if(red_balls_are_in_game)
  87.229 -         {
  87.230 --            st.to_play=SN_PLAY_RED;
  87.231 -+            snooker_state.to_play=SN_PLAY_RED;
  87.232 -         }
  87.233 -         else
  87.234 -         {
  87.235 --            if(st.to_play<=SN_PLAY_ANY_COLOR)
  87.236 -+            if(snooker_state.to_play<=SN_PLAY_ANY_COLOR)
  87.237 -             {
  87.238 --                st.to_play=SN_PLAY_YELLOW;
  87.239 -+                snooker_state.to_play=SN_PLAY_YELLOW;
  87.240 -             }
  87.241 -         }
  87.242 -         player[act_player].queue_view=*pqueue_view;
  87.243 -@@ -605,11 +584,11 @@
  87.244 -         *pqueue_view=player[act_player].queue_view;
  87.245 -     }
  87.246 - 
  87.247 --    player[act_player].snooker_on_red=st.to_play==SN_PLAY_RED;
  87.248 --    player[act_player].snooker_next_color=st.to_play;
  87.249 --    printf("EVAL to_play=%d\n",st.to_play);
  87.250 -+    player[act_player].snooker_on_red=snooker_state.to_play==SN_PLAY_RED;
  87.251 -+    player[act_player].snooker_next_color=snooker_state.to_play;
  87.252 -+    printf("EVAL to_play=%d\n",snooker_state.to_play);
  87.253 - 
  87.254 --    if(st.to_play==SN_DONE)
  87.255 -+    if(snooker_state.to_play==SN_DONE)
  87.256 -     {
  87.257 -         int other_player;
  87.258 - 
    88.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    88.2 +++ b/foobillard/stuff/patches/03_bugfixes	Thu May 10 21:12:00 2018 +0300
    88.3 @@ -0,0 +1,36 @@
    88.4 +Index: foobillard-3.0a/src/ball.c
    88.5 +===================================================================
    88.6 +--- foobillard-3.0a.orig/src/ball.c	2006-10-12 16:42:39.000000000 +0200
    88.7 ++++ foobillard-3.0a/src/ball.c	2006-10-12 16:42:48.000000000 +0200
    88.8 +@@ -1821,6 +1821,7 @@
    88.9 +             } else if( options_cuberef && cuberef_binds!=0 ){
   88.10 +                 glBindTexture(GL_TEXTURE_CUBE_MAP_ARB, cuberef_binds[i]);
   88.11 + #ifdef GL_VERTEX_PROGRAM_NV
   88.12 ++#ifdef USE_BALL_FRESNEL
   88.13 +                 {
   88.14 +                     myvec cam_pos2;
   88.15 + //                    cam_pos2=vec_scale(vec_unit(vec_diff(cam_pos,balls.ball[i].r)),BALL_D/2.5);
   88.16 +@@ -1829,6 +1830,7 @@
   88.17 +                                            BALL_D/2.0,BALL_D/2.5,0,0 );
   88.18 +                 }
   88.19 + #endif
   88.20 ++#endif
   88.21 +                 draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0);
   88.22 +             }else{
   88.23 +                 draw_ball(&balls.ball[i],cam_pos,cam_FOV,win_width,0);
   88.24 +Index: foobillard-3.0a/src/evaluate_move.c
   88.25 +===================================================================
   88.26 +--- foobillard-3.0a.orig/src/evaluate_move.c	2006-10-12 16:42:43.000000000 +0200
   88.27 ++++ foobillard-3.0a/src/evaluate_move.c	2006-10-12 16:42:48.000000000 +0200
   88.28 +@@ -385,6 +385,11 @@
   88.29 +     int ball_out;
   88.30 +     int other_player=(act_player==1)?0:1;
   88.31 +     int b1hit = BM_get_1st_ball_hit();  if (b1hit>=8) b1hit=1;
   88.32 ++    if(st.to_play==SN_DONE)
   88.33 ++    {
   88.34 ++        BM_reset_move_info();
   88.35 ++        return;
   88.36 ++    }
   88.37 + 
   88.38 +     if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0;
   88.39 +     printf("EVAL start\n");
    89.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    89.2 +++ b/foobillard/stuff/patches/05_foul_explanation	Thu May 10 21:12:00 2018 +0300
    89.3 @@ -0,0 +1,262 @@
    89.4 +Index: foobillard-3.0a/src/billard3d.c
    89.5 +===================================================================
    89.6 +--- foobillard-3.0a.orig/src/billard3d.c	2006-10-12 16:44:17.000000000 +0200
    89.7 ++++ foobillard-3.0a/src/billard3d.c	2006-10-12 16:44:31.000000000 +0200
    89.8 +@@ -331,6 +331,8 @@
    89.9 + static textObj * winner_name_text_obj;
   89.10 + static textObj * winner_text_obj;
   89.11 + 
   89.12 ++textObj * last_fault_text;
   89.13 ++
   89.14 + #ifndef _WIN32
   89.15 + 
   89.16 + enum optionType
   89.17 +@@ -3322,6 +3324,13 @@
   89.18 +        if( player[act_player].text != 0 ){
   89.19 +            textObj_draw( player[act_player].text );
   89.20 +        }
   89.21 ++       /* last fault */
   89.22 ++       if (strcmp("x", last_fault_text->str)!=0) {
   89.23 ++             glTranslatef(0.0, 70.0, 0.0);
   89.24 ++             textObj_draw(last_fault_text);
   89.25 ++             glTranslatef(0.0,-70.0,0.0);
   89.26 ++       }
   89.27 ++
   89.28 +        glTranslatef(0,30,0);
   89.29 +        if        (gametype==GAME_8BALL){
   89.30 +            switch(player[act_player].half_full){
   89.31 +@@ -5197,6 +5206,9 @@
   89.32 +    }
   89.33 +    DPRINTF("created winner text obj's\n");
   89.34 + 
   89.35 ++
   89.36 ++   last_fault_text = textObj_new( "x", options_help_fontname, 20 );
   89.37 ++
   89.38 +    init_menu();
   89.39 + 
   89.40 +    sys_set_timer(frametime_ms, Idle_timer);     /* assure a framerate of max 50 fps (1frame/20ms) */
   89.41 +Index: foobillard-3.0a/src/evaluate_move.c
   89.42 +===================================================================
   89.43 +--- foobillard-3.0a.orig/src/evaluate_move.c	2006-10-12 16:44:22.000000000 +0200
   89.44 ++++ foobillard-3.0a/src/evaluate_move.c	2006-10-12 16:44:31.000000000 +0200
   89.45 +@@ -4,6 +4,9 @@
   89.46 + **    Copyright (C) 2001  Florian Berger
   89.47 + **    Email: harpin_floh@yahoo.de, florian.berger@jk.uni-linz.ac.at
   89.48 + **
   89.49 ++**    Small changes to output a reason why the last shot was a fault by
   89.50 ++**    Thorsten Gunkel <tgunkel-lists@tgunkel.de>
   89.51 ++**
   89.52 + **    This program is free software; you can redistribute it and/or modify
   89.53 + **    it under the terms of the GNU General Public License Version 2 as
   89.54 + **    published by the Free Software Foundation;
   89.55 +@@ -108,11 +111,12 @@
   89.56 + 
   89.57 +     /* wenn fremde kugel zuerst angespielt -> foul */
   89.58 +     first_ball_hit=BM_get_1st_ball_hit();
   89.59 +-    if( player[act_player].half_full == BALL_FULL ){
   89.60 +-        if ( first_ball_hit>8 && first_ball_hit<16 ) foul=1;
   89.61 +-    }
   89.62 +-    if( player[act_player].half_full == BALL_HALF ){
   89.63 +-        if ( first_ball_hit>0 && first_ball_hit<8 ) foul=1;
   89.64 ++    if(
   89.65 ++       ( player[act_player].half_full == BALL_FULL && first_ball_hit>8 && first_ball_hit<16 ) ||
   89.66 ++       ( player[act_player].half_full == BALL_HALF && first_ball_hit>0 && first_ball_hit<8  )
   89.67 ++       ){
   89.68 ++      foul=1;
   89.69 ++      textObj_setText(last_fault_text, "First ball hit was not one of yours");
   89.70 +     }
   89.71 + 
   89.72 +     /* erst an 2. stelle, da oben kein foul bei break */
   89.73 +@@ -146,7 +150,10 @@
   89.74 +                 }
   89.75 +             }
   89.76 +         }
   89.77 +-        if(eigene_da) foul=1;
   89.78 ++        if(eigene_da){
   89.79 ++          foul=1;
   89.80 ++          textObj_setText(last_fault_text, "You hit the 8-Ball too soon");
   89.81 ++        }
   89.82 +     }
   89.83 + 
   89.84 +     /* wenn angespielte kugel im strafraum */
   89.85 +@@ -154,6 +161,7 @@
   89.86 +         in_strafraum(BM_get_1st_ball_hit_pos()) &&
   89.87 +         !BM_get_non_strafraum_wall_hit_before_1st_ball(in_strafraum) ){
   89.88 +         foul=1;
   89.89 ++        textObj_setText(last_fault_text, "You hit a ball not behind the head string");
   89.90 +     }
   89.91 + 
   89.92 +     /* wenn eigene rein naechster */
   89.93 +@@ -169,7 +177,10 @@
   89.94 +     }
   89.95 + 
   89.96 + 
   89.97 +-    if( BM_get_balls_hit()==0 ) foul=1;
   89.98 ++    if( BM_get_balls_hit()==0 ){
   89.99 ++      foul=1;
  89.100 ++      textObj_setText(last_fault_text, "No Ball hit");
  89.101 ++    }
  89.102 + 
  89.103 +     /* wenn weisse rein */
  89.104 +     if( BM_get_white_out() ){
  89.105 +@@ -177,6 +188,7 @@
  89.106 +         foul=1;
  89.107 +         balls.ball[0].in_game=1;
  89.108 +         balls.ball[0].in_hole=0;
  89.109 ++        textObj_setText(last_fault_text, "White ball potted");
  89.110 +     }
  89.111 + 
  89.112 +     /* wenn foul */
  89.113 +@@ -188,6 +200,8 @@
  89.114 +         balls.ball[0].w=vec_xyz(0.0,0.0,0.0);
  89.115 +         balls.ball[0].r=vec_xyz(0.0,-TABLE_L/4.0,0.0);
  89.116 + //        balls.ball[0].r=vec_xyz(x,y,0.0);
  89.117 ++    } else {
  89.118 ++      textObj_setText(last_fault_text, "x");
  89.119 +     }
  89.120 + 
  89.121 +     /* if 8 out */
  89.122 +@@ -221,6 +235,7 @@
  89.123 +         else
  89.124 +         {
  89.125 +             player[(act_player==1)?0:1].winner=1;
  89.126 ++            textObj_setText(last_fault_text, "8 ball potted too soon");
  89.127 +         }
  89.128 + 
  89.129 +     }
  89.130 +@@ -277,9 +292,15 @@
  89.131 +         nextplayer=0;
  89.132 +     }
  89.133 + 
  89.134 +-    if( BM_get_balls_hit()==0 ) foul=1;
  89.135 +-
  89.136 +-    if( BM_get_1st_ball_hit()!=minball ) foul=1;
  89.137 ++    if( BM_get_balls_hit()==0 ){
  89.138 ++      textObj_setText(last_fault_text, "No Ball hit");
  89.139 ++      foul=1;
  89.140 ++    } else {
  89.141 ++      if( BM_get_1st_ball_hit()!=minball ){
  89.142 ++        textObj_setText(last_fault_text, "First ball hit was not the lowest");
  89.143 ++        foul=1;
  89.144 ++      }
  89.145 ++    }
  89.146 + 
  89.147 +     /* wenn weisse rein */
  89.148 +     if( BM_get_white_out() ){
  89.149 +@@ -287,6 +308,7 @@
  89.150 +         nextplayer=1;
  89.151 +         pballs->ball[0].in_game=1;
  89.152 +         pballs->ball[0].in_hole=0;
  89.153 ++        textObj_setText(last_fault_text, "White ball is potted");
  89.154 +     }
  89.155 + 
  89.156 +     /* wenn foul - weisse platzieren */
  89.157 +@@ -297,6 +319,8 @@
  89.158 +         pballs->ball[0].v=vec_xyz(0.0,0.0,0.0);
  89.159 +         pballs->ball[0].w=vec_xyz(0.0,0.0,0.0);
  89.160 +         pballs->ball[0].r=vec_xyz(0,-TABLE_L/4.0,0.0);
  89.161 ++    } else {
  89.162 ++      textObj_setText(last_fault_text, "x");
  89.163 +     }
  89.164 + 
  89.165 +     fprintf(stderr,"foul:%d, nextplayer:%d, BM_get_ball_out(9):%d\n",foul,nextplayer,BM_get_ball_out(9));
  89.166 +@@ -409,6 +433,7 @@
  89.167 +         act_penalty =MAX(act_penalty,(BM_get_1st_ball_hit()<=7?BM_get_1st_ball_hit():4));
  89.168 +         spot_snooker_ball(pballs,0);
  89.169 +         player[other_player].place_cue_ball=1;
  89.170 ++        textObj_setText(last_fault_text, "White ball is potted");
  89.171 +     }
  89.172 + 
  89.173 +     switch(st.to_play)
  89.174 +@@ -420,6 +445,11 @@
  89.175 +             foul=1;
  89.176 +             act_penalty=MAX(act_penalty,b1hit);
  89.177 +             printf("EVAL foul 1\n");
  89.178 ++            if( BM_get_balls_hit()==0 ){
  89.179 ++              textObj_setText(last_fault_text, "No Ball hit");
  89.180 ++            } else {
  89.181 ++              textObj_setText(last_fault_text, "First ball hit was not a red one");
  89.182 ++            }
  89.183 +         }
  89.184 +         i=1;
  89.185 +         while((ball_out=BM_get_nth_ball_out(i++))>=0)
  89.186 +@@ -434,6 +464,11 @@
  89.187 +                 act_penalty=MAX(act_penalty,ball_out);
  89.188 +                 foul=1;
  89.189 +                 printf("EVAL foul 2\n");
  89.190 ++                if (BM_get_white_out()){
  89.191 ++                  textObj_setText(last_fault_text, "White ball potted");
  89.192 ++                } else {
  89.193 ++                  textObj_setText(last_fault_text, "Potted ball was not a red one");
  89.194 ++                }
  89.195 +             }
  89.196 +         }
  89.197 +         for(i=2;i<8;i++)
  89.198 +@@ -449,6 +484,11 @@
  89.199 +             foul=1;
  89.200 +             printf("EVAL foul 3\n");
  89.201 +             act_penalty=MAX(act_penalty,7);
  89.202 ++            if( BM_get_balls_hit()==0 ){
  89.203 ++              textObj_setText(last_fault_text, "No Ball hit");
  89.204 ++            } else {
  89.205 ++              textObj_setText(last_fault_text, "First ball hit was not a colored one");
  89.206 ++            }
  89.207 +         }
  89.208 +         color_to_pot=b1hit;
  89.209 +         i=1;
  89.210 +@@ -464,6 +504,11 @@
  89.211 +                 foul=1;
  89.212 +                 printf("EVAL foul 4\n");
  89.213 +                 act_penalty=MAX(act_penalty,ball_out==1?7:ball_out);
  89.214 ++                if (BM_get_white_out()){
  89.215 ++                  textObj_setText(last_fault_text, "White ball potted");
  89.216 ++                } else {
  89.217 ++                  textObj_setText(last_fault_text, "Potted ball was not a colored one");
  89.218 ++                }
  89.219 +             }
  89.220 +         }
  89.221 +         if(red_balls_are_in_game)
  89.222 +@@ -490,6 +535,11 @@
  89.223 +             printf("EVAL foul 5\n");
  89.224 +             act_penalty=MAX(act_penalty,b1hit);
  89.225 +             act_penalty=MAX(act_penalty,color_to_pot);
  89.226 ++            if( BM_get_balls_hit()==0 ){
  89.227 ++              textObj_setText(last_fault_text, "No Ball hit");
  89.228 ++            } else {
  89.229 ++              textObj_setText(last_fault_text, "First ball hit was not the correct one");
  89.230 ++            }
  89.231 +         }
  89.232 +         i=1;
  89.233 +         while((ball_out=BM_get_nth_ball_out(i++))>=0)
  89.234 +@@ -505,6 +555,11 @@
  89.235 +                 printf("EVAL foul 6\n");
  89.236 +                 act_penalty=MAX(act_penalty,b1hit);
  89.237 +                 act_penalty=MAX(act_penalty,color_to_pot);
  89.238 ++                if (BM_get_white_out()){
  89.239 ++                  textObj_setText(last_fault_text, "White ball potted");
  89.240 ++                } else {
  89.241 ++                  textObj_setText(last_fault_text, "Potted ball was not the correct one");
  89.242 ++                }
  89.243 +             }
  89.244 +         }
  89.245 +         if(!foul && act_score>0) st.to_play++;
  89.246 +@@ -528,6 +583,7 @@
  89.247 +     {
  89.248 +         player[act_player].score += act_score ;
  89.249 +         printf("EVAL no foul\n");
  89.250 ++        textObj_setText(last_fault_text, "x");
  89.251 +     }
  89.252 +     if(act_score==0 || foul)
  89.253 +     {
  89.254 +Index: foobillard-3.0a/src/evaluate_move.h
  89.255 +===================================================================
  89.256 +--- foobillard-3.0a.orig/src/evaluate_move.h	2006-10-12 16:44:24.000000000 +0200
  89.257 ++++ foobillard-3.0a/src/evaluate_move.h	2006-10-12 16:44:31.000000000 +0200
  89.258 +@@ -31,6 +31,7 @@
  89.259 +                                     BallsType * pballs, int * pqueue_view, float * pXque );
  89.260 + #endif
  89.261 + 
  89.262 ++extern textObj * last_fault_text;
  89.263 + 
  89.264 + void evaluate_last_move_8ball    ( struct Player * player, int * actual_player,
  89.265 +                                    BallsType * pballs, int * pqueue_view, float * pXque );
    90.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    90.2 +++ b/foobillard/stuff/patches/06_show_ball_to_hit	Thu May 10 21:12:00 2018 +0300
    90.3 @@ -0,0 +1,255 @@
    90.4 +Index: foobillard-3.0a/src/billard.c
    90.5 +===================================================================
    90.6 +--- foobillard-3.0a.orig/src/billard.c	2006-10-12 16:45:04.000000000 +0200
    90.7 ++++ foobillard-3.0a/src/billard.c	2006-10-12 16:45:23.000000000 +0200
    90.8 +@@ -31,6 +31,8 @@
    90.9 + void * (*billard_malloc)( size_t size ) = malloc;
   90.10 + void (*billard_free)( void * ptr ) = free;
   90.11 + 
   90.12 ++SnookerState snooker_state={SN_PLAY_RED};
   90.13 ++
   90.14 + void setfunc_create_scene( void (*func)( BallsType * balls ) )
   90.15 + {
   90.16 +     create_scene=func;
   90.17 +Index: foobillard-3.0a/src/billard.h
   90.18 +===================================================================
   90.19 +--- foobillard-3.0a.orig/src/billard.h	2006-10-12 16:45:05.000000000 +0200
   90.20 ++++ foobillard-3.0a/src/billard.h	2006-10-12 16:45:23.000000000 +0200
   90.21 +@@ -76,9 +76,30 @@
   90.22 + #define BALL_HALF 2
   90.23 + #define BALL_ANY  0
   90.24 + 
   90.25 ++typedef enum
   90.26 ++{
   90.27 ++   SN_PLAY_RED,
   90.28 ++   SN_PLAY_ANY_COLOR,
   90.29 ++   SN_PLAY_YELLOW,
   90.30 ++   SN_PLAY_GREEN,
   90.31 ++   SN_PLAY_BROWN,
   90.32 ++   SN_PLAY_BLUE,
   90.33 ++   SN_PLAY_PINK,
   90.34 ++   SN_PLAY_BLACK,
   90.35 ++   SN_DONE
   90.36 ++}
   90.37 ++SnookerBallToPlay;
   90.38 ++
   90.39 ++typedef struct
   90.40 ++{
   90.41 ++   SnookerBallToPlay to_play;
   90.42 ++}
   90.43 ++SnookerState;
   90.44 ++
   90.45 + #ifndef BILLARD_C
   90.46 + extern void (*create_scene)( BallsType * balls );
   90.47 + extern void (*create_walls)( BordersType * walls );
   90.48 ++extern SnookerState snooker_state;
   90.49 + #endif
   90.50 + 
   90.51 + void create_0hole_walls( BordersType * walls );   /* carambol */
   90.52 +Index: foobillard-3.0a/src/billard3d.c
   90.53 +===================================================================
   90.54 +--- foobillard-3.0a.orig/src/billard3d.c	2006-10-12 16:45:08.000000000 +0200
   90.55 ++++ foobillard-3.0a/src/billard3d.c	2006-10-12 16:45:23.000000000 +0200
   90.56 +@@ -829,6 +829,7 @@
   90.57 +         player[act_player].place_cue_ball=1;
   90.58 +         human_player_roster.player[0].cue_ball=0;   human_player_roster.player[1].cue_ball=0;
   90.59 +         human_player_roster.player[act_player].place_cue_ball=1;
   90.60 ++        snooker_state.to_play=SN_PLAY_RED;
   90.61 +     }
   90.62 + }
   90.63 + 
   90.64 +@@ -1787,6 +1788,7 @@
   90.65 +            /* score text */
   90.66 +            for(i=0;i<2;i++){
   90.67 +                char str[256];
   90.68 ++               char *color;
   90.69 +                switch(gametype){
   90.70 +                case GAME_8BALL: strcpy(str,"0"); break;
   90.71 +                case GAME_9BALL:
   90.72 +@@ -1805,7 +1807,44 @@
   90.73 +                    sprintf( str, "%d", player[i].score );
   90.74 +                    break;
   90.75 +                case GAME_SNOOKER:
   90.76 +-                   sprintf( str, "%c%03d  %s", (player[i].score<0)?'-':'+', abs(player[i].score), player[i].snooker_on_red ? "red":"col" );
   90.77 ++                   switch(snooker_state.to_play)
   90.78 ++                   {
   90.79 ++                   case SN_PLAY_RED:
   90.80 ++                       color="red";
   90.81 ++                       break;
   90.82 ++                   case SN_PLAY_ANY_COLOR:
   90.83 ++                       color="color";
   90.84 ++                       break;
   90.85 ++                   case SN_PLAY_YELLOW:
   90.86 ++                       color="yellow";
   90.87 ++                       break;
   90.88 ++                   case SN_PLAY_GREEN:
   90.89 ++                       color="green";
   90.90 ++                       break;
   90.91 ++                   case SN_PLAY_BROWN:
   90.92 ++                       color="brown";
   90.93 ++                       break;
   90.94 ++                   case SN_PLAY_BLUE:
   90.95 ++                       color="blue";
   90.96 ++                       break;
   90.97 ++                   case SN_PLAY_PINK:
   90.98 ++                       color="pink";
   90.99 ++                       break;
  90.100 ++                   case SN_PLAY_BLACK:
  90.101 ++                       color="black";
  90.102 ++                       break;
  90.103 ++                   case SN_DONE:
  90.104 ++                       color="";
  90.105 ++                       break;
  90.106 ++                   }
  90.107 ++                   if(i==act_player)
  90.108 ++                   {
  90.109 ++                       sprintf( str, "%.3d  %s", player[i].score, color);
  90.110 ++                   }
  90.111 ++                   else
  90.112 ++                   {
  90.113 ++                       sprintf( str, "%.3d", player[i].score);
  90.114 ++                   }
  90.115 +                    break;
  90.116 +                }
  90.117 +                textObj_setText( player[i].score_text, str );
  90.118 +Index: foobillard-3.0a/src/evaluate_move.c
  90.119 +===================================================================
  90.120 +--- foobillard-3.0a.orig/src/evaluate_move.c	2006-10-12 16:45:12.000000000 +0200
  90.121 ++++ foobillard-3.0a/src/evaluate_move.c	2006-10-12 16:45:23.000000000 +0200
  90.122 +@@ -30,26 +30,6 @@
  90.123 + 
  90.124 + #define MAX(x,y) ((x)>(y)?(x):(y));
  90.125 + 
  90.126 +-typedef enum
  90.127 +-{
  90.128 +-   SN_PLAY_RED,
  90.129 +-   SN_PLAY_ANY_COLOR,
  90.130 +-   SN_PLAY_YELLOW,
  90.131 +-   SN_PLAY_GREEN,
  90.132 +-   SN_PLAY_BROWN,
  90.133 +-   SN_PLAY_BLUE,
  90.134 +-   SN_PLAY_PINK,
  90.135 +-   SN_PLAY_BLACK,
  90.136 +-   SN_DONE
  90.137 +-}
  90.138 +-SnookerBallToPlay;
  90.139 +-
  90.140 +-typedef struct
  90.141 +-{
  90.142 +-   SnookerBallToPlay to_play;
  90.143 +-}
  90.144 +-SnookerState;
  90.145 +-
  90.146 + 
  90.147 + void spot_snooker_ball(BallsType *balls,int nr);
  90.148 + 
  90.149 +@@ -400,7 +380,6 @@
  90.150 + #define act_player (*pact_player)
  90.151 + #define IS_RED(x) ( x==1 || x>=8 )
  90.152 +     int red_balls_are_in_game=0;
  90.153 +-    static SnookerState st={SN_PLAY_RED};
  90.154 +     int color_to_pot;
  90.155 +     int i;
  90.156 +     int act_score=0;
  90.157 +@@ -409,7 +388,7 @@
  90.158 +     int ball_out;
  90.159 +     int other_player=(act_player==1)?0:1;
  90.160 +     int b1hit = BM_get_1st_ball_hit();  if (b1hit>=8) b1hit=1;
  90.161 +-    if(st.to_play==SN_DONE)
  90.162 ++    if(snooker_state.to_play==SN_DONE)
  90.163 +     {
  90.164 +         BM_reset_move_info();
  90.165 +         return;
  90.166 +@@ -417,7 +396,7 @@
  90.167 + 
  90.168 +     if( player[act_player].place_cue_ball ) player[act_player].place_cue_ball=0;
  90.169 +     printf("EVAL start\n");
  90.170 +-    printf("EVAL to_play=%d\n",st.to_play);
  90.171 ++    printf("EVAL to_play=%d\n",snooker_state.to_play);
  90.172 +     printf("EVAL b1hit=%d\n",b1hit);
  90.173 +     for(i=0;i<pballs->nr;i++){
  90.174 +         if( IS_RED(pballs->ball[i].nr) && pballs->ball[i].in_game ){
  90.175 +@@ -436,7 +415,7 @@
  90.176 +         textObj_setText(last_fault_text, "White ball is potted");
  90.177 +     }
  90.178 + 
  90.179 +-    switch(st.to_play)
  90.180 ++    switch(snooker_state.to_play)
  90.181 +     {
  90.182 +     case SN_PLAY_RED:
  90.183 +         color_to_pot=1;
  90.184 +@@ -476,7 +455,7 @@
  90.185 +             if( BM_get_ball_out(i))
  90.186 +                 spot_snooker_ball(pballs,i);
  90.187 +         }
  90.188 +-        st.to_play=SN_PLAY_ANY_COLOR;
  90.189 ++        snooker_state.to_play=SN_PLAY_ANY_COLOR;
  90.190 +         break;
  90.191 +     case SN_PLAY_ANY_COLOR:
  90.192 +         if(b1hit==1)
  90.193 +@@ -512,9 +491,9 @@
  90.194 +             }
  90.195 +         }
  90.196 +         if(red_balls_are_in_game)
  90.197 +-            st.to_play=SN_PLAY_RED;
  90.198 ++            snooker_state.to_play=SN_PLAY_RED;
  90.199 +         else
  90.200 +-            st.to_play=SN_PLAY_YELLOW;
  90.201 ++            snooker_state.to_play=SN_PLAY_YELLOW;
  90.202 + 
  90.203 +         for(i=2;i<8;i++)
  90.204 +         {
  90.205 +@@ -528,7 +507,7 @@
  90.206 +     case SN_PLAY_BLUE:
  90.207 +     case SN_PLAY_PINK:
  90.208 +     case SN_PLAY_BLACK:
  90.209 +-        color_to_pot=st.to_play;
  90.210 ++        color_to_pot=snooker_state.to_play;
  90.211 +         if(b1hit!=color_to_pot)
  90.212 +         {
  90.213 +             foul=1;
  90.214 +@@ -562,9 +541,9 @@
  90.215 +                 }
  90.216 +             }
  90.217 +         }
  90.218 +-        if(!foul && act_score>0) st.to_play++;
  90.219 ++        if(!foul && act_score>0) snooker_state.to_play++;
  90.220 + 
  90.221 +-        for(i=st.to_play;i<8;i++)
  90.222 ++        for(i=snooker_state.to_play;i<8;i++)
  90.223 +         {
  90.224 +             if( BM_get_ball_out(i))
  90.225 +                 spot_snooker_ball(pballs,i);
  90.226 +@@ -590,13 +569,13 @@
  90.227 +         printf("EVAL next player\n");
  90.228 +         if(red_balls_are_in_game)
  90.229 +         {
  90.230 +-            st.to_play=SN_PLAY_RED;
  90.231 ++            snooker_state.to_play=SN_PLAY_RED;
  90.232 +         }
  90.233 +         else
  90.234 +         {
  90.235 +-            if(st.to_play<=SN_PLAY_ANY_COLOR)
  90.236 ++            if(snooker_state.to_play<=SN_PLAY_ANY_COLOR)
  90.237 +             {
  90.238 +-                st.to_play=SN_PLAY_YELLOW;
  90.239 ++                snooker_state.to_play=SN_PLAY_YELLOW;
  90.240 +             }
  90.241 +         }
  90.242 +         player[act_player].queue_view=*pqueue_view;
  90.243 +@@ -605,11 +584,11 @@
  90.244 +         *pqueue_view=player[act_player].queue_view;
  90.245 +     }
  90.246 + 
  90.247 +-    player[act_player].snooker_on_red=st.to_play==SN_PLAY_RED;
  90.248 +-    player[act_player].snooker_next_color=st.to_play;
  90.249 +-    printf("EVAL to_play=%d\n",st.to_play);
  90.250 ++    player[act_player].snooker_on_red=snooker_state.to_play==SN_PLAY_RED;
  90.251 ++    player[act_player].snooker_next_color=snooker_state.to_play;
  90.252 ++    printf("EVAL to_play=%d\n",snooker_state.to_play);
  90.253 + 
  90.254 +-    if(st.to_play==SN_DONE)
  90.255 ++    if(snooker_state.to_play==SN_DONE)
  90.256 +     {
  90.257 +         int other_player;
  90.258 + 
    91.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    91.2 +++ b/foobillard/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    91.3 @@ -0,0 +1,5 @@
    91.4 +-p1|03_bugfixes
    91.5 +-p1|05_foul_explanation
    91.6 +-p1|06_show_ball_to_hit
    91.7 +-p0|snooker_reset.patch
    91.8 +-p0|snooker_draw.patch
    92.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    92.2 +++ b/foobillard/stuff/patches/snooker_draw.patch	Thu May 10 21:12:00 2018 +0300
    92.3 @@ -0,0 +1,48 @@
    92.4 +Index: src/evaluate_move.c
    92.5 +===================================================================
    92.6 +--- src/evaluate_move.c	(revision 6)
    92.7 ++++ src/evaluate_move.c	(working copy)
    92.8 +@@ -602,6 +602,11 @@
    92.9 +             player[act_player].winner=0;
   92.10 +             player[other_player].winner=1;
   92.11 +         }
   92.12 ++        if(player[act_player].score==player[other_player].score) {
   92.13 ++            player[act_player].winner=1;
   92.14 ++            player[other_player].winner=1;
   92.15 ++        }
   92.16 ++
   92.17 +     }
   92.18 + 
   92.19 +     printf("EVAL done\n");
   92.20 +Index: src/billard3d.c
   92.21 +===================================================================
   92.22 +--- src/billard3d.c	(revision 6)
   92.23 ++++ src/billard3d.c	(working copy)
   92.24 +@@ -1760,8 +1760,17 @@
   92.25 +                   options_gamemode==options_gamemode_tournament &&
   92.26 +                   (player[0].winner || player[1].winner) )
   92.27 +                {
   92.28 +-                   tournament_evaluate_last_match( &tournament_state );
   92.29 +-                   tournament_state.wait_for_next_match=1;
   92.30 ++                   if ( player[0].winner == player[1].winner )
   92.31 ++                   { // Draw
   92.32 ++                       restart_game_common();
   92.33 ++                       player[act_player].winner=0;
   92.34 ++                       player[other_player].winner=0;
   92.35 ++                   }
   92.36 ++                   else
   92.37 ++                   {
   92.38 ++                       tournament_evaluate_last_match( &tournament_state );
   92.39 ++                       tournament_state.wait_for_next_match=1;
   92.40 ++                   }
   92.41 +                }
   92.42 +            } else {
   92.43 +                int old_cueball_ind;
   92.44 +@@ -3654,6 +3663,7 @@
   92.45 +     create_walls( &walls );
   92.46 +     create_scene( &balls );
   92.47 +     g_shot_due=1;
   92.48 ++    snooker_state.to_play=SN_PLAY_RED;
   92.49 + }
   92.50 + 
   92.51 + 
    93.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    93.2 +++ b/foobillard/stuff/patches/snooker_reset.patch	Thu May 10 21:12:00 2018 +0300
    93.3 @@ -0,0 +1,11 @@
    93.4 +--- src/billard3d.c	2010-02-27 04:01:40.000000000 -0600
    93.5 ++++ src/billard3d.c	2010-02-27 04:02:59.000000000 -0600
    93.6 +@@ -1219,6 +1219,8 @@
    93.7 +     printf("tournament_state_setup_next_match 7\n");
    93.8 +     queue_view=player[act_player].queue_view;
    93.9 +     printf("tournament_state_setup_next_match 8\n");
   93.10 ++    snooker_state.to_play = SN_PLAY_RED;
   93.11 ++    printf("tournament_state_setup_next_match 9\n");
   93.12 + }
   93.13 + 
   93.14 + void create_players_text()
    94.1 --- a/foobillard/stuff/snooker_draw.patch	Wed May 09 17:03:28 2018 +0300
    94.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    94.3 @@ -1,48 +0,0 @@
    94.4 -Index: src/evaluate_move.c
    94.5 -===================================================================
    94.6 ---- src/evaluate_move.c	(revision 6)
    94.7 -+++ src/evaluate_move.c	(working copy)
    94.8 -@@ -602,6 +602,11 @@
    94.9 -             player[act_player].winner=0;
   94.10 -             player[other_player].winner=1;
   94.11 -         }
   94.12 -+        if(player[act_player].score==player[other_player].score) {
   94.13 -+            player[act_player].winner=1;
   94.14 -+            player[other_player].winner=1;
   94.15 -+        }
   94.16 -+
   94.17 -     }
   94.18 - 
   94.19 -     printf("EVAL done\n");
   94.20 -Index: src/billard3d.c
   94.21 -===================================================================
   94.22 ---- src/billard3d.c	(revision 6)
   94.23 -+++ src/billard3d.c	(working copy)
   94.24 -@@ -1760,8 +1760,17 @@
   94.25 -                   options_gamemode==options_gamemode_tournament &&
   94.26 -                   (player[0].winner || player[1].winner) )
   94.27 -                {
   94.28 --                   tournament_evaluate_last_match( &tournament_state );
   94.29 --                   tournament_state.wait_for_next_match=1;
   94.30 -+                   if ( player[0].winner == player[1].winner )
   94.31 -+                   { // Draw
   94.32 -+                       restart_game_common();
   94.33 -+                       player[act_player].winner=0;
   94.34 -+                       player[other_player].winner=0;
   94.35 -+                   }
   94.36 -+                   else
   94.37 -+                   {
   94.38 -+                       tournament_evaluate_last_match( &tournament_state );
   94.39 -+                       tournament_state.wait_for_next_match=1;
   94.40 -+                   }
   94.41 -                }
   94.42 -            } else {
   94.43 -                int old_cueball_ind;
   94.44 -@@ -3654,6 +3663,7 @@
   94.45 -     create_walls( &walls );
   94.46 -     create_scene( &balls );
   94.47 -     g_shot_due=1;
   94.48 -+    snooker_state.to_play=SN_PLAY_RED;
   94.49 - }
   94.50 - 
   94.51 - 
    95.1 --- a/foobillard/stuff/snooker_reset.patch	Wed May 09 17:03:28 2018 +0300
    95.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    95.3 @@ -1,11 +0,0 @@
    95.4 ---- src/billard3d.c	2010-02-27 04:01:40.000000000 -0600
    95.5 -+++ src/billard3d.c	2010-02-27 04:02:59.000000000 -0600
    95.6 -@@ -1219,6 +1219,8 @@
    95.7 -     printf("tournament_state_setup_next_match 7\n");
    95.8 -     queue_view=player[act_player].queue_view;
    95.9 -     printf("tournament_state_setup_next_match 8\n");
   95.10 -+    snooker_state.to_play = SN_PLAY_RED;
   95.11 -+    printf("tournament_state_setup_next_match 9\n");
   95.12 - }
   95.13 - 
   95.14 - void create_players_text()
    96.1 --- a/freeglut/receipt	Wed May 09 17:03:28 2018 +0300
    96.2 +++ b/freeglut/receipt	Thu May 10 21:12:00 2018 +0300
    96.3 @@ -24,10 +24,6 @@
    96.4  	if [ ! -d $src ]; then mv $PACKAGE-2.6.0 $src; fi
    96.5  
    96.6  	cd $src
    96.7 -	# fixes an issue with the radeon[hd] ATI opensource drivers
    96.8 -	# ref: http://bugs.gentoo.org/show_bug.cgi?id=295163
    96.9 -	patch -p0 -i $stuff/2.6.0-GFX_radeon.patch
   96.10 -#	sed -i 's/-Werror//' configure
   96.11  
   96.12  	./configure $CONFIGURE_ARGS &&
   96.13  #	sed -i '/XF86VMODE/d' config.status
    97.1 --- a/freeglut/stuff/2.6.0-GFX_radeon.patch	Wed May 09 17:03:28 2018 +0300
    97.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
    97.3 @@ -1,28 +0,0 @@
    97.4 -Index: src/freeglut_window.c
    97.5 -===================================================================
    97.6 ---- src/freeglut_window.c	(Revision 832)
    97.7 -+++ src/freeglut_window.c	(Arbeitskopie)
    97.8 -@@ -594,10 +594,9 @@
    97.9 - #if TARGET_HOST_POSIX_X11
   97.10 -     if ( window )
   97.11 -     {
   97.12 --        glXMakeContextCurrent(
   97.13 -+        glXMakeCurrent(
   97.14 -             fgDisplay.Display,
   97.15 -             window->Window.Handle,
   97.16 --            window->Window.Handle,
   97.17 -             window->Window.Context
   97.18 -         );
   97.19 - 
   97.20 -@@ -932,10 +932,9 @@
   97.21 -     XSetWMProtocols( fgDisplay.Display, window->Window.Handle,
   97.22 -                      &fgDisplay.DeleteWindow, 1 );
   97.23 - 
   97.24 --    glXMakeContextCurrent(
   97.25 -+    glXMakeCurrent(
   97.26 -         fgDisplay.Display,
   97.27 -         window->Window.Handle,
   97.28 --        window->Window.Handle,
   97.29 -         window->Window.Context
   97.30 -     );
   97.31 - 
    98.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    98.2 +++ b/freeglut/stuff/patches/2.6.0-GFX_radeon.patch	Thu May 10 21:12:00 2018 +0300
    98.3 @@ -0,0 +1,28 @@
    98.4 +Index: src/freeglut_window.c
    98.5 +===================================================================
    98.6 +--- src/freeglut_window.c	(Revision 832)
    98.7 ++++ src/freeglut_window.c	(Arbeitskopie)
    98.8 +@@ -594,10 +594,9 @@
    98.9 + #if TARGET_HOST_POSIX_X11
   98.10 +     if ( window )
   98.11 +     {
   98.12 +-        glXMakeContextCurrent(
   98.13 ++        glXMakeCurrent(
   98.14 +             fgDisplay.Display,
   98.15 +             window->Window.Handle,
   98.16 +-            window->Window.Handle,
   98.17 +             window->Window.Context
   98.18 +         );
   98.19 + 
   98.20 +@@ -932,10 +932,9 @@
   98.21 +     XSetWMProtocols( fgDisplay.Display, window->Window.Handle,
   98.22 +                      &fgDisplay.DeleteWindow, 1 );
   98.23 + 
   98.24 +-    glXMakeContextCurrent(
   98.25 ++    glXMakeCurrent(
   98.26 +         fgDisplay.Display,
   98.27 +         window->Window.Handle,
   98.28 +-        window->Window.Handle,
   98.29 +         window->Window.Context
   98.30 +     );
   98.31 + 
    99.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
    99.2 +++ b/freeglut/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
    99.3 @@ -0,0 +1,3 @@
    99.4 +# fixes an issue with the radeon[hd] ATI opensource drivers
    99.5 +# ref: http://bugs.gentoo.org/show_bug.cgi?id=295163
    99.6 +-p0|2.6.0-GFX_radeon.patch
   100.1 --- a/fusecloop/receipt	Wed May 09 17:03:28 2018 +0300
   100.2 +++ b/fusecloop/receipt	Thu May 10 21:12:00 2018 +0300
   100.3 @@ -24,7 +24,6 @@
   100.4  		wget -P $SRC $ADVANCECOMP_URL
   100.5  	tar xzf $SRC/$ADVANCECOMP_TARBALL
   100.6  	sed -i 's/dprintf/d_printf/g' *.h *.c
   100.7 -	patch -p0 < $stuff/fusecloop.u
   100.8  	ADVANCECOMP=advancecomp-$ADVANCECOMP_VERSION
   100.9  	cp *.h *.c $ADVANCECOMP
  100.10  	cp create_compressed_fs.c $ADVANCECOMP/redef.cc
   101.1 --- a/fusecloop/stuff/fusecloop.u	Wed May 09 17:03:28 2018 +0300
   101.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   101.3 @@ -1,858 +0,0 @@
   101.4 ---- compressed_loop.h
   101.5 -+++ compressed_loop.h
   101.6 -@@ -41,6 +41,80 @@
   101.7 - /* data_index (num_blocks 64bit pointers, network order)...      */
   101.8 - /* compressed data (gzip block compressed format)...             */
   101.9 - 
  101.10 -+struct cloop_tail
  101.11 -+{
  101.12 -+	u_int32_t table_size;
  101.13 -+	u_int32_t index_size;
  101.14 -+	u_int32_t num_blocks;
  101.15 -+};
  101.16 -+
  101.17 -+struct block_info
  101.18 -+{
  101.19 -+	loff_t offset;		/* 64-bit offsets of compressed block */
  101.20 -+	u_int32_t size;		/* 32-bit compressed block size */
  101.21 -+	u_int32_t optidx;	/* 32-bit index number */
  101.22 -+};
  101.23 -+
  101.24 -+static inline char *build_index(struct block_info *offsets, unsigned long n)
  101.25 -+{
  101.26 -+	u_int32_t *ofs32 = (u_int32_t *) offsets;
  101.27 -+	loff_t    *ofs64 = (loff_t *) offsets;
  101.28 -+	
  101.29 -+	if (ofs32[0] == 0) {
  101.30 -+		if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */
  101.31 -+			while (n--) {
  101.32 -+				offsets[n].offset = __be64_to_cpu(offsets[n].offset);
  101.33 -+				offsets[n].size = ntohl(offsets[n].size);
  101.34 -+			}
  101.35 -+			return (char *) "128BE accelerated knoppix 1.0";
  101.36 -+		}
  101.37 -+		else { /* V2.0 */
  101.38 -+			loff_t last = __be64_to_cpu(ofs64[n]);
  101.39 -+			while (n--) {
  101.40 -+				offsets[n].size = last - 
  101.41 -+					(offsets[n].offset = __be64_to_cpu(ofs64[n])); 
  101.42 -+				last = offsets[n].offset;
  101.43 -+			}
  101.44 -+			return (char *) "64BE v2.0";
  101.45 -+		}
  101.46 -+	}
  101.47 -+	else if (ofs32[1] == 0) { /* V1.0 */
  101.48 -+		loff_t last = __le64_to_cpu(ofs64[n]);
  101.49 -+		while (n--) {
  101.50 -+			offsets[n].size = last - 
  101.51 -+				(offsets[n].offset = __le64_to_cpu(ofs64[n])); 
  101.52 -+			last = offsets[n].offset;
  101.53 -+		}
  101.54 -+		return (char *) "64LE v1.0";
  101.55 -+	}
  101.56 -+	else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */
  101.57 -+		loff_t last = ntohl(ofs32[n]);
  101.58 -+		while (n--) {
  101.59 -+			offsets[n].size = last - 
  101.60 -+				(offsets[n].offset = ntohl(ofs32[n])); 
  101.61 -+			last = offsets[n].offset;
  101.62 -+		}
  101.63 -+		return (char *) "32BE v0.68";
  101.64 -+	}
  101.65 -+	else { /* V3.0 */
  101.66 -+		unsigned long i;
  101.67 -+		loff_t j;
  101.68 -+		
  101.69 -+		for (i = n; i-- != 0; )
  101.70 -+			offsets[i].size = ntohl(ofs32[i]); 
  101.71 -+		for (i = 0, j = sizeof(struct cloop_head); i < n; i++) {
  101.72 -+			offsets[i].offset = j;
  101.73 -+			if (offsets[i].size & 0x80000000) {
  101.74 -+				unsigned long k = offsets[i].size & 0x7FFFFFFF;
  101.75 -+				offsets[i].offset = offsets[k].offset;
  101.76 -+				offsets[i].size = offsets[k].size;
  101.77 -+			}
  101.78 -+			else j += offsets[i].size;
  101.79 -+		}
  101.80 -+		return (char *) "32BE v3.0";
  101.81 -+	}
  101.82 -+}
  101.83 -+
  101.84 - /* Cloop suspend IOCTL */
  101.85 - #define CLOOP_SUSPEND 0x4C07
  101.86 - 
  101.87 -
  101.88 ---- cloopreader.h
  101.89 -+++ cloopreader.h
  101.90 -@@ -33,7 +33,7 @@
  101.91 -     int numblocks;
  101.92 -     ulong blocksize;
  101.93 - 
  101.94 --    loff_t* toc; /* Data index */
  101.95 -+    struct block_info *toc; /* Data index */
  101.96 -     size_t tocsize;
  101.97 - 
  101.98 -     unsigned char* cblock;  /* Compressed block */
  101.99 -
 101.100 ---- cloopreader.c
 101.101 -+++ cloopreader.c
 101.102 -@@ -59,10 +59,32 @@
 101.103 - 
 101.104 -     ALLOC(c->pblock,c->blocksize);
 101.105 - 
 101.106 --    c->tocsize=sizeof *c->toc * (c->numblocks+1); /* One extra address is position of EOF */
 101.107 --    ALLOC(c->toc,c->tocsize);
 101.108 -+    if (c->numblocks + 1 == 0) {
 101.109 -+	struct cloop_tail tail;
 101.110 -+	loff_t end = lseek(c->fh,0,SEEK_END); /* lseek(,-n,SEEK_END) buggy ? */
 101.111 -+	void *p;
 101.112 -+	ulong toclen, len; 
 101.113 - 
 101.114 --    OP(read_all(c->fh,c->toc,c->tocsize));  /* read Data Index */
 101.115 -+	OP(lseek(c->fh, end - sizeof(tail), SEEK_SET)); 
 101.116 -+	OP(read_all(c->fh, &tail, sizeof(tail)));
 101.117 -+	c->numblocks = ntohl(tail.num_blocks);
 101.118 -+	c->tocsize = sizeof(*c->toc) * c->numblocks;
 101.119 -+	len = ntohl(tail.table_size);
 101.120 -+	toclen = (ntohl(tail.index_size) & 255) * c->numblocks;
 101.121 -+	OP(lseek(c->fh, end - sizeof(tail) - len, SEEK_SET));
 101.122 -+        ALLOC(c->toc, sizeof(*c->toc) * c->numblocks);
 101.123 -+        ALLOC(p,len);
 101.124 -+        OP(read_all(c->fh,p,len));  /* read Data Index */
 101.125 -+	if (uncompress((void *)c->toc,&toclen,p,len) != Z_OK)
 101.126 -+		exit(1);
 101.127 -+	free(p);
 101.128 -+    }
 101.129 -+    else {
 101.130 -+	c->tocsize = sizeof(*c->toc) * c->numblocks;
 101.131 -+        ALLOC(c->toc,c->tocsize);
 101.132 -+        OP(read_all(c->fh,c->toc,c->tocsize));  /* read Data Index */
 101.133 -+    }
 101.134 -+    build_index(c->toc, c->numblocks);
 101.135 -     c->cblocksizecur=0;
 101.136 -     c->curblock=-1;
 101.137 -     return 0;
 101.138 -@@ -79,10 +101,10 @@
 101.139 -     if(page>=c->numblocks){errno=EFAULT;return -1;}
 101.140 -     c->curblock=page;
 101.141 - 
 101.142 --    bprintf("Seeking to 0x%Lx\n",btc(c->toc[page]));
 101.143 --    OP(lseek(c->fh,btc(c->toc[page]), SEEK_SET)); 
 101.144 -+    bprintf("Seeking to 0x%Lx\n",c->toc[page].offset);
 101.145 -+    OP(lseek(c->fh,c->toc[page].offset, SEEK_SET)); 
 101.146 - 
 101.147 --    c->cblocksize=btc(c->toc[page+1]) - btc(c->toc[page]);
 101.148 -+    c->cblocksize=c->toc[page].size;
 101.149 -     bprintf("Compressed size=%lu\n",c->cblocksize);
 101.150 -     if(c->cblocksize > c->cblocksizecur){
 101.151 - 	if(c->cblocksizecur)free(c->cblock);
 101.152 -
 101.153 ---- extract_compressed_fs.c
 101.154 -+++ extract_compressed_fs.c
 101.155 -@@ -1,19 +1,23 @@
 101.156 - /* Extracts a filesystem back from a compressed fs file */
 101.157 -+#define _LARGEFILE64_SOURCE
 101.158 - #include "common_header.h"
 101.159 -+#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n"
 101.160 - 
 101.161 - int main(int argc, char *argv[])
 101.162 - {
 101.163 - 	int handle;
 101.164 - 	struct cloop_head head;
 101.165 - 	unsigned int i;
 101.166 -+	unsigned long num_blocks, block_size, zblock_maxsize, lastlen = 0;
 101.167 - 	unsigned char *buffer, *clear_buffer;
 101.168 -+	struct block_info *offsets;
 101.169 - 
 101.170 --	if (argc != 2) {
 101.171 --		fprintf(stderr, "Need filename\n");
 101.172 -+	if (argc < 2 || argv[1][0] == '-') {
 101.173 -+		fprintf(stderr, "Usage: extract_compressed_fs file [--convert-to-v2] > output\n");
 101.174 - 		exit(1);
 101.175 - 	}
 101.176 - 
 101.177 --	handle = open(argv[1], O_RDONLY);
 101.178 -+	handle = open(argv[1], O_RDONLY|O_LARGEFILE);
 101.179 - 	if (handle < 0) {
 101.180 - 		perror("Opening compressed file\n");
 101.181 - 		exit(1);
 101.182 -@@ -24,66 +28,100 @@
 101.183 - 		exit(1);
 101.184 - 	}
 101.185 - 
 101.186 --	buffer = malloc(ntohl(head.block_size) + ntohl(head.block_size)/1000
 101.187 --			+ 12 + 4);
 101.188 --	clear_buffer = malloc(ntohl(head.block_size));
 101.189 --	fprintf(stderr, "%u blocks of size %u. Preamble:\n%s\n", 
 101.190 --		ntohl(head.num_blocks), ntohl(head.block_size), head.preamble);
 101.191 -+	num_blocks = ntohl(head.num_blocks);
 101.192 -+	block_size = ntohl(head.block_size);
 101.193 -+	zblock_maxsize =  block_size + block_size/1000 + 12 + 4;
 101.194 -+	buffer = malloc(zblock_maxsize);
 101.195 -+	clear_buffer = malloc(block_size);
 101.196 - 
 101.197 --	for (i = 0; i < ntohl(head.num_blocks); i++) {
 101.198 --		int currpos;
 101.199 --		unsigned long destlen = ntohl(head.block_size);
 101.200 --		loff_t offset[2];
 101.201 --		unsigned int size;
 101.202 -+	if (num_blocks == (unsigned long) -1) {
 101.203 -+		void *table;
 101.204 -+		struct cloop_tail tail;
 101.205 -+		unsigned long len, table_size;
 101.206 -+		loff_t end = lseek64(handle, 0, SEEK_END);
 101.207 -+		
 101.208 -+		if (lseek64(handle, end - sizeof(tail), SEEK_SET) < 0 ||
 101.209 -+		    read(handle, &tail, sizeof(tail)) != sizeof(tail) ||
 101.210 -+		    lseek64(handle, end - sizeof(tail) - 
 101.211 -+		    	  ntohl(tail.table_size), SEEK_SET) < 0) {
 101.212 -+			perror("Reading tail\n");
 101.213 -+			exit(1);
 101.214 -+		}
 101.215 -+		head.num_blocks = tail.num_blocks;
 101.216 -+		num_blocks = ntohl(head.num_blocks);
 101.217 -+		table_size = ntohl(tail.table_size);
 101.218 -+		table = malloc(table_size);
 101.219 -+		len = i = num_blocks * (ntohl(tail.index_size) & 255);
 101.220 -+		lastlen = ntohl(tail.index_size) / 256;
 101.221 -+		offsets = malloc(num_blocks * sizeof(*offsets));
 101.222 -+		if (!table || !offsets || 
 101.223 -+		    read(handle, table, table_size) != table_size ||
 101.224 -+		    uncompress((void *)offsets, &len, table, table_size) != Z_OK ||
 101.225 -+		    len != i) {
 101.226 -+			perror("Reading index\n");
 101.227 -+			exit(1);
 101.228 -+		}
 101.229 -+		free(table);
 101.230 -+	}
 101.231 -+	else {
 101.232 -+		offsets = malloc(i = num_blocks * sizeof(*offsets));
 101.233 -+		if (!offsets || read(handle, offsets, i) != i) {
 101.234 -+			perror("Reading index\n");
 101.235 -+			exit(1);
 101.236 -+		}
 101.237 -+	}
 101.238 -+	
 101.239 -+	fprintf(stderr, "%lu blocks of size %lu. Preamble:\n%s\n", 
 101.240 -+		num_blocks, block_size, head.preamble);
 101.241 -+	fprintf(stderr, "Index %s.\n", build_index(offsets, num_blocks));
 101.242 -+	
 101.243 -+	if (argc > 2) {
 101.244 -+		unsigned n;
 101.245 -+		loff_t data, offset = ((num_blocks + 1) * sizeof(offset)) + sizeof(head);
 101.246 -+		
 101.247 -+		strcpy(head.preamble, CLOOP_PREAMBLE);
 101.248 -+		write(STDOUT_FILENO, &head, n = sizeof(head));
 101.249 -+		for (i = 0; i < num_blocks; i++) {
 101.250 -+			data = __be64_to_cpu(offset);
 101.251 -+			write(STDOUT_FILENO, &data, sizeof(data));
 101.252 -+			n += sizeof(data);
 101.253 -+			offset += offsets[i].size;
 101.254 -+		}
 101.255 -+		data = __be64_to_cpu(offset);
 101.256 -+		write(STDOUT_FILENO, &data, sizeof(data));
 101.257 -+		for (i = 0; i < num_blocks && lseek64(handle, offsets[i].offset, SEEK_SET) >= 0; i++) {
 101.258 -+			read(handle, buffer, offsets[i].size);
 101.259 -+			write(STDOUT_FILENO, buffer, offsets[i].size);
 101.260 -+			n += offsets[i].size;
 101.261 -+		}
 101.262 -+		n &= 0x1FF;
 101.263 -+		if (n) {
 101.264 -+			memset(buffer, 0, 512);
 101.265 -+			write(STDOUT_FILENO, buffer, 512 - n);
 101.266 -+		}
 101.267 -+		return 0;
 101.268 -+	}
 101.269 -+	
 101.270 -+	for (i = 0; i < num_blocks; i++) {
 101.271 -+		unsigned long destlen = block_size;
 101.272 -+		unsigned int size = offsets[i].size;
 101.273 - 
 101.274 --		read(handle, &offset, 2*sizeof(loff_t));
 101.275 --                lseek(handle, -sizeof(loff_t), SEEK_CUR);
 101.276 --                
 101.277 --		currpos = lseek(handle, 0, SEEK_CUR);
 101.278 --		if (lseek(handle, __be64_to_cpu(offset[0]), SEEK_SET) < 0) {
 101.279 -+		if (lseek64(handle, offsets[i].offset, SEEK_SET) < 0) {
 101.280 - 			fprintf(stderr, "lseek to %Lu: %s\n",
 101.281 --				__be64_to_cpu(offset[0]), strerror(errno));
 101.282 -+				offsets[i].offset, strerror(errno));
 101.283 - 			exit(1);
 101.284 - 		}
 101.285 -                 
 101.286 --                size=__be64_to_cpu(offset[1])-__be64_to_cpu(offset[0]);
 101.287 --		if (size > ntohl(head.block_size) + ntohl(head.block_size)/1000
 101.288 --		    + 12 + 4) {
 101.289 -+		if (size > zblock_maxsize) {
 101.290 - 			fprintf(stderr, 
 101.291 - 				"Size %u for block %u (offset %Lu) too big\n",
 101.292 --				size, i, __be64_to_cpu(offset[0]));
 101.293 -+				size, i, offsets[i].offset);
 101.294 - 			exit(1);
 101.295 - 		}
 101.296 - 		read(handle, buffer, size);
 101.297 --		if (lseek(handle, currpos, SEEK_SET) < 0) {
 101.298 --			perror("seeking");
 101.299 --			exit(1);
 101.300 --		}
 101.301 - 
 101.302 --		fprintf(stderr, "Block %u length %u => %lu\n",
 101.303 --			i, size, destlen);
 101.304 --		if (i == 3) {
 101.305 --			fprintf(stderr,
 101.306 --				"Block head:%02X%02X%02X%02X%02X%02X%02X%02X\n",
 101.307 --				buffer[0],
 101.308 --				buffer[1],
 101.309 --				buffer[2],
 101.310 --				buffer[3],
 101.311 --				buffer[4],
 101.312 --				buffer[5],
 101.313 --				buffer[6],
 101.314 --				buffer[7]);
 101.315 --			fprintf(stderr,
 101.316 --				"Block tail:%02X%02X%02X%02X%02X%02X%02X%02X\n",
 101.317 --				buffer[3063],
 101.318 --				buffer[3064],
 101.319 --				buffer[3065],
 101.320 --				buffer[3066],
 101.321 --				buffer[3067],
 101.322 --				buffer[3068],
 101.323 --				buffer[3069],
 101.324 --				buffer[3070]);
 101.325 --		}
 101.326 -+		fprintf(stderr, "Block %u at %llu length %u",
 101.327 -+			i, offsets[i].offset, size);
 101.328 - 		switch (uncompress(clear_buffer, &destlen,
 101.329 - 				   buffer, size)) {
 101.330 - 		case Z_OK:
 101.331 -@@ -105,12 +143,13 @@
 101.332 - 			fprintf(stderr, "Uncomp: unknown error %u\n", i);
 101.333 - 			exit(1);
 101.334 - 		}
 101.335 --		if (destlen != ntohl(head.block_size)) {
 101.336 --			fprintf(stderr, "Uncomp: bad len %u (%lu not %u)\n", i,
 101.337 --				destlen, ntohl(head.block_size));
 101.338 -+		fprintf(stderr, " => %lu\n", destlen);
 101.339 -+		if (destlen != block_size && i != num_blocks - 1) {
 101.340 -+			fprintf(stderr, "Uncomp: bad len %u (%lu not %lu)\n", i,
 101.341 -+				destlen, block_size);
 101.342 - 			exit(1);
 101.343 - 		}
 101.344 --		write(STDOUT_FILENO, clear_buffer, ntohl(head.block_size));
 101.345 -+		write(STDOUT_FILENO, clear_buffer, (lastlen != 0 && (i+1) == num_blocks) ? lastlen : block_size);
 101.346 - 	}
 101.347 - 	return 0;
 101.348 - }
 101.349 ---- Makefile
 101.350 -+++ Makefile
 101.351 -@@ -1,16 +1,19 @@
 101.352 - PROGNAME=fusecloop
 101.353 - ARCFILES=*.c *.h *.pl Makefile configure README VERSION HELP INSTALL typescript *.cloop COPYING
 101.354 --PROGS=fusecloop cloopreaderdemo extract_compressed_fs
 101.355 -+PROGS=fusecloop cloopreaderdemo extract_compressed_fs create_compressed_fs
 101.356 - FUSECFLAGS=`pkg-config fuse --cflags`
 101.357 - FUSELDFLAGS=`pkg-config fuse --libs` 
 101.358 - 
 101.359 - CFLAGS= -Wall
 101.360 - 
 101.361 --all: fusecloop extract_compressed_fs 
 101.362 -+all: fusecloop extract_compressed_fs create_compressed_fs
 101.363 - 
 101.364 - extract_compressed_fs: extract_compressed_fs.c
 101.365 - 	${CC} ${CFLAGS} ${LDFLAGS} -lz extract_compressed_fs.c -o extract_compressed_fs
 101.366 - 
 101.367 -+create_compressed_fs: create_compressed_fs.c md5sum.c
 101.368 -+	${CC} ${CFLAGS} ${LDFLAGS} -lz create_compressed_fs.c -o create_compressed_fs
 101.369 -+
 101.370 - fusecloop: fusecloop.c cloopreader.o strver debug.o
 101.371 - 	${CC} ${CFLAGS} ${LDFLAGS} -lz cloopreader.o ${FUSECFLAGS} ${FUSELDFLAGS} fusecloop.c debug.o -o fusecloop
 101.372 - 
 101.373 -
 101.374 -
 101.375 ---- md5sum.c
 101.376 -+++ md5sum.c
 101.377 -@@ -0,0 +1,246 @@
 101.378 -+/*
 101.379 -+ * Based on busybox code.
 101.380 -+ *
 101.381 -+ * Compute MD5 checksum of strings according to the
 101.382 -+ * definition of MD5 in RFC 1321 from April 1992.
 101.383 -+ *
 101.384 -+ * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 101.385 -+ *
 101.386 -+ * Copyright (C) 1995-1999 Free Software Foundation, Inc.
 101.387 -+ * Copyright (C) 2001 Manuel Novoa III
 101.388 -+ * Copyright (C) 2003 Glenn L. McGrath
 101.389 -+ * Copyright (C) 2003 Erik Andersen
 101.390 -+ * Copyright (C) 2010 Denys Vlasenko
 101.391 -+ * Copyright (C) 2012 Pascal Bellard
 101.392 -+ *
 101.393 -+ * Licensed under GPLv2 or later
 101.394 -+ */
 101.395 -+
 101.396 -+#define ALIGN1
 101.397 -+
 101.398 -+static uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */
 101.399 -+static uint64_t total64;    /* must be directly before hash[] */
 101.400 -+static uint32_t hash[8];    /* 4 elements for md5, 5 for sha1, 8 for sha256 */
 101.401 -+
 101.402 -+/* Emit a string of hex representation of bytes */
 101.403 -+static char* bin2hex(char *p)
 101.404 -+{
 101.405 -+	static const char bb_hexdigits_upcase[] ALIGN1 = "0123456789abcdef";
 101.406 -+	int count = 16;
 101.407 -+	const char *cp = (const char *) hash;
 101.408 -+	while (count) {
 101.409 -+		unsigned char c = *cp++;
 101.410 -+		/* put lowercase hex digits */
 101.411 -+		*p++ = bb_hexdigits_upcase[c >> 4];
 101.412 -+		*p++ = bb_hexdigits_upcase[c & 0xf];
 101.413 -+		count--;
 101.414 -+	}
 101.415 -+	return p;
 101.416 -+}
 101.417 -+
 101.418 -+//#define rotl32(x,n) (((x) << (n)) | ((x) >> (32 - (n))))
 101.419 -+static uint32_t rotl32(uint32_t x, unsigned n)
 101.420 -+{
 101.421 -+	return (x << n) | (x >> (32 - n));
 101.422 -+}
 101.423 -+
 101.424 -+static void md5_process_block64(void);
 101.425 -+
 101.426 -+/* Feed data through a temporary buffer.
 101.427 -+ * The internal buffer remembers previous data until it has 64
 101.428 -+ * bytes worth to pass on.
 101.429 -+ */
 101.430 -+static void common64_hash(const void *buffer, size_t len)
 101.431 -+{
 101.432 -+	unsigned bufpos = total64 & 63;
 101.433 -+
 101.434 -+	total64 += len;
 101.435 -+
 101.436 -+	while (1) {
 101.437 -+		unsigned remaining = 64 - bufpos;
 101.438 -+		if (remaining > len)
 101.439 -+			remaining = len;
 101.440 -+		/* Copy data into aligned buffer */
 101.441 -+		memcpy(wbuffer + bufpos, buffer, remaining);
 101.442 -+		len -= remaining;
 101.443 -+		buffer = (const char *)buffer + remaining;
 101.444 -+		bufpos += remaining;
 101.445 -+		/* clever way to do "if (bufpos != 64) break; ... ; bufpos = 0;" */
 101.446 -+		bufpos -= 64;
 101.447 -+		if (bufpos != 0)
 101.448 -+			break;
 101.449 -+		/* Buffer is filled up, process it */
 101.450 -+		md5_process_block64();
 101.451 -+		/*bufpos = 0; - already is */
 101.452 -+	}
 101.453 -+}
 101.454 -+
 101.455 -+/* Process the remaining bytes in the buffer */
 101.456 -+static void common64_end(void)
 101.457 -+{
 101.458 -+	unsigned bufpos = total64 & 63;
 101.459 -+	/* Pad the buffer to the next 64-byte boundary with 0x80,0,0,0... */
 101.460 -+	wbuffer[bufpos++] = 0x80;
 101.461 -+
 101.462 -+	/* This loop iterates either once or twice, no more, no less */
 101.463 -+	while (1) {
 101.464 -+		unsigned remaining = 64 - bufpos;
 101.465 -+		memset(wbuffer + bufpos, 0, remaining);
 101.466 -+		/* Do we have enough space for the length count? */
 101.467 -+		if (remaining >= 8) {
 101.468 -+			/* Store the 64-bit counter of bits in the buffer */
 101.469 -+			uint64_t t = total64 << 3;
 101.470 -+			/* wbuffer is suitably aligned for this */
 101.471 -+			*(uint64_t *) (&wbuffer[64 - 8]) = t;
 101.472 -+		}
 101.473 -+		md5_process_block64();
 101.474 -+		if (remaining >= 8)
 101.475 -+			break;
 101.476 -+		bufpos = 0;
 101.477 -+	}
 101.478 -+}
 101.479 -+
 101.480 -+/* These are the four functions used in the four steps of the MD5 algorithm
 101.481 -+ * and defined in the RFC 1321.  The first function is a little bit optimized
 101.482 -+ * (as found in Colin Plumbs public domain implementation).
 101.483 -+ * #define FF(b, c, d) ((b & c) | (~b & d))
 101.484 -+ */
 101.485 -+#undef FF
 101.486 -+#undef FG
 101.487 -+#undef FH
 101.488 -+#undef FI
 101.489 -+#define FF(b, c, d) (d ^ (b & (c ^ d)))
 101.490 -+#define FG(b, c, d) FF(d, b, c)
 101.491 -+#define FH(b, c, d) (b ^ c ^ d)
 101.492 -+#define FI(b, c, d) (c ^ (b | ~d))
 101.493 -+
 101.494 -+/* Hash a single block, 64 bytes long and 4-byte aligned */
 101.495 -+static void md5_process_block64(void)
 101.496 -+{
 101.497 -+	/* Before we start, one word to the strange constants.
 101.498 -+	   They are defined in RFC 1321 as
 101.499 -+	   T[i] = (int)(4294967296.0 * fabs(sin(i))), i=1..64
 101.500 -+	 */
 101.501 -+	static const uint32_t C_array[] = {
 101.502 -+		/* round 1 */
 101.503 -+		0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
 101.504 -+		0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
 101.505 -+		0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
 101.506 -+		0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
 101.507 -+		/* round 2 */
 101.508 -+		0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
 101.509 -+		0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
 101.510 -+		0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
 101.511 -+		0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
 101.512 -+		/* round 3 */
 101.513 -+		0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
 101.514 -+		0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
 101.515 -+		0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,
 101.516 -+		0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
 101.517 -+		/* round 4 */
 101.518 -+		0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
 101.519 -+		0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
 101.520 -+		0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
 101.521 -+		0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391
 101.522 -+	};
 101.523 -+	static const char P_array[] ALIGN1 = {
 101.524 -+		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */
 101.525 -+		1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */
 101.526 -+		5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */
 101.527 -+		0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9  /* 4 */
 101.528 -+	};
 101.529 -+	uint32_t *words = (uint32_t *) wbuffer;
 101.530 -+	uint32_t A = hash[0];
 101.531 -+	uint32_t B = hash[1];
 101.532 -+	uint32_t C = hash[2];
 101.533 -+	uint32_t D = hash[3];
 101.534 -+
 101.535 -+	static const char S_array[] ALIGN1 = {
 101.536 -+		7, 12, 17, 22,
 101.537 -+		5, 9, 14, 20,
 101.538 -+		4, 11, 16, 23,
 101.539 -+		6, 10, 15, 21
 101.540 -+	};
 101.541 -+	const uint32_t *pc;
 101.542 -+	const char *pp;
 101.543 -+	const char *ps;
 101.544 -+	int i;
 101.545 -+	uint32_t temp;
 101.546 -+
 101.547 -+
 101.548 -+	pc = C_array;
 101.549 -+	pp = P_array;
 101.550 -+	ps = S_array - 4;
 101.551 -+
 101.552 -+	for (i = 0; i < 64; i++) {
 101.553 -+		if ((i & 0x0f) == 0)
 101.554 -+			ps += 4;
 101.555 -+		temp = A;
 101.556 -+		switch (i >> 4) {
 101.557 -+		case 0:
 101.558 -+			temp += FF(B, C, D);
 101.559 -+			break;
 101.560 -+		case 1:
 101.561 -+			temp += FG(B, C, D);
 101.562 -+			break;
 101.563 -+		case 2:
 101.564 -+			temp += FH(B, C, D);
 101.565 -+			break;
 101.566 -+		case 3:
 101.567 -+			temp += FI(B, C, D);
 101.568 -+		}
 101.569 -+		temp += words[(int) (*pp++)] + *pc++;
 101.570 -+		temp = rotl32(temp, ps[i & 3]);
 101.571 -+		temp += B;
 101.572 -+		A = D;
 101.573 -+		D = C;
 101.574 -+		C = B;
 101.575 -+		B = temp;
 101.576 -+	}
 101.577 -+	/* Add checksum to the starting values */
 101.578 -+	hash[0] += A;
 101.579 -+	hash[1] += B;
 101.580 -+	hash[2] += C;
 101.581 -+	hash[3] += D;
 101.582 -+
 101.583 -+}
 101.584 -+#undef FF
 101.585 -+#undef FG
 101.586 -+#undef FH
 101.587 -+#undef FI
 101.588 -+
 101.589 -+/* Initialize structure containing state of computation.
 101.590 -+ * (RFC 1321, 3.3: Step 3)
 101.591 -+ */
 101.592 -+static void md5_begin(void)
 101.593 -+{
 101.594 -+	hash[0] = 0x67452301;
 101.595 -+	hash[1] = 0xefcdab89;
 101.596 -+	hash[2] = 0x98badcfe;
 101.597 -+	hash[3] = 0x10325476;
 101.598 -+	total64 = 0;
 101.599 -+}
 101.600 -+
 101.601 -+/* Used also for sha1 and sha256 */
 101.602 -+#define md5_hash common64_hash
 101.603 -+
 101.604 -+/* Process the remaining bytes in the buffer and put result from CTX
 101.605 -+ * in first 16 bytes following RESBUF.  The result is always in little
 101.606 -+ * endian byte order, so that a byte-wise output yields to the wanted
 101.607 -+ * ASCII representation of the message digest.
 101.608 -+ */
 101.609 -+#define md5_end common64_end
 101.610 -+
 101.611 -+typedef struct { char hash[16]; } md5hash;
 101.612 -+
 101.613 -+static md5hash md5sum(uint8_t *buffer, int len) 
 101.614 -+{
 101.615 -+	md5hash val;
 101.616 -+
 101.617 -+	md5_begin();
 101.618 -+	md5_hash(buffer, len);
 101.619 -+	md5_end();
 101.620 -+	memcpy(&val, hash, 16);
 101.621 -+
 101.622 -+	return val;
 101.623 -+}
 101.624 ---- create_compressed_fs.c
 101.625 -+++ create_compressed_fs.c
 101.626 -@@ -0,0 +1,224 @@
 101.627 -+#ifdef FIND_BEST_COMPRESSION
 101.628 -+#include <compress.h>
 101.629 -+extern "C" {
 101.630 -+#include <stdlib.h>
 101.631 -+#include <string.h>
 101.632 -+
 101.633 -+#define ZMAX 12	/* 12 compression levels with libdeflate, not 9 */
 101.634 -+static shrink_t level;
 101.635 -+static int pass, iter;
 101.636 -+static int best_compress(unsigned char *compressed,
 101.637 -+			 unsigned long *compressed_len,
 101.638 -+			 unsigned char *uncompressed,
 101.639 -+			 unsigned long uncompressed_len)
 101.640 -+{
 101.641 -+	int i, j, err;
 101.642 -+	unsigned char *buf[2];
 101.643 -+	unsigned len;
 101.644 -+	unsigned long llen,  best = *compressed_len * 2;
 101.645 -+	static unsigned char *buffer;
 101.646 -+	static unsigned long buffersz;
 101.647 -+
 101.648 -+	if (buffersz < *compressed_len) {
 101.649 -+		if (buffer) free(buffer);
 101.650 -+		buffer = (unsigned char *)  malloc(buffersz = *compressed_len);
 101.651 -+		if (!buffer) return Z_MEM_ERROR;
 101.652 -+	}
 101.653 -+	buf[0] = compressed;
 101.654 -+	buf[1] = buffer;
 101.655 -+	for (i = j = 0; i <= ZMAX+2 && (pass == 0 || i < pass); i++) {
 101.656 -+		llen = len = *compressed_len;
 101.657 -+		if (i >= ZMAX+1) {
 101.658 -+			level.level = (i == ZMAX+1) ? shrink_extra : shrink_insane;
 101.659 -+			err = (compress_zlib(level, buf[j],
 101.660 -+		     		len, uncompressed,
 101.661 -+		     		uncompressed_len)) ? Z_OK : Z_DATA_ERROR;
 101.662 -+		} else {
 101.663 -+			err = compress2(buf[j], &llen, uncompressed,
 101.664 -+				     uncompressed_len, i);
 101.665 -+			len = llen;
 101.666 -+		}
 101.667 -+		if (err != Z_OK) return err;
 101.668 -+		if (len < best) {
 101.669 -+			best = len;
 101.670 -+			j = 1 - j;
 101.671 -+		}
 101.672 -+	}
 101.673 -+	*compressed_len = best;
 101.674 -+	if (j == 0)
 101.675 -+		memcpy(compressed, buffer, best);
 101.676 -+	return err;
 101.677 -+}
 101.678 -+#define compress2(a,b,c,d,e) best_compress(a,b,c,d)
 101.679 -+#endif
 101.680 -+                        
 101.681 -+#include <signal.h>
 101.682 -+
 101.683 -+/* Creates a compressed file */
 101.684 -+#include "common_header.h"
 101.685 -+
 101.686 -+#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V3.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n"
 101.687 -+#define CHUNK 65536
 101.688 -+#define DEFAULT_BLOCKSIZE 65536
 101.689 -+
 101.690 -+static void quit(const char *s)
 101.691 -+{
 101.692 -+	fprintf(stderr, "%s\n", s);
 101.693 -+	exit(1);
 101.694 -+}
 101.695 -+
 101.696 -+static int readblock(unsigned char *buffer, int n)
 101.697 -+{
 101.698 -+	int i;
 101.699 -+	
 101.700 -+	memset(buffer, 0, n);
 101.701 -+	for (i = 0 ; i < n;) {
 101.702 -+		int j = read(STDIN_FILENO, buffer + i, n - i);
 101.703 -+		if (j < 0 && errno == EINTR) continue;
 101.704 -+		if (j <= 0) break;
 101.705 -+		i += j;
 101.706 -+	}
 101.707 -+	return i;
 101.708 -+}
 101.709 -+
 101.710 -+#ifdef FIND_BEST_COMPRESSION
 101.711 -+#include "md5sum.c"
 101.712 -+#endif
 101.713 -+
 101.714 -+static unsigned n;
 101.715 -+static unsigned long lastlen, pos, *block_index;
 101.716 -+static unsigned char *compressed;
 101.717 -+static unsigned long block_size = 0;
 101.718 -+static void flush_index(int sig)
 101.719 -+{
 101.720 -+	static char padding[512];
 101.721 -+	struct cloop_tail tail;
 101.722 -+	unsigned long len;
 101.723 -+
 101.724 -+	fprintf(stderr, "Write index for %lu blocks\n", n);
 101.725 -+	if (block_size >= 0x1000000) lastlen = 0;
 101.726 -+	tail.index_size = ntohl(sizeof(*block_index) + 256*(lastlen % 0xFFffFF));
 101.727 -+	tail.num_blocks = ntohl(n);
 101.728 -+	n *= sizeof(*block_index);
 101.729 -+	len = n + n/1000 + 12;
 101.730 -+	compressed = (unsigned char *) realloc(compressed, len);
 101.731 -+	if (!compressed || compress2(compressed, &len, (unsigned char *) block_index,
 101.732 -+				     n, Z_BEST_SPEED) != Z_OK)
 101.733 -+		quit("Index compression failed");
 101.734 -+	tail.table_size = ntohl(len);
 101.735 -+	pos += len + sizeof(tail);
 101.736 -+	n = pos & 511;
 101.737 -+	if (n) write(STDOUT_FILENO, padding, 512 - n);
 101.738 -+	write(STDOUT_FILENO, compressed, len);
 101.739 -+	write(STDOUT_FILENO, &tail, sizeof(tail));
 101.740 -+	exit(sig != 0);
 101.741 -+}
 101.742 -+
 101.743 -+int main(int argc, char *argv[])
 101.744 -+{
 101.745 -+	struct cloop_head head;
 101.746 -+	unsigned char *uncompressed;
 101.747 -+	unsigned long len;
 101.748 -+	unsigned indexmax, zlenmax;
 101.749 -+#ifdef FIND_BEST_COMPRESSION
 101.750 -+	unsigned i, j, hashmax;
 101.751 -+	md5hash *hash;
 101.752 -+#endif
 101.753 -+	
 101.754 -+#ifdef FIND_BEST_COMPRESSION
 101.755 -+	while (argc > 1) {
 101.756 -+		if (argv[1][0] == '-') {
 101.757 -+			int *p = &pass;
 101.758 -+			switch (argv[1][1]) {
 101.759 -+			case 'i' : p = &iter;
 101.760 -+			case 'n' : *p = atoi(argv[2]);
 101.761 -+				argc -= 2;
 101.762 -+				argv += 2;
 101.763 -+				continue;
 101.764 -+			}
 101.765 -+		}
 101.766 -+		argc--;
 101.767 -+		if (argv[1][0] < '0' || argv[1][0] > '9')
 101.768 -+			quit("Usage : create_compressed_fs [-n <pass>][ -i <iter>] [block size] < input > output");
 101.769 -+#else
 101.770 -+	if (argc > 1) {
 101.771 -+		if (argv[1][0] < '0' || argv[1][0] > '9')
 101.772 -+			quit("Usage : create_compressed_fs [block size] < input > output");
 101.773 -+#endif
 101.774 -+		block_size = atoi(argv[1]);
 101.775 -+	}
 101.776 -+	if (block_size < 4096)
 101.777 -+		block_size = DEFAULT_BLOCKSIZE;
 101.778 -+	fprintf(stderr, "Block size is %lu\n", block_size);
 101.779 -+	zlenmax = block_size + block_size/1000 + 12;
 101.780 -+
 101.781 -+	memset(&head, 0, sizeof(head));
 101.782 -+	strcpy(head.preamble, CLOOP_PREAMBLE);
 101.783 -+	head.num_blocks = -1;
 101.784 -+	head.block_size = htonl(block_size);
 101.785 -+	write(STDOUT_FILENO, &head, sizeof(head));
 101.786 -+	pos = sizeof(head);
 101.787 -+	
 101.788 -+	compressed = (unsigned char *) malloc(zlenmax);
 101.789 -+	uncompressed = (unsigned char *) malloc(block_size);
 101.790 -+	block_index = (unsigned long *) malloc(indexmax = CHUNK);
 101.791 -+#ifdef FIND_BEST_COMPRESSION
 101.792 -+	hash = (md5hash *) malloc(hashmax = CHUNK);
 101.793 -+	if (!compressed || !uncompressed || !block_index || !hash)
 101.794 -+#else
 101.795 -+	if (!compressed || !uncompressed || !block_index)
 101.796 -+#endif
 101.797 -+		quit("Malloc failed");
 101.798 -+	
 101.799 -+	signal(SIGINT,flush_index);
 101.800 -+	signal(SIGQUIT,flush_index);
 101.801 -+	signal(SIGTERM,flush_index);
 101.802 -+
 101.803 -+	for (n = 0; (len = readblock(uncompressed, block_size)) != 0; n++) {
 101.804 -+		lastlen = len;
 101.805 -+		if (n * sizeof(*block_index) >= indexmax) {
 101.806 -+			block_index = (unsigned long *) realloc(block_index,
 101.807 -+							  indexmax += CHUNK);
 101.808 -+			if (!block_index)
 101.809 -+				quit("Realloc");
 101.810 -+		}
 101.811 -+#ifdef FIND_BEST_COMPRESSION
 101.812 -+		if (n * sizeof(*hash) >= hashmax) {
 101.813 -+			hash = (md5hash *) realloc(hash, hashmax += CHUNK);
 101.814 -+			if (!hash)
 101.815 -+				quit("Realloc hash");
 101.816 -+		}
 101.817 -+		hash[n] = md5sum(uncompressed, len);
 101.818 -+		j = 0x7FFFFFFF;
 101.819 -+		if (n < j)
 101.820 -+			j = n;
 101.821 -+		for (i = 0; i < j; i++) {
 101.822 -+			if (* (uint32_t *) &hash[i] == * (uint32_t *) &hash[n]
 101.823 -+			    && !memcmp(&hash[i],&hash[n],sizeof(*hash)))
 101.824 -+				break;
 101.825 -+		}
 101.826 -+		if (i != j) {
 101.827 -+			block_index[n] = ntohl(0x80000000 | i);
 101.828 -+			fprintf(stderr, "Block %u length %lu => duplicate %lu\n",
 101.829 -+				n, block_size, i);
 101.830 -+		}
 101.831 -+		else
 101.832 -+#endif
 101.833 -+		{
 101.834 -+			len = zlenmax;
 101.835 -+			if (compress2(compressed, &len, uncompressed, lastlen, 
 101.836 -+					Z_BEST_SPEED) != Z_OK)
 101.837 -+				quit("Compression failed");
 101.838 -+			fprintf(stderr, "Block %u length %lu => %lu\n",
 101.839 -+				n, block_size, len);
 101.840 -+			write(STDOUT_FILENO, compressed, len);
 101.841 -+			pos += len;
 101.842 -+			block_index[n] = ntohl(len);
 101.843 -+		}
 101.844 -+	}
 101.845 -+	flush_index(0);
 101.846 -+	return 0;
 101.847 -+}
 101.848 -+#ifdef FIND_BEST_COMPRESSION
 101.849 -+}
 101.850 -+#endif
 101.851 ---- fusecloop.c
 101.852 -+++ fusecloop.c
 101.853 -@@ -65,7 +65,7 @@
 101.854 - 	
 101.855 -     memcpy(stbuf,&stb,sizeof stb);
 101.856 -     stbuf->st_mode&=~0222;
 101.857 --    stbuf->st_size = cd.blocksize * cd.numblocks;
 101.858 -+    stbuf->st_size = (loff_t) cd.blocksize * cd.numblocks;
 101.859 -     /*
 101.860 -     stbuf->st_mode = S_IFREG | 0444;
 101.861 -     stbuf->st_nlink = 1;
   102.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   102.2 +++ b/fusecloop/stuff/patches/fusecloop.u	Thu May 10 21:12:00 2018 +0300
   102.3 @@ -0,0 +1,858 @@
   102.4 +--- compressed_loop.h
   102.5 ++++ compressed_loop.h
   102.6 +@@ -41,6 +41,80 @@
   102.7 + /* data_index (num_blocks 64bit pointers, network order)...      */
   102.8 + /* compressed data (gzip block compressed format)...             */
   102.9 + 
  102.10 ++struct cloop_tail
  102.11 ++{
  102.12 ++	u_int32_t table_size;
  102.13 ++	u_int32_t index_size;
  102.14 ++	u_int32_t num_blocks;
  102.15 ++};
  102.16 ++
  102.17 ++struct block_info
  102.18 ++{
  102.19 ++	loff_t offset;		/* 64-bit offsets of compressed block */
  102.20 ++	u_int32_t size;		/* 32-bit compressed block size */
  102.21 ++	u_int32_t optidx;	/* 32-bit index number */
  102.22 ++};
  102.23 ++
  102.24 ++static inline char *build_index(struct block_info *offsets, unsigned long n)
  102.25 ++{
  102.26 ++	u_int32_t *ofs32 = (u_int32_t *) offsets;
  102.27 ++	loff_t    *ofs64 = (loff_t *) offsets;
  102.28 ++	
  102.29 ++	if (ofs32[0] == 0) {
  102.30 ++		if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */
  102.31 ++			while (n--) {
  102.32 ++				offsets[n].offset = __be64_to_cpu(offsets[n].offset);
  102.33 ++				offsets[n].size = ntohl(offsets[n].size);
  102.34 ++			}
  102.35 ++			return (char *) "128BE accelerated knoppix 1.0";
  102.36 ++		}
  102.37 ++		else { /* V2.0 */
  102.38 ++			loff_t last = __be64_to_cpu(ofs64[n]);
  102.39 ++			while (n--) {
  102.40 ++				offsets[n].size = last - 
  102.41 ++					(offsets[n].offset = __be64_to_cpu(ofs64[n])); 
  102.42 ++				last = offsets[n].offset;
  102.43 ++			}
  102.44 ++			return (char *) "64BE v2.0";
  102.45 ++		}
  102.46 ++	}
  102.47 ++	else if (ofs32[1] == 0) { /* V1.0 */
  102.48 ++		loff_t last = __le64_to_cpu(ofs64[n]);
  102.49 ++		while (n--) {
  102.50 ++			offsets[n].size = last - 
  102.51 ++				(offsets[n].offset = __le64_to_cpu(ofs64[n])); 
  102.52 ++			last = offsets[n].offset;
  102.53 ++		}
  102.54 ++		return (char *) "64LE v1.0";
  102.55 ++	}
  102.56 ++	else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */
  102.57 ++		loff_t last = ntohl(ofs32[n]);
  102.58 ++		while (n--) {
  102.59 ++			offsets[n].size = last - 
  102.60 ++				(offsets[n].offset = ntohl(ofs32[n])); 
  102.61 ++			last = offsets[n].offset;
  102.62 ++		}
  102.63 ++		return (char *) "32BE v0.68";
  102.64 ++	}
  102.65 ++	else { /* V3.0 */
  102.66 ++		unsigned long i;
  102.67 ++		loff_t j;
  102.68 ++		
  102.69 ++		for (i = n; i-- != 0; )
  102.70 ++			offsets[i].size = ntohl(ofs32[i]); 
  102.71 ++		for (i = 0, j = sizeof(struct cloop_head); i < n; i++) {
  102.72 ++			offsets[i].offset = j;
  102.73 ++			if (offsets[i].size & 0x80000000) {
  102.74 ++				unsigned long k = offsets[i].size & 0x7FFFFFFF;
  102.75 ++				offsets[i].offset = offsets[k].offset;
  102.76 ++				offsets[i].size = offsets[k].size;
  102.77 ++			}
  102.78 ++			else j += offsets[i].size;
  102.79 ++		}
  102.80 ++		return (char *) "32BE v3.0";
  102.81 ++	}
  102.82 ++}
  102.83 ++
  102.84 + /* Cloop suspend IOCTL */
  102.85 + #define CLOOP_SUSPEND 0x4C07
  102.86 + 
  102.87 +
  102.88 +--- cloopreader.h
  102.89 ++++ cloopreader.h
  102.90 +@@ -33,7 +33,7 @@
  102.91 +     int numblocks;
  102.92 +     ulong blocksize;
  102.93 + 
  102.94 +-    loff_t* toc; /* Data index */
  102.95 ++    struct block_info *toc; /* Data index */
  102.96 +     size_t tocsize;
  102.97 + 
  102.98 +     unsigned char* cblock;  /* Compressed block */
  102.99 +
 102.100 +--- cloopreader.c
 102.101 ++++ cloopreader.c
 102.102 +@@ -59,10 +59,32 @@
 102.103 + 
 102.104 +     ALLOC(c->pblock,c->blocksize);
 102.105 + 
 102.106 +-    c->tocsize=sizeof *c->toc * (c->numblocks+1); /* One extra address is position of EOF */
 102.107 +-    ALLOC(c->toc,c->tocsize);
 102.108 ++    if (c->numblocks + 1 == 0) {
 102.109 ++	struct cloop_tail tail;
 102.110 ++	loff_t end = lseek(c->fh,0,SEEK_END); /* lseek(,-n,SEEK_END) buggy ? */
 102.111 ++	void *p;
 102.112 ++	ulong toclen, len; 
 102.113 + 
 102.114 +-    OP(read_all(c->fh,c->toc,c->tocsize));  /* read Data Index */
 102.115 ++	OP(lseek(c->fh, end - sizeof(tail), SEEK_SET)); 
 102.116 ++	OP(read_all(c->fh, &tail, sizeof(tail)));
 102.117 ++	c->numblocks = ntohl(tail.num_blocks);
 102.118 ++	c->tocsize = sizeof(*c->toc) * c->numblocks;
 102.119 ++	len = ntohl(tail.table_size);
 102.120 ++	toclen = (ntohl(tail.index_size) & 255) * c->numblocks;
 102.121 ++	OP(lseek(c->fh, end - sizeof(tail) - len, SEEK_SET));
 102.122 ++        ALLOC(c->toc, sizeof(*c->toc) * c->numblocks);
 102.123 ++        ALLOC(p,len);
 102.124 ++        OP(read_all(c->fh,p,len));  /* read Data Index */
 102.125 ++	if (uncompress((void *)c->toc,&toclen,p,len) != Z_OK)
 102.126 ++		exit(1);
 102.127 ++	free(p);
 102.128 ++    }
 102.129 ++    else {
 102.130 ++	c->tocsize = sizeof(*c->toc) * c->numblocks;
 102.131 ++        ALLOC(c->toc,c->tocsize);
 102.132 ++        OP(read_all(c->fh,c->toc,c->tocsize));  /* read Data Index */
 102.133 ++    }
 102.134 ++    build_index(c->toc, c->numblocks);
 102.135 +     c->cblocksizecur=0;
 102.136 +     c->curblock=-1;
 102.137 +     return 0;
 102.138 +@@ -79,10 +101,10 @@
 102.139 +     if(page>=c->numblocks){errno=EFAULT;return -1;}
 102.140 +     c->curblock=page;
 102.141 + 
 102.142 +-    bprintf("Seeking to 0x%Lx\n",btc(c->toc[page]));
 102.143 +-    OP(lseek(c->fh,btc(c->toc[page]), SEEK_SET)); 
 102.144 ++    bprintf("Seeking to 0x%Lx\n",c->toc[page].offset);
 102.145 ++    OP(lseek(c->fh,c->toc[page].offset, SEEK_SET)); 
 102.146 + 
 102.147 +-    c->cblocksize=btc(c->toc[page+1]) - btc(c->toc[page]);
 102.148 ++    c->cblocksize=c->toc[page].size;
 102.149 +     bprintf("Compressed size=%lu\n",c->cblocksize);
 102.150 +     if(c->cblocksize > c->cblocksizecur){
 102.151 + 	if(c->cblocksizecur)free(c->cblock);
 102.152 +
 102.153 +--- extract_compressed_fs.c
 102.154 ++++ extract_compressed_fs.c
 102.155 +@@ -1,19 +1,23 @@
 102.156 + /* Extracts a filesystem back from a compressed fs file */
 102.157 ++#define _LARGEFILE64_SOURCE
 102.158 + #include "common_header.h"
 102.159 ++#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V2.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n"
 102.160 + 
 102.161 + int main(int argc, char *argv[])
 102.162 + {
 102.163 + 	int handle;
 102.164 + 	struct cloop_head head;
 102.165 + 	unsigned int i;
 102.166 ++	unsigned long num_blocks, block_size, zblock_maxsize, lastlen = 0;
 102.167 + 	unsigned char *buffer, *clear_buffer;
 102.168 ++	struct block_info *offsets;
 102.169 + 
 102.170 +-	if (argc != 2) {
 102.171 +-		fprintf(stderr, "Need filename\n");
 102.172 ++	if (argc < 2 || argv[1][0] == '-') {
 102.173 ++		fprintf(stderr, "Usage: extract_compressed_fs file [--convert-to-v2] > output\n");
 102.174 + 		exit(1);
 102.175 + 	}
 102.176 + 
 102.177 +-	handle = open(argv[1], O_RDONLY);
 102.178 ++	handle = open(argv[1], O_RDONLY|O_LARGEFILE);
 102.179 + 	if (handle < 0) {
 102.180 + 		perror("Opening compressed file\n");
 102.181 + 		exit(1);
 102.182 +@@ -24,66 +28,100 @@
 102.183 + 		exit(1);
 102.184 + 	}
 102.185 + 
 102.186 +-	buffer = malloc(ntohl(head.block_size) + ntohl(head.block_size)/1000
 102.187 +-			+ 12 + 4);
 102.188 +-	clear_buffer = malloc(ntohl(head.block_size));
 102.189 +-	fprintf(stderr, "%u blocks of size %u. Preamble:\n%s\n", 
 102.190 +-		ntohl(head.num_blocks), ntohl(head.block_size), head.preamble);
 102.191 ++	num_blocks = ntohl(head.num_blocks);
 102.192 ++	block_size = ntohl(head.block_size);
 102.193 ++	zblock_maxsize =  block_size + block_size/1000 + 12 + 4;
 102.194 ++	buffer = malloc(zblock_maxsize);
 102.195 ++	clear_buffer = malloc(block_size);
 102.196 + 
 102.197 +-	for (i = 0; i < ntohl(head.num_blocks); i++) {
 102.198 +-		int currpos;
 102.199 +-		unsigned long destlen = ntohl(head.block_size);
 102.200 +-		loff_t offset[2];
 102.201 +-		unsigned int size;
 102.202 ++	if (num_blocks == (unsigned long) -1) {
 102.203 ++		void *table;
 102.204 ++		struct cloop_tail tail;
 102.205 ++		unsigned long len, table_size;
 102.206 ++		loff_t end = lseek64(handle, 0, SEEK_END);
 102.207 ++		
 102.208 ++		if (lseek64(handle, end - sizeof(tail), SEEK_SET) < 0 ||
 102.209 ++		    read(handle, &tail, sizeof(tail)) != sizeof(tail) ||
 102.210 ++		    lseek64(handle, end - sizeof(tail) - 
 102.211 ++		    	  ntohl(tail.table_size), SEEK_SET) < 0) {
 102.212 ++			perror("Reading tail\n");
 102.213 ++			exit(1);
 102.214 ++		}
 102.215 ++		head.num_blocks = tail.num_blocks;
 102.216 ++		num_blocks = ntohl(head.num_blocks);
 102.217 ++		table_size = ntohl(tail.table_size);
 102.218 ++		table = malloc(table_size);
 102.219 ++		len = i = num_blocks * (ntohl(tail.index_size) & 255);
 102.220 ++		lastlen = ntohl(tail.index_size) / 256;
 102.221 ++		offsets = malloc(num_blocks * sizeof(*offsets));
 102.222 ++		if (!table || !offsets || 
 102.223 ++		    read(handle, table, table_size) != table_size ||
 102.224 ++		    uncompress((void *)offsets, &len, table, table_size) != Z_OK ||
 102.225 ++		    len != i) {
 102.226 ++			perror("Reading index\n");
 102.227 ++			exit(1);
 102.228 ++		}
 102.229 ++		free(table);
 102.230 ++	}
 102.231 ++	else {
 102.232 ++		offsets = malloc(i = num_blocks * sizeof(*offsets));
 102.233 ++		if (!offsets || read(handle, offsets, i) != i) {
 102.234 ++			perror("Reading index\n");
 102.235 ++			exit(1);
 102.236 ++		}
 102.237 ++	}
 102.238 ++	
 102.239 ++	fprintf(stderr, "%lu blocks of size %lu. Preamble:\n%s\n", 
 102.240 ++		num_blocks, block_size, head.preamble);
 102.241 ++	fprintf(stderr, "Index %s.\n", build_index(offsets, num_blocks));
 102.242 ++	
 102.243 ++	if (argc > 2) {
 102.244 ++		unsigned n;
 102.245 ++		loff_t data, offset = ((num_blocks + 1) * sizeof(offset)) + sizeof(head);
 102.246 ++		
 102.247 ++		strcpy(head.preamble, CLOOP_PREAMBLE);
 102.248 ++		write(STDOUT_FILENO, &head, n = sizeof(head));
 102.249 ++		for (i = 0; i < num_blocks; i++) {
 102.250 ++			data = __be64_to_cpu(offset);
 102.251 ++			write(STDOUT_FILENO, &data, sizeof(data));
 102.252 ++			n += sizeof(data);
 102.253 ++			offset += offsets[i].size;
 102.254 ++		}
 102.255 ++		data = __be64_to_cpu(offset);
 102.256 ++		write(STDOUT_FILENO, &data, sizeof(data));
 102.257 ++		for (i = 0; i < num_blocks && lseek64(handle, offsets[i].offset, SEEK_SET) >= 0; i++) {
 102.258 ++			read(handle, buffer, offsets[i].size);
 102.259 ++			write(STDOUT_FILENO, buffer, offsets[i].size);
 102.260 ++			n += offsets[i].size;
 102.261 ++		}
 102.262 ++		n &= 0x1FF;
 102.263 ++		if (n) {
 102.264 ++			memset(buffer, 0, 512);
 102.265 ++			write(STDOUT_FILENO, buffer, 512 - n);
 102.266 ++		}
 102.267 ++		return 0;
 102.268 ++	}
 102.269 ++	
 102.270 ++	for (i = 0; i < num_blocks; i++) {
 102.271 ++		unsigned long destlen = block_size;
 102.272 ++		unsigned int size = offsets[i].size;
 102.273 + 
 102.274 +-		read(handle, &offset, 2*sizeof(loff_t));
 102.275 +-                lseek(handle, -sizeof(loff_t), SEEK_CUR);
 102.276 +-                
 102.277 +-		currpos = lseek(handle, 0, SEEK_CUR);
 102.278 +-		if (lseek(handle, __be64_to_cpu(offset[0]), SEEK_SET) < 0) {
 102.279 ++		if (lseek64(handle, offsets[i].offset, SEEK_SET) < 0) {
 102.280 + 			fprintf(stderr, "lseek to %Lu: %s\n",
 102.281 +-				__be64_to_cpu(offset[0]), strerror(errno));
 102.282 ++				offsets[i].offset, strerror(errno));
 102.283 + 			exit(1);
 102.284 + 		}
 102.285 +                 
 102.286 +-                size=__be64_to_cpu(offset[1])-__be64_to_cpu(offset[0]);
 102.287 +-		if (size > ntohl(head.block_size) + ntohl(head.block_size)/1000
 102.288 +-		    + 12 + 4) {
 102.289 ++		if (size > zblock_maxsize) {
 102.290 + 			fprintf(stderr, 
 102.291 + 				"Size %u for block %u (offset %Lu) too big\n",
 102.292 +-				size, i, __be64_to_cpu(offset[0]));
 102.293 ++				size, i, offsets[i].offset);
 102.294 + 			exit(1);
 102.295 + 		}
 102.296 + 		read(handle, buffer, size);
 102.297 +-		if (lseek(handle, currpos, SEEK_SET) < 0) {
 102.298 +-			perror("seeking");
 102.299 +-			exit(1);
 102.300 +-		}
 102.301 + 
 102.302 +-		fprintf(stderr, "Block %u length %u => %lu\n",
 102.303 +-			i, size, destlen);
 102.304 +-		if (i == 3) {
 102.305 +-			fprintf(stderr,
 102.306 +-				"Block head:%02X%02X%02X%02X%02X%02X%02X%02X\n",
 102.307 +-				buffer[0],
 102.308 +-				buffer[1],
 102.309 +-				buffer[2],
 102.310 +-				buffer[3],
 102.311 +-				buffer[4],
 102.312 +-				buffer[5],
 102.313 +-				buffer[6],
 102.314 +-				buffer[7]);
 102.315 +-			fprintf(stderr,
 102.316 +-				"Block tail:%02X%02X%02X%02X%02X%02X%02X%02X\n",
 102.317 +-				buffer[3063],
 102.318 +-				buffer[3064],
 102.319 +-				buffer[3065],
 102.320 +-				buffer[3066],
 102.321 +-				buffer[3067],
 102.322 +-				buffer[3068],
 102.323 +-				buffer[3069],
 102.324 +-				buffer[3070]);
 102.325 +-		}
 102.326 ++		fprintf(stderr, "Block %u at %llu length %u",
 102.327 ++			i, offsets[i].offset, size);
 102.328 + 		switch (uncompress(clear_buffer, &destlen,
 102.329 + 				   buffer, size)) {
 102.330 + 		case Z_OK:
 102.331 +@@ -105,12 +143,13 @@
 102.332 + 			fprintf(stderr, "Uncomp: unknown error %u\n", i);
 102.333 + 			exit(1);
 102.334 + 		}
 102.335 +-		if (destlen != ntohl(head.block_size)) {
 102.336 +-			fprintf(stderr, "Uncomp: bad len %u (%lu not %u)\n", i,
 102.337 +-				destlen, ntohl(head.block_size));
 102.338 ++		fprintf(stderr, " => %lu\n", destlen);
 102.339 ++		if (destlen != block_size && i != num_blocks - 1) {
 102.340 ++			fprintf(stderr, "Uncomp: bad len %u (%lu not %lu)\n", i,
 102.341 ++				destlen, block_size);
 102.342 + 			exit(1);
 102.343 + 		}
 102.344 +-		write(STDOUT_FILENO, clear_buffer, ntohl(head.block_size));
 102.345 ++		write(STDOUT_FILENO, clear_buffer, (lastlen != 0 && (i+1) == num_blocks) ? lastlen : block_size);
 102.346 + 	}
 102.347 + 	return 0;
 102.348 + }
 102.349 +--- Makefile
 102.350 ++++ Makefile
 102.351 +@@ -1,16 +1,19 @@
 102.352 + PROGNAME=fusecloop
 102.353 + ARCFILES=*.c *.h *.pl Makefile configure README VERSION HELP INSTALL typescript *.cloop COPYING
 102.354 +-PROGS=fusecloop cloopreaderdemo extract_compressed_fs
 102.355 ++PROGS=fusecloop cloopreaderdemo extract_compressed_fs create_compressed_fs
 102.356 + FUSECFLAGS=`pkg-config fuse --cflags`
 102.357 + FUSELDFLAGS=`pkg-config fuse --libs` 
 102.358 + 
 102.359 + CFLAGS= -Wall
 102.360 + 
 102.361 +-all: fusecloop extract_compressed_fs 
 102.362 ++all: fusecloop extract_compressed_fs create_compressed_fs
 102.363 + 
 102.364 + extract_compressed_fs: extract_compressed_fs.c
 102.365 + 	${CC} ${CFLAGS} ${LDFLAGS} -lz extract_compressed_fs.c -o extract_compressed_fs
 102.366 + 
 102.367 ++create_compressed_fs: create_compressed_fs.c md5sum.c
 102.368 ++	${CC} ${CFLAGS} ${LDFLAGS} -lz create_compressed_fs.c -o create_compressed_fs
 102.369 ++
 102.370 + fusecloop: fusecloop.c cloopreader.o strver debug.o
 102.371 + 	${CC} ${CFLAGS} ${LDFLAGS} -lz cloopreader.o ${FUSECFLAGS} ${FUSELDFLAGS} fusecloop.c debug.o -o fusecloop
 102.372 + 
 102.373 +
 102.374 +
 102.375 +--- md5sum.c
 102.376 ++++ md5sum.c
 102.377 +@@ -0,0 +1,246 @@
 102.378 ++/*
 102.379 ++ * Based on busybox code.
 102.380 ++ *
 102.381 ++ * Compute MD5 checksum of strings according to the
 102.382 ++ * definition of MD5 in RFC 1321 from April 1992.
 102.383 ++ *
 102.384 ++ * Written by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1995.
 102.385 ++ *
 102.386 ++ * Copyright (C) 1995-1999 Free Software Foundation, Inc.
 102.387 ++ * Copyright (C) 2001 Manuel Novoa III
 102.388 ++ * Copyright (C) 2003 Glenn L. McGrath
 102.389 ++ * Copyright (C) 2003 Erik Andersen
 102.390 ++ * Copyright (C) 2010 Denys Vlasenko
 102.391 ++ * Copyright (C) 2012 Pascal Bellard
 102.392 ++ *
 102.393 ++ * Licensed under GPLv2 or later
 102.394 ++ */
 102.395 ++
 102.396 ++#define ALIGN1
 102.397 ++
 102.398 ++static uint8_t wbuffer[64]; /* always correctly aligned for uint64_t */
 102.399 ++static uint64_t total64;    /* must be directly before hash[] */
 102.400 ++static uint32_t hash[8];    /* 4 elements for md5, 5 for sha1, 8 for sha256 */
 102.401 ++
 102.402 ++/* Emit a string of hex representation of bytes */
 102.403 ++static char* bin2hex(char *p)
 102.404 ++{
 102.405 ++	static const char bb_hexdigits_upcase[] ALIGN1 = "0123456789abcdef";
 102.406 ++	int count = 16;
 102.407 ++	const char *cp = (const char *) hash;
 102.408 ++	while (count) {
 102.409 ++		unsigned char c = *cp++;
 102.410 ++		/* put lowercase hex digits */
 102.411 ++		*p++ = bb_hexdigits_upcase[c >> 4];
 102.412 ++		*p++ = bb_hexdigits_upcase[c & 0xf];
 102.413 ++		count--;
 102.414 ++	}
 102.415 ++	return p;
 102.416 ++}
 102.417 ++
 102.418 ++//#define rotl32(x,n) (((x) << (n)) | ((x) >> (32 - (n))))
 102.419 ++static uint32_t rotl32(uint32_t x, unsigned n)
 102.420 ++{
 102.421 ++	return (x << n) | (x >> (32 - n));
 102.422 ++}
 102.423 ++
 102.424 ++static void md5_process_block64(void);
 102.425 ++
 102.426 ++/* Feed data through a temporary buffer.
 102.427 ++ * The internal buffer remembers previous data until it has 64
 102.428 ++ * bytes worth to pass on.
 102.429 ++ */
 102.430 ++static void common64_hash(const void *buffer, size_t len)
 102.431 ++{
 102.432 ++	unsigned bufpos = total64 & 63;
 102.433 ++
 102.434 ++	total64 += len;
 102.435 ++
 102.436 ++	while (1) {
 102.437 ++		unsigned remaining = 64 - bufpos;
 102.438 ++		if (remaining > len)
 102.439 ++			remaining = len;
 102.440 ++		/* Copy data into aligned buffer */
 102.441 ++		memcpy(wbuffer + bufpos, buffer, remaining);
 102.442 ++		len -= remaining;
 102.443 ++		buffer = (const char *)buffer + remaining;
 102.444 ++		bufpos += remaining;
 102.445 ++		/* clever way to do "if (bufpos != 64) break; ... ; bufpos = 0;" */
 102.446 ++		bufpos -= 64;
 102.447 ++		if (bufpos != 0)
 102.448 ++			break;
 102.449 ++		/* Buffer is filled up, process it */
 102.450 ++		md5_process_block64();
 102.451 ++		/*bufpos = 0; - already is */
 102.452 ++	}
 102.453 ++}
 102.454 ++
 102.455 ++/* Process the remaining bytes in the buffer */
 102.456 ++static void common64_end(void)
 102.457 ++{
 102.458 ++	unsigned bufpos = total64 & 63;
 102.459 ++	/* Pad the buffer to the next 64-byte boundary with 0x80,0,0,0... */
 102.460 ++	wbuffer[bufpos++] = 0x80;
 102.461 ++
 102.462 ++	/* This loop iterates either once or twice, no more, no less */
 102.463 ++	while (1) {
 102.464 ++		unsigned remaining = 64 - bufpos;
 102.465 ++		memset(wbuffer + bufpos, 0, remaining);
 102.466 ++		/* Do we have enough space for the length count? */
 102.467 ++		if (remaining >= 8) {
 102.468 ++			/* Store the 64-bit counter of bits in the buffer */
 102.469 ++			uint64_t t = total64 << 3;
 102.470 ++			/* wbuffer is suitably aligned for this */
 102.471 ++			*(uint64_t *) (&wbuffer[64 - 8]) = t;
 102.472 ++		}
 102.473 ++		md5_process_block64();
 102.474 ++		if (remaining >= 8)
 102.475 ++			break;
 102.476 ++		bufpos = 0;
 102.477 ++	}
 102.478 ++}
 102.479 ++
 102.480 ++/* These are the four functions used in the four steps of the MD5 algorithm
 102.481 ++ * and defined in the RFC 1321.  The first function is a little bit optimized
 102.482 ++ * (as found in Colin Plumbs public domain implementation).
 102.483 ++ * #define FF(b, c, d) ((b & c) | (~b & d))
 102.484 ++ */
 102.485 ++#undef FF
 102.486 ++#undef FG
 102.487 ++#undef FH
 102.488 ++#undef FI
 102.489 ++#define FF(b, c, d) (d ^ (b & (c ^ d)))
 102.490 ++#define FG(b, c, d) FF(d, b, c)
 102.491 ++#define FH(b, c, d) (b ^ c ^ d)
 102.492 ++#define FI(b, c, d) (c ^ (b | ~d))
 102.493 ++
 102.494 ++/* Hash a single block, 64 bytes long and 4-byte aligned */
 102.495 ++static void md5_process_block64(void)
 102.496 ++{
 102.497 ++	/* Before we start, one word to the strange constants.
 102.498 ++	   They are defined in RFC 1321 as
 102.499 ++	   T[i] = (int)(4294967296.0 * fabs(sin(i))), i=1..64
 102.500 ++	 */
 102.501 ++	static const uint32_t C_array[] = {
 102.502 ++		/* round 1 */
 102.503 ++		0xd76aa478, 0xe8c7b756, 0x242070db, 0xc1bdceee,
 102.504 ++		0xf57c0faf, 0x4787c62a, 0xa8304613, 0xfd469501,
 102.505 ++		0x698098d8, 0x8b44f7af, 0xffff5bb1, 0x895cd7be,
 102.506 ++		0x6b901122, 0xfd987193, 0xa679438e, 0x49b40821,
 102.507 ++		/* round 2 */
 102.508 ++		0xf61e2562, 0xc040b340, 0x265e5a51, 0xe9b6c7aa,
 102.509 ++		0xd62f105d, 0x02441453, 0xd8a1e681, 0xe7d3fbc8,
 102.510 ++		0x21e1cde6, 0xc33707d6, 0xf4d50d87, 0x455a14ed,
 102.511 ++		0xa9e3e905, 0xfcefa3f8, 0x676f02d9, 0x8d2a4c8a,
 102.512 ++		/* round 3 */
 102.513 ++		0xfffa3942, 0x8771f681, 0x6d9d6122, 0xfde5380c,
 102.514 ++		0xa4beea44, 0x4bdecfa9, 0xf6bb4b60, 0xbebfbc70,
 102.515 ++		0x289b7ec6, 0xeaa127fa, 0xd4ef3085, 0x4881d05,
 102.516 ++		0xd9d4d039, 0xe6db99e5, 0x1fa27cf8, 0xc4ac5665,
 102.517 ++		/* round 4 */
 102.518 ++		0xf4292244, 0x432aff97, 0xab9423a7, 0xfc93a039,
 102.519 ++		0x655b59c3, 0x8f0ccc92, 0xffeff47d, 0x85845dd1,
 102.520 ++		0x6fa87e4f, 0xfe2ce6e0, 0xa3014314, 0x4e0811a1,
 102.521 ++		0xf7537e82, 0xbd3af235, 0x2ad7d2bb, 0xeb86d391
 102.522 ++	};
 102.523 ++	static const char P_array[] ALIGN1 = {
 102.524 ++		0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, /* 1 */
 102.525 ++		1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, /* 2 */
 102.526 ++		5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, /* 3 */
 102.527 ++		0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9  /* 4 */
 102.528 ++	};
 102.529 ++	uint32_t *words = (uint32_t *) wbuffer;
 102.530 ++	uint32_t A = hash[0];
 102.531 ++	uint32_t B = hash[1];
 102.532 ++	uint32_t C = hash[2];
 102.533 ++	uint32_t D = hash[3];
 102.534 ++
 102.535 ++	static const char S_array[] ALIGN1 = {
 102.536 ++		7, 12, 17, 22,
 102.537 ++		5, 9, 14, 20,
 102.538 ++		4, 11, 16, 23,
 102.539 ++		6, 10, 15, 21
 102.540 ++	};
 102.541 ++	const uint32_t *pc;
 102.542 ++	const char *pp;
 102.543 ++	const char *ps;
 102.544 ++	int i;
 102.545 ++	uint32_t temp;
 102.546 ++
 102.547 ++
 102.548 ++	pc = C_array;
 102.549 ++	pp = P_array;
 102.550 ++	ps = S_array - 4;
 102.551 ++
 102.552 ++	for (i = 0; i < 64; i++) {
 102.553 ++		if ((i & 0x0f) == 0)
 102.554 ++			ps += 4;
 102.555 ++		temp = A;
 102.556 ++		switch (i >> 4) {
 102.557 ++		case 0:
 102.558 ++			temp += FF(B, C, D);
 102.559 ++			break;
 102.560 ++		case 1:
 102.561 ++			temp += FG(B, C, D);
 102.562 ++			break;
 102.563 ++		case 2:
 102.564 ++			temp += FH(B, C, D);
 102.565 ++			break;
 102.566 ++		case 3:
 102.567 ++			temp += FI(B, C, D);
 102.568 ++		}
 102.569 ++		temp += words[(int) (*pp++)] + *pc++;
 102.570 ++		temp = rotl32(temp, ps[i & 3]);
 102.571 ++		temp += B;
 102.572 ++		A = D;
 102.573 ++		D = C;
 102.574 ++		C = B;
 102.575 ++		B = temp;
 102.576 ++	}
 102.577 ++	/* Add checksum to the starting values */
 102.578 ++	hash[0] += A;
 102.579 ++	hash[1] += B;
 102.580 ++	hash[2] += C;
 102.581 ++	hash[3] += D;
 102.582 ++
 102.583 ++}
 102.584 ++#undef FF
 102.585 ++#undef FG
 102.586 ++#undef FH
 102.587 ++#undef FI
 102.588 ++
 102.589 ++/* Initialize structure containing state of computation.
 102.590 ++ * (RFC 1321, 3.3: Step 3)
 102.591 ++ */
 102.592 ++static void md5_begin(void)
 102.593 ++{
 102.594 ++	hash[0] = 0x67452301;
 102.595 ++	hash[1] = 0xefcdab89;
 102.596 ++	hash[2] = 0x98badcfe;
 102.597 ++	hash[3] = 0x10325476;
 102.598 ++	total64 = 0;
 102.599 ++}
 102.600 ++
 102.601 ++/* Used also for sha1 and sha256 */
 102.602 ++#define md5_hash common64_hash
 102.603 ++
 102.604 ++/* Process the remaining bytes in the buffer and put result from CTX
 102.605 ++ * in first 16 bytes following RESBUF.  The result is always in little
 102.606 ++ * endian byte order, so that a byte-wise output yields to the wanted
 102.607 ++ * ASCII representation of the message digest.
 102.608 ++ */
 102.609 ++#define md5_end common64_end
 102.610 ++
 102.611 ++typedef struct { char hash[16]; } md5hash;
 102.612 ++
 102.613 ++static md5hash md5sum(uint8_t *buffer, int len) 
 102.614 ++{
 102.615 ++	md5hash val;
 102.616 ++
 102.617 ++	md5_begin();
 102.618 ++	md5_hash(buffer, len);
 102.619 ++	md5_end();
 102.620 ++	memcpy(&val, hash, 16);
 102.621 ++
 102.622 ++	return val;
 102.623 ++}
 102.624 +--- create_compressed_fs.c
 102.625 ++++ create_compressed_fs.c
 102.626 +@@ -0,0 +1,224 @@
 102.627 ++#ifdef FIND_BEST_COMPRESSION
 102.628 ++#include <compress.h>
 102.629 ++extern "C" {
 102.630 ++#include <stdlib.h>
 102.631 ++#include <string.h>
 102.632 ++
 102.633 ++#define ZMAX 12	/* 12 compression levels with libdeflate, not 9 */
 102.634 ++static shrink_t level;
 102.635 ++static int pass, iter;
 102.636 ++static int best_compress(unsigned char *compressed,
 102.637 ++			 unsigned long *compressed_len,
 102.638 ++			 unsigned char *uncompressed,
 102.639 ++			 unsigned long uncompressed_len)
 102.640 ++{
 102.641 ++	int i, j, err;
 102.642 ++	unsigned char *buf[2];
 102.643 ++	unsigned len;
 102.644 ++	unsigned long llen,  best = *compressed_len * 2;
 102.645 ++	static unsigned char *buffer;
 102.646 ++	static unsigned long buffersz;
 102.647 ++
 102.648 ++	if (buffersz < *compressed_len) {
 102.649 ++		if (buffer) free(buffer);
 102.650 ++		buffer = (unsigned char *)  malloc(buffersz = *compressed_len);
 102.651 ++		if (!buffer) return Z_MEM_ERROR;
 102.652 ++	}
 102.653 ++	buf[0] = compressed;
 102.654 ++	buf[1] = buffer;
 102.655 ++	for (i = j = 0; i <= ZMAX+2 && (pass == 0 || i < pass); i++) {
 102.656 ++		llen = len = *compressed_len;
 102.657 ++		if (i >= ZMAX+1) {
 102.658 ++			level.level = (i == ZMAX+1) ? shrink_extra : shrink_insane;
 102.659 ++			err = (compress_zlib(level, buf[j],
 102.660 ++		     		len, uncompressed,
 102.661 ++		     		uncompressed_len)) ? Z_OK : Z_DATA_ERROR;
 102.662 ++		} else {
 102.663 ++			err = compress2(buf[j], &llen, uncompressed,
 102.664 ++				     uncompressed_len, i);
 102.665 ++			len = llen;
 102.666 ++		}
 102.667 ++		if (err != Z_OK) return err;
 102.668 ++		if (len < best) {
 102.669 ++			best = len;
 102.670 ++			j = 1 - j;
 102.671 ++		}
 102.672 ++	}
 102.673 ++	*compressed_len = best;
 102.674 ++	if (j == 0)
 102.675 ++		memcpy(compressed, buffer, best);
 102.676 ++	return err;
 102.677 ++}
 102.678 ++#define compress2(a,b,c,d,e) best_compress(a,b,c,d)
 102.679 ++#endif
 102.680 ++                        
 102.681 ++#include <signal.h>
 102.682 ++
 102.683 ++/* Creates a compressed file */
 102.684 ++#include "common_header.h"
 102.685 ++
 102.686 ++#define CLOOP_PREAMBLE "#!/bin/sh\n" "#V3.0 Format\n" "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n" "exit $?\n"
 102.687 ++#define CHUNK 65536
 102.688 ++#define DEFAULT_BLOCKSIZE 65536
 102.689 ++
 102.690 ++static void quit(const char *s)
 102.691 ++{
 102.692 ++	fprintf(stderr, "%s\n", s);
 102.693 ++	exit(1);
 102.694 ++}
 102.695 ++
 102.696 ++static int readblock(unsigned char *buffer, int n)
 102.697 ++{
 102.698 ++	int i;
 102.699 ++	
 102.700 ++	memset(buffer, 0, n);
 102.701 ++	for (i = 0 ; i < n;) {
 102.702 ++		int j = read(STDIN_FILENO, buffer + i, n - i);
 102.703 ++		if (j < 0 && errno == EINTR) continue;
 102.704 ++		if (j <= 0) break;
 102.705 ++		i += j;
 102.706 ++	}
 102.707 ++	return i;
 102.708 ++}
 102.709 ++
 102.710 ++#ifdef FIND_BEST_COMPRESSION
 102.711 ++#include "md5sum.c"
 102.712 ++#endif
 102.713 ++
 102.714 ++static unsigned n;
 102.715 ++static unsigned long lastlen, pos, *block_index;
 102.716 ++static unsigned char *compressed;
 102.717 ++static unsigned long block_size = 0;
 102.718 ++static void flush_index(int sig)
 102.719 ++{
 102.720 ++	static char padding[512];
 102.721 ++	struct cloop_tail tail;
 102.722 ++	unsigned long len;
 102.723 ++
 102.724 ++	fprintf(stderr, "Write index for %lu blocks\n", n);
 102.725 ++	if (block_size >= 0x1000000) lastlen = 0;
 102.726 ++	tail.index_size = ntohl(sizeof(*block_index) + 256*(lastlen % 0xFFffFF));
 102.727 ++	tail.num_blocks = ntohl(n);
 102.728 ++	n *= sizeof(*block_index);
 102.729 ++	len = n + n/1000 + 12;
 102.730 ++	compressed = (unsigned char *) realloc(compressed, len);
 102.731 ++	if (!compressed || compress2(compressed, &len, (unsigned char *) block_index,
 102.732 ++				     n, Z_BEST_SPEED) != Z_OK)
 102.733 ++		quit("Index compression failed");
 102.734 ++	tail.table_size = ntohl(len);
 102.735 ++	pos += len + sizeof(tail);
 102.736 ++	n = pos & 511;
 102.737 ++	if (n) write(STDOUT_FILENO, padding, 512 - n);
 102.738 ++	write(STDOUT_FILENO, compressed, len);
 102.739 ++	write(STDOUT_FILENO, &tail, sizeof(tail));
 102.740 ++	exit(sig != 0);
 102.741 ++}
 102.742 ++
 102.743 ++int main(int argc, char *argv[])
 102.744 ++{
 102.745 ++	struct cloop_head head;
 102.746 ++	unsigned char *uncompressed;
 102.747 ++	unsigned long len;
 102.748 ++	unsigned indexmax, zlenmax;
 102.749 ++#ifdef FIND_BEST_COMPRESSION
 102.750 ++	unsigned i, j, hashmax;
 102.751 ++	md5hash *hash;
 102.752 ++#endif
 102.753 ++	
 102.754 ++#ifdef FIND_BEST_COMPRESSION
 102.755 ++	while (argc > 1) {
 102.756 ++		if (argv[1][0] == '-') {
 102.757 ++			int *p = &pass;
 102.758 ++			switch (argv[1][1]) {
 102.759 ++			case 'i' : p = &iter;
 102.760 ++			case 'n' : *p = atoi(argv[2]);
 102.761 ++				argc -= 2;
 102.762 ++				argv += 2;
 102.763 ++				continue;
 102.764 ++			}
 102.765 ++		}
 102.766 ++		argc--;
 102.767 ++		if (argv[1][0] < '0' || argv[1][0] > '9')
 102.768 ++			quit("Usage : create_compressed_fs [-n <pass>][ -i <iter>] [block size] < input > output");
 102.769 ++#else
 102.770 ++	if (argc > 1) {
 102.771 ++		if (argv[1][0] < '0' || argv[1][0] > '9')
 102.772 ++			quit("Usage : create_compressed_fs [block size] < input > output");
 102.773 ++#endif
 102.774 ++		block_size = atoi(argv[1]);
 102.775 ++	}
 102.776 ++	if (block_size < 4096)
 102.777 ++		block_size = DEFAULT_BLOCKSIZE;
 102.778 ++	fprintf(stderr, "Block size is %lu\n", block_size);
 102.779 ++	zlenmax = block_size + block_size/1000 + 12;
 102.780 ++
 102.781 ++	memset(&head, 0, sizeof(head));
 102.782 ++	strcpy(head.preamble, CLOOP_PREAMBLE);
 102.783 ++	head.num_blocks = -1;
 102.784 ++	head.block_size = htonl(block_size);
 102.785 ++	write(STDOUT_FILENO, &head, sizeof(head));
 102.786 ++	pos = sizeof(head);
 102.787 ++	
 102.788 ++	compressed = (unsigned char *) malloc(zlenmax);
 102.789 ++	uncompressed = (unsigned char *) malloc(block_size);
 102.790 ++	block_index = (unsigned long *) malloc(indexmax = CHUNK);
 102.791 ++#ifdef FIND_BEST_COMPRESSION
 102.792 ++	hash = (md5hash *) malloc(hashmax = CHUNK);
 102.793 ++	if (!compressed || !uncompressed || !block_index || !hash)
 102.794 ++#else
 102.795 ++	if (!compressed || !uncompressed || !block_index)
 102.796 ++#endif
 102.797 ++		quit("Malloc failed");
 102.798 ++	
 102.799 ++	signal(SIGINT,flush_index);
 102.800 ++	signal(SIGQUIT,flush_index);
 102.801 ++	signal(SIGTERM,flush_index);
 102.802 ++
 102.803 ++	for (n = 0; (len = readblock(uncompressed, block_size)) != 0; n++) {
 102.804 ++		lastlen = len;
 102.805 ++		if (n * sizeof(*block_index) >= indexmax) {
 102.806 ++			block_index = (unsigned long *) realloc(block_index,
 102.807 ++							  indexmax += CHUNK);
 102.808 ++			if (!block_index)
 102.809 ++				quit("Realloc");
 102.810 ++		}
 102.811 ++#ifdef FIND_BEST_COMPRESSION
 102.812 ++		if (n * sizeof(*hash) >= hashmax) {
 102.813 ++			hash = (md5hash *) realloc(hash, hashmax += CHUNK);
 102.814 ++			if (!hash)
 102.815 ++				quit("Realloc hash");
 102.816 ++		}
 102.817 ++		hash[n] = md5sum(uncompressed, len);
 102.818 ++		j = 0x7FFFFFFF;
 102.819 ++		if (n < j)
 102.820 ++			j = n;
 102.821 ++		for (i = 0; i < j; i++) {
 102.822 ++			if (* (uint32_t *) &hash[i] == * (uint32_t *) &hash[n]
 102.823 ++			    && !memcmp(&hash[i],&hash[n],sizeof(*hash)))
 102.824 ++				break;
 102.825 ++		}
 102.826 ++		if (i != j) {
 102.827 ++			block_index[n] = ntohl(0x80000000 | i);
 102.828 ++			fprintf(stderr, "Block %u length %lu => duplicate %lu\n",
 102.829 ++				n, block_size, i);
 102.830 ++		}
 102.831 ++		else
 102.832 ++#endif
 102.833 ++		{
 102.834 ++			len = zlenmax;
 102.835 ++			if (compress2(compressed, &len, uncompressed, lastlen, 
 102.836 ++					Z_BEST_SPEED) != Z_OK)
 102.837 ++				quit("Compression failed");
 102.838 ++			fprintf(stderr, "Block %u length %lu => %lu\n",
 102.839 ++				n, block_size, len);
 102.840 ++			write(STDOUT_FILENO, compressed, len);
 102.841 ++			pos += len;
 102.842 ++			block_index[n] = ntohl(len);
 102.843 ++		}
 102.844 ++	}
 102.845 ++	flush_index(0);
 102.846 ++	return 0;
 102.847 ++}
 102.848 ++#ifdef FIND_BEST_COMPRESSION
 102.849 ++}
 102.850 ++#endif
 102.851 +--- fusecloop.c
 102.852 ++++ fusecloop.c
 102.853 +@@ -65,7 +65,7 @@
 102.854 + 	
 102.855 +     memcpy(stbuf,&stb,sizeof stb);
 102.856 +     stbuf->st_mode&=~0222;
 102.857 +-    stbuf->st_size = cd.blocksize * cd.numblocks;
 102.858 ++    stbuf->st_size = (loff_t) cd.blocksize * cd.numblocks;
 102.859 +     /*
 102.860 +     stbuf->st_mode = S_IFREG | 0444;
 102.861 +     stbuf->st_nlink = 1;
   103.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   103.2 +++ b/fusecloop/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   103.3 @@ -0,0 +1,1 @@
   103.4 +-p0|fusecloop.u
   104.1 --- a/genromfs/receipt	Wed May 09 17:03:28 2018 +0300
   104.2 +++ b/genromfs/receipt	Thu May 10 21:12:00 2018 +0300
   104.3 @@ -14,7 +14,7 @@
   104.4  compile_rules()
   104.5  {
   104.6  	sed -i 's|prefix)/man|prefix)/share/man|' Makefile
   104.7 -	patch -p0 < $stuff/genromfs.u
   104.8 +
   104.9  	make &&
  104.10  	make PREFIX=$DESTDIR install
  104.11  }
   105.1 --- a/genromfs/stuff/genromfs.u	Wed May 09 17:03:28 2018 +0300
   105.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   105.3 @@ -1,144 +0,0 @@
   105.4 ---- genromfs.c
   105.5 -+++ genromfs.c
   105.6 -@@ -164,6 +164,7 @@
   105.7 - 	uid_t nuid;
   105.8 - 	gid_t ngid;
   105.9 - 	time_t ntime;
  105.10 -+	nlink_t nlink;
  105.11 - 	unsigned int offset;
  105.12 - 	unsigned int realsize;
  105.13 - 	unsigned int prepad;
  105.14 -@@ -178,6 +179,8 @@
  105.15 - 	int extlen;
  105.16 - };
  105.17 - 
  105.18 -+static int oldromfs = 1;
  105.19 -+
  105.20 - #define EXTTYPE_UNKNOWN 0
  105.21 - #define EXTTYPE_ALIGNMENT 1
  105.22 - #define EXTTYPE_EXCLUDE 2
  105.23 -@@ -361,7 +364,9 @@
  105.24 - 	}
  105.25 - 	len+=16;
  105.26 - 	ri=(struct romfh *)bigbuf;
  105.27 --	if (n->offset)
  105.28 -+	if (!oldromfs) 
  105.29 -+		ri->checksum = ntohl(n->ntime);
  105.30 -+	else if (n->offset)
  105.31 - 		fixsum(ri, len);
  105.32 - 	dumpdata(bigbuf, len, f);
  105.33 - #if 0
  105.34 -@@ -373,6 +378,9 @@
  105.35 - #endif
  105.36 - }
  105.37 - 
  105.38 -+#define SIGNED_OVERFLOW(x,m)  (((x) & (m)) != 0 && (((x) & (m)) | ~(m)) != ~0)
  105.39 -+#define SIGNED_EXTENTION(x,m) (((x) & (((m)+1)>>1)) ? (x) | ~(m) : (x) & (m))  
  105.40 -+
  105.41 - void dumpnode(struct filenode *node, FILE *f)
  105.42 - {
  105.43 - 	struct romfh ri;
  105.44 -@@ -386,13 +394,33 @@
  105.45 - 
  105.46 - 	ri.nextfh = 0;
  105.47 - 	ri.spec = 0;
  105.48 -+	if (!oldromfs) {
  105.49 -+		ri.spec = node->modes & (0x0FFF ^ S_IXUSR);
  105.50 -+		ri.spec ^= S_IRUSR |S_IWUSR;
  105.51 -+		ri.spec |= node->nuid << 20;
  105.52 -+		ri.spec |= (node->ngid & 0xFF) << 12;
  105.53 -+		if (node->ngid & 0x100)
  105.54 -+			ri.spec |= S_IXUSR;  
  105.55 -+		if (SIGNED_OVERFLOW(node->nuid,0xF000)) {
  105.56 -+			printf("%-50s : uid=%04X -> %04X \n",
  105.57 -+				node->realname, node->nuid,
  105.58 -+				(uid_t) SIGNED_EXTENTION(node->nuid,0x0FFF));
  105.59 -+		}
  105.60 -+		if (SIGNED_OVERFLOW(node->ngid,0xFE00)) {
  105.61 -+			printf("%-50s : gid=%04X -> %04X \n",
  105.62 -+				node->realname, node->ngid,
  105.63 -+				(gid_t) SIGNED_EXTENTION(node->ngid,0x01FF));
  105.64 -+		}
  105.65 -+	}
  105.66 -+	ri.spec = htonl(ri.spec);
  105.67 - 	ri.size = htonl(node->realsize);
  105.68 - 	ri.checksum = htonl(0x55555555);
  105.69 - 
  105.70 - 	if (node->next && node->next->next)
  105.71 - 		ri.nextfh = htonl(node->next->offset);
  105.72 - 	if ((node->modes & 0111) &&
  105.73 --	    (S_ISDIR(node->modes) || S_ISREG(node->modes)))
  105.74 -+	    (S_ISDIR(node->modes) || S_ISREG(node->modes) ||
  105.75 -+	     (!oldromfs && (S_ISCHR(node->modes) || S_ISBLK(node->modes)))))
  105.76 - 		ri.nextfh |= htonl(ROMFH_EXEC);
  105.77 - 
  105.78 - 	if (node->orig_link) {
  105.79 -@@ -403,11 +431,17 @@
  105.80 - 		dumpri(&ri, node, f);
  105.81 - 	} else if (S_ISDIR(node->modes)) {
  105.82 - 		ri.nextfh |= htonl(ROMFH_DIR);
  105.83 -+ 		if (!oldromfs)
  105.84 -+			ri.size = ri.spec;
  105.85 - 		if (listisempty(&node->dirlist)) {
  105.86 - 			ri.spec = htonl(node->offset);
  105.87 - 		} else {
  105.88 - 			ri.spec = htonl(node->dirlist.head->offset);
  105.89 - 		}
  105.90 -+		if (node->nlink > 0xf)
  105.91 -+			node->nlink = 0xf;
  105.92 -+		if (!oldromfs)
  105.93 -+			ri.spec |= htonl(node->nlink);
  105.94 - 		dumpri(&ri, node, f);
  105.95 - 	} else if (S_ISLNK(node->modes)) {
  105.96 - 		ri.nextfh |= htonl(ROMFH_LNK);
  105.97 -@@ -464,10 +498,14 @@
  105.98 - 		}
  105.99 - 	} else if (S_ISCHR(node->modes)) {
 105.100 - 		ri.nextfh |= htonl(ROMFH_CHR);
 105.101 -+		if (!oldromfs)
 105.102 -+			ri.size = ri.spec;
 105.103 - 		ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode));
 105.104 - 		dumpri(&ri, node, f);
 105.105 - 	} else if (S_ISBLK(node->modes)) {
 105.106 - 		ri.nextfh |= htonl(ROMFH_BLK);
 105.107 -+		if (!oldromfs)
 105.108 -+			ri.size = ri.spec;
 105.109 - 		ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode));
 105.110 - 		dumpri(&ri, node, f);
 105.111 - 	} else if (S_ISFIFO(node->modes)) {
 105.112 -@@ -522,6 +560,7 @@
 105.113 - 	n->nuid = sb->st_uid;
 105.114 - 	n->ngid = sb->st_gid;
 105.115 - 	n->ntime = sb->st_mtime;
 105.116 -+	n->nlink = sb->st_nlink;
 105.117 - 	n->realsize = 0;
 105.118 - 	/* only regular files and symlinks contain "data" in romfs */
 105.119 - 	if (S_ISREG(n->modes) || S_ISLNK(n->modes)) {
 105.120 -@@ -574,6 +613,9 @@
 105.121 - 	node->ondev = -1;
 105.122 - 	node->onino = -1;
 105.123 - 	node->modes = -1;
 105.124 -+	node->realsize = 0;
 105.125 -+	node->devnode = 0;
 105.126 -+	node->orig_link = NULL;
 105.127 - 	node->offset = curroffset;
 105.128 - 	node->align = DEFALIGN;
 105.129 - 
 105.130 -@@ -935,6 +977,7 @@
 105.131 - 	printf("\n");
 105.132 - 	printf("  -f IMAGE               Output the image into this file\n");
 105.133 - 	printf("  -d DIRECTORY           Use this directory as source\n");
 105.134 -+	printf("  -t                     Time, uid & gid support (backward compatible)\n");
 105.135 - 	printf("  -v                     (Too) verbose operation\n");
 105.136 - 	printf("  -V VOLUME              Use the specified volume name\n");
 105.137 - 	printf("  -a ALIGN               Align regular file data to ALIGN bytes\n");
 105.138 -@@ -971,6 +1014,9 @@
 105.139 - 			break;
 105.140 - 		case 'V':
 105.141 - 			volname = optarg;
 105.142 -+			break;
 105.143 -+		case 't':
 105.144 -+		        oldromfs = 0;
 105.145 - 			break;
 105.146 - 		case 'v':
 105.147 - 			verbose = 1;
   106.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   106.2 +++ b/genromfs/stuff/patches/genromfs.u	Thu May 10 21:12:00 2018 +0300
   106.3 @@ -0,0 +1,144 @@
   106.4 +--- genromfs.c
   106.5 ++++ genromfs.c
   106.6 +@@ -164,6 +164,7 @@
   106.7 + 	uid_t nuid;
   106.8 + 	gid_t ngid;
   106.9 + 	time_t ntime;
  106.10 ++	nlink_t nlink;
  106.11 + 	unsigned int offset;
  106.12 + 	unsigned int realsize;
  106.13 + 	unsigned int prepad;
  106.14 +@@ -178,6 +179,8 @@
  106.15 + 	int extlen;
  106.16 + };
  106.17 + 
  106.18 ++static int oldromfs = 1;
  106.19 ++
  106.20 + #define EXTTYPE_UNKNOWN 0
  106.21 + #define EXTTYPE_ALIGNMENT 1
  106.22 + #define EXTTYPE_EXCLUDE 2
  106.23 +@@ -361,7 +364,9 @@
  106.24 + 	}
  106.25 + 	len+=16;
  106.26 + 	ri=(struct romfh *)bigbuf;
  106.27 +-	if (n->offset)
  106.28 ++	if (!oldromfs) 
  106.29 ++		ri->checksum = ntohl(n->ntime);
  106.30 ++	else if (n->offset)
  106.31 + 		fixsum(ri, len);
  106.32 + 	dumpdata(bigbuf, len, f);
  106.33 + #if 0
  106.34 +@@ -373,6 +378,9 @@
  106.35 + #endif
  106.36 + }
  106.37 + 
  106.38 ++#define SIGNED_OVERFLOW(x,m)  (((x) & (m)) != 0 && (((x) & (m)) | ~(m)) != ~0)
  106.39 ++#define SIGNED_EXTENTION(x,m) (((x) & (((m)+1)>>1)) ? (x) | ~(m) : (x) & (m))  
  106.40 ++
  106.41 + void dumpnode(struct filenode *node, FILE *f)
  106.42 + {
  106.43 + 	struct romfh ri;
  106.44 +@@ -386,13 +394,33 @@
  106.45 + 
  106.46 + 	ri.nextfh = 0;
  106.47 + 	ri.spec = 0;
  106.48 ++	if (!oldromfs) {
  106.49 ++		ri.spec = node->modes & (0x0FFF ^ S_IXUSR);
  106.50 ++		ri.spec ^= S_IRUSR |S_IWUSR;
  106.51 ++		ri.spec |= node->nuid << 20;
  106.52 ++		ri.spec |= (node->ngid & 0xFF) << 12;
  106.53 ++		if (node->ngid & 0x100)
  106.54 ++			ri.spec |= S_IXUSR;  
  106.55 ++		if (SIGNED_OVERFLOW(node->nuid,0xF000)) {
  106.56 ++			printf("%-50s : uid=%04X -> %04X \n",
  106.57 ++				node->realname, node->nuid,
  106.58 ++				(uid_t) SIGNED_EXTENTION(node->nuid,0x0FFF));
  106.59 ++		}
  106.60 ++		if (SIGNED_OVERFLOW(node->ngid,0xFE00)) {
  106.61 ++			printf("%-50s : gid=%04X -> %04X \n",
  106.62 ++				node->realname, node->ngid,
  106.63 ++				(gid_t) SIGNED_EXTENTION(node->ngid,0x01FF));
  106.64 ++		}
  106.65 ++	}
  106.66 ++	ri.spec = htonl(ri.spec);
  106.67 + 	ri.size = htonl(node->realsize);
  106.68 + 	ri.checksum = htonl(0x55555555);
  106.69 + 
  106.70 + 	if (node->next && node->next->next)
  106.71 + 		ri.nextfh = htonl(node->next->offset);
  106.72 + 	if ((node->modes & 0111) &&
  106.73 +-	    (S_ISDIR(node->modes) || S_ISREG(node->modes)))
  106.74 ++	    (S_ISDIR(node->modes) || S_ISREG(node->modes) ||
  106.75 ++	     (!oldromfs && (S_ISCHR(node->modes) || S_ISBLK(node->modes)))))
  106.76 + 		ri.nextfh |= htonl(ROMFH_EXEC);
  106.77 + 
  106.78 + 	if (node->orig_link) {
  106.79 +@@ -403,11 +431,17 @@
  106.80 + 		dumpri(&ri, node, f);
  106.81 + 	} else if (S_ISDIR(node->modes)) {
  106.82 + 		ri.nextfh |= htonl(ROMFH_DIR);
  106.83 ++ 		if (!oldromfs)
  106.84 ++			ri.size = ri.spec;
  106.85 + 		if (listisempty(&node->dirlist)) {
  106.86 + 			ri.spec = htonl(node->offset);
  106.87 + 		} else {
  106.88 + 			ri.spec = htonl(node->dirlist.head->offset);
  106.89 + 		}
  106.90 ++		if (node->nlink > 0xf)
  106.91 ++			node->nlink = 0xf;
  106.92 ++		if (!oldromfs)
  106.93 ++			ri.spec |= htonl(node->nlink);
  106.94 + 		dumpri(&ri, node, f);
  106.95 + 	} else if (S_ISLNK(node->modes)) {
  106.96 + 		ri.nextfh |= htonl(ROMFH_LNK);
  106.97 +@@ -464,10 +498,14 @@
  106.98 + 		}
  106.99 + 	} else if (S_ISCHR(node->modes)) {
 106.100 + 		ri.nextfh |= htonl(ROMFH_CHR);
 106.101 ++		if (!oldromfs)
 106.102 ++			ri.size = ri.spec;
 106.103 + 		ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode));
 106.104 + 		dumpri(&ri, node, f);
 106.105 + 	} else if (S_ISBLK(node->modes)) {
 106.106 + 		ri.nextfh |= htonl(ROMFH_BLK);
 106.107 ++		if (!oldromfs)
 106.108 ++			ri.size = ri.spec;
 106.109 + 		ri.spec = htonl(major(node->devnode)<<16|minor(node->devnode));
 106.110 + 		dumpri(&ri, node, f);
 106.111 + 	} else if (S_ISFIFO(node->modes)) {
 106.112 +@@ -522,6 +560,7 @@
 106.113 + 	n->nuid = sb->st_uid;
 106.114 + 	n->ngid = sb->st_gid;
 106.115 + 	n->ntime = sb->st_mtime;
 106.116 ++	n->nlink = sb->st_nlink;
 106.117 + 	n->realsize = 0;
 106.118 + 	/* only regular files and symlinks contain "data" in romfs */
 106.119 + 	if (S_ISREG(n->modes) || S_ISLNK(n->modes)) {
 106.120 +@@ -574,6 +613,9 @@
 106.121 + 	node->ondev = -1;
 106.122 + 	node->onino = -1;
 106.123 + 	node->modes = -1;
 106.124 ++	node->realsize = 0;
 106.125 ++	node->devnode = 0;
 106.126 ++	node->orig_link = NULL;
 106.127 + 	node->offset = curroffset;
 106.128 + 	node->align = DEFALIGN;
 106.129 + 
 106.130 +@@ -935,6 +977,7 @@
 106.131 + 	printf("\n");
 106.132 + 	printf("  -f IMAGE               Output the image into this file\n");
 106.133 + 	printf("  -d DIRECTORY           Use this directory as source\n");
 106.134 ++	printf("  -t                     Time, uid & gid support (backward compatible)\n");
 106.135 + 	printf("  -v                     (Too) verbose operation\n");
 106.136 + 	printf("  -V VOLUME              Use the specified volume name\n");
 106.137 + 	printf("  -a ALIGN               Align regular file data to ALIGN bytes\n");
 106.138 +@@ -971,6 +1014,9 @@
 106.139 + 			break;
 106.140 + 		case 'V':
 106.141 + 			volname = optarg;
 106.142 ++			break;
 106.143 ++		case 't':
 106.144 ++		        oldromfs = 0;
 106.145 + 			break;
 106.146 + 		case 'v':
 106.147 + 			verbose = 1;
   107.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   107.2 +++ b/genromfs/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   107.3 @@ -0,0 +1,1 @@
   107.4 +-p0|genromfs.u
   108.1 --- a/ghex/receipt	Wed May 09 17:03:28 2018 +0300
   108.2 +++ b/ghex/receipt	Thu May 10 21:12:00 2018 +0300
   108.3 @@ -18,9 +18,6 @@
   108.4  compile_rules() {
   108.5  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lm"
   108.6  
   108.7 -	# GHex2 cannot display help without Yelp.  Removing help references.
   108.8 -	patch -Np1 -i $stuff/ghex2-remove-help.patch
   108.9 -
  108.10  	./configure \
  108.11  		--disable-schemas-install \
  108.12  		--disable-scrollkeeper \
   109.1 --- a/ghex/stuff/ghex2-remove-help.patch	Wed May 09 17:03:28 2018 +0300
   109.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   109.3 @@ -1,24 +0,0 @@
   109.4 ---- a/src/preferences.c
   109.5 -+++ b/src/preferences.c
   109.6 -@@ -74,10 +74,6 @@
   109.7 - 						   GTK_STOCK_CLOSE,
   109.8 - 						   GTK_RESPONSE_CLOSE);
   109.9 - 
  109.10 --	gtk_dialog_add_button (GTK_DIALOG (pui->pbox),
  109.11 --						   GTK_STOCK_HELP,
  109.12 --						   GTK_RESPONSE_HELP);
  109.13 --
  109.14 - 	g_signal_connect(G_OBJECT(pui->pbox), "response",
  109.15 - 					 G_CALLBACK(prefs_response_cb), pui);
  109.16 - 
  109.17 ---- a/src/ghex-ui.xml
  109.18 -+++ b/src/ghex-ui.new
  109.19 -@@ -215,7 +215,7 @@
  109.20 - 
  109.21 - <submenu name="Help" _label="_Help">
  109.22 - 	
  109.23 --	<menuitem name="Help" verb="" _label="_Contents"/>
  109.24 -+	
  109.25 - 
  109.26 -         <menuitem name="About" verb="" _label="_About"/>
  109.27 - 
   110.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   110.2 +++ b/ghex/stuff/patches/ghex2-remove-help.patch	Thu May 10 21:12:00 2018 +0300
   110.3 @@ -0,0 +1,24 @@
   110.4 +--- a/src/preferences.c
   110.5 ++++ b/src/preferences.c
   110.6 +@@ -74,10 +74,6 @@
   110.7 + 						   GTK_STOCK_CLOSE,
   110.8 + 						   GTK_RESPONSE_CLOSE);
   110.9 + 
  110.10 +-	gtk_dialog_add_button (GTK_DIALOG (pui->pbox),
  110.11 +-						   GTK_STOCK_HELP,
  110.12 +-						   GTK_RESPONSE_HELP);
  110.13 +-
  110.14 + 	g_signal_connect(G_OBJECT(pui->pbox), "response",
  110.15 + 					 G_CALLBACK(prefs_response_cb), pui);
  110.16 + 
  110.17 +--- a/src/ghex-ui.xml
  110.18 ++++ b/src/ghex-ui.new
  110.19 +@@ -215,7 +215,7 @@
  110.20 + 
  110.21 + <submenu name="Help" _label="_Help">
  110.22 + 	
  110.23 +-	<menuitem name="Help" verb="" _label="_Contents"/>
  110.24 ++	
  110.25 + 
  110.26 +         <menuitem name="About" verb="" _label="_About"/>
  110.27 + 
   111.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   111.2 +++ b/ghex/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   111.3 @@ -0,0 +1,2 @@
   111.4 +# GHex2 cannot display help without Yelp. Removing help references.
   111.5 +ghex2-remove-help.patch
   112.1 --- a/gmrun/receipt	Wed May 09 17:03:28 2018 +0300
   112.2 +++ b/gmrun/receipt	Thu May 10 21:12:00 2018 +0300
   112.3 @@ -16,15 +16,6 @@
   112.4  # Rules to configure and make the package.
   112.5  compile_rules()
   112.6  {
   112.7 -    cd $src
   112.8 -    while read file; do
   112.9 -        [ -f done.$file ] && continue
  112.10 -        echo "Apply $file..."
  112.11 -        patch -p1 < $stuff/$file || return 1
  112.12 -        touch done.$file
  112.13 -    done <<EOT
  112.14 -gmrun-0.9.2-gcc43.patch
  112.15 -EOT
  112.16      ./configure --prefix=/usr \
  112.17          $CONFIGURE_ARGS &&
  112.18      make &&
   113.1 --- a/gmrun/stuff/gmrun-0.9.2-gcc43.patch	Wed May 09 17:03:28 2018 +0300
   113.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   113.3 @@ -1,51 +0,0 @@
   113.4 ---- gmrun-0.9.2/src/gtkcompletionline.cc.orig	2003-11-16 11:55:07.000000000 +0100
   113.5 -+++ gmrun-0.9.2/src/gtkcompletionline.cc	2008-05-08 08:51:22.000000000 +0200
   113.6 -@@ -29,6 +29,7 @@
   113.7 - #include <set>
   113.8 - #include <sstream>
   113.9 - #include <string>
  113.10 -+#include <cstring>
  113.11 - #include <vector>
  113.12 - using namespace std;
  113.13 - 
  113.14 ---- gmrun-0.9.2/src/ci_string.h.orig	2001-05-16 16:39:31.000000000 +0200
  113.15 -+++ gmrun-0.9.2/src/ci_string.h	2008-05-08 08:51:33.000000000 +0200
  113.16 -@@ -7,6 +7,7 @@
  113.17 - #define __CI_STRING_H__
  113.18 - 
  113.19 - #include <string>
  113.20 -+#include <cstring>
  113.21 - #include <ctype.h>
  113.22 - 
  113.23 - struct ci_char_traits : public std::char_traits<char>
  113.24 ---- gmrun-0.9.2/src/prefs.cc.orig	2002-08-16 12:48:22.000000000 +0200
  113.25 -+++ gmrun-0.9.2/src/prefs.cc	2008-05-08 08:51:54.000000000 +0200
  113.26 -@@ -13,6 +13,7 @@
  113.27 - #include <fstream>
  113.28 - #include <iostream>
  113.29 - #include <stdio.h>
  113.30 -+#include <stdlib.h>
  113.31 - 
  113.32 - #include <list>
  113.33 - 
  113.34 ---- gmrun-0.9.2/src/main.cc.orig	2003-11-16 11:55:07.000000000 +0100
  113.35 -+++ gmrun-0.9.2/src/main.cc	2008-05-08 09:03:11.000000000 +0200
  113.36 -@@ -14,6 +14,7 @@
  113.37 - #include <gdk/gdkkeysyms.h>
  113.38 - 
  113.39 - #include <string>
  113.40 -+#include <cstring>
  113.41 - #include <iostream>
  113.42 - #include <sstream>
  113.43 - #include <vector>
  113.44 ---- gmrun-0.9.2/src/gtkcompletionline.cc.orig	Mon Jun 22 20:36:52 2009
  113.45 -+++ gmrun-0.9.2/src/gtkcompletionline.cc	Mon Jun 22 20:43:37 2009
  113.46 -@@ -377,7 +377,7 @@
  113.47 -   return 0;
  113.48 - }
  113.49 - 
  113.50 --int my_alphasort(const void* va, const void* vb) {
  113.51 -+int my_alphasort(const dirent** va, const dirent** vb) {
  113.52 -   const struct dirent** a = (const struct dirent**)va;
  113.53 -   const struct dirent** b = (const struct dirent**)vb;
  113.54 - 
   114.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   114.2 +++ b/gmrun/stuff/patches/gmrun-0.9.2-gcc43.patch	Thu May 10 21:12:00 2018 +0300
   114.3 @@ -0,0 +1,51 @@
   114.4 +--- gmrun-0.9.2/src/gtkcompletionline.cc.orig	2003-11-16 11:55:07.000000000 +0100
   114.5 ++++ gmrun-0.9.2/src/gtkcompletionline.cc	2008-05-08 08:51:22.000000000 +0200
   114.6 +@@ -29,6 +29,7 @@
   114.7 + #include <set>
   114.8 + #include <sstream>
   114.9 + #include <string>
  114.10 ++#include <cstring>
  114.11 + #include <vector>
  114.12 + using namespace std;
  114.13 + 
  114.14 +--- gmrun-0.9.2/src/ci_string.h.orig	2001-05-16 16:39:31.000000000 +0200
  114.15 ++++ gmrun-0.9.2/src/ci_string.h	2008-05-08 08:51:33.000000000 +0200
  114.16 +@@ -7,6 +7,7 @@
  114.17 + #define __CI_STRING_H__
  114.18 + 
  114.19 + #include <string>
  114.20 ++#include <cstring>
  114.21 + #include <ctype.h>
  114.22 + 
  114.23 + struct ci_char_traits : public std::char_traits<char>
  114.24 +--- gmrun-0.9.2/src/prefs.cc.orig	2002-08-16 12:48:22.000000000 +0200
  114.25 ++++ gmrun-0.9.2/src/prefs.cc	2008-05-08 08:51:54.000000000 +0200
  114.26 +@@ -13,6 +13,7 @@
  114.27 + #include <fstream>
  114.28 + #include <iostream>
  114.29 + #include <stdio.h>
  114.30 ++#include <stdlib.h>
  114.31 + 
  114.32 + #include <list>
  114.33 + 
  114.34 +--- gmrun-0.9.2/src/main.cc.orig	2003-11-16 11:55:07.000000000 +0100
  114.35 ++++ gmrun-0.9.2/src/main.cc	2008-05-08 09:03:11.000000000 +0200
  114.36 +@@ -14,6 +14,7 @@
  114.37 + #include <gdk/gdkkeysyms.h>
  114.38 + 
  114.39 + #include <string>
  114.40 ++#include <cstring>
  114.41 + #include <iostream>
  114.42 + #include <sstream>
  114.43 + #include <vector>
  114.44 +--- gmrun-0.9.2/src/gtkcompletionline.cc.orig	Mon Jun 22 20:36:52 2009
  114.45 ++++ gmrun-0.9.2/src/gtkcompletionline.cc	Mon Jun 22 20:43:37 2009
  114.46 +@@ -377,7 +377,7 @@
  114.47 +   return 0;
  114.48 + }
  114.49 + 
  114.50 +-int my_alphasort(const void* va, const void* vb) {
  114.51 ++int my_alphasort(const dirent** va, const dirent** vb) {
  114.52 +   const struct dirent** a = (const struct dirent**)va;
  114.53 +   const struct dirent** b = (const struct dirent**)vb;
  114.54 + 
   115.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   115.2 +++ b/gmrun/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   115.3 @@ -0,0 +1,1 @@
   115.4 +-p1|gmrun-0.9.2-gcc43.patch
   116.1 --- a/gpxe/receipt	Wed May 09 17:03:28 2018 +0300
   116.2 +++ b/gpxe/receipt	Thu May 10 21:12:00 2018 +0300
   116.3 @@ -17,12 +17,6 @@
   116.4  compile_rules()
   116.5  {
   116.6  	cd $src/src
   116.7 -	for i in prefix.u default_boot.u cmdline.u url_list.u gcc.u; do
   116.8 -		[ -f done.$i ] && continue
   116.9 -		echo "Apply $i..."
  116.10 -		patch -p2 < $stuff/$i || return 1
  116.11 -		touch done.$i
  116.12 -	done
  116.13  	sed -i 's/ = ++ns->cur_rx %/++; ns->cur_rx %=/' drivers/net/ns83820.c
  116.14  	sed -i 's/ = (++tp->cur_rx) %/++; tp->cur_rx %=/' drivers/net/tulip.c
  116.15  	sed -i 's/? s : ___strtok//' core/stringextra.c
   117.1 --- a/gpxe/stuff/cmdline.u	Wed May 09 17:03:28 2018 +0300
   117.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   117.3 @@ -1,204 +0,0 @@
   117.4 ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   117.5 -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   117.6 -@@ -77,7 +77,9 @@
   117.7 - 	popw	%ax
   117.8 - 	addw	$(0x100/16), %ax	/* Adjust cs */
   117.9 - 	pushw	%ax
  117.10 --	jmp	go_setup_code
  117.11 -+	pushw	$run_etherboot_floppy
  117.12 -+	/* Calculated lcall to _start with %cs:0000 = image start */
  117.13 -+	lret
  117.14 - 
  117.15 - bootsector:
  117.16 - 	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  117.17 -@@ -197,7 +199,7 @@
  117.18 - 	 */
  117.19 - 
  117.20 - 	/* Jump to loaded copy */
  117.21 --	ljmp	$SYSSEG, $run_etherboot2
  117.22 -+	ljmp	$SYSSEG, $run_etherboot_floppy
  117.23 - 
  117.24 - endseg:	.word SYSSEG + _load_size_pgh
  117.25 - 	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
  117.26 -@@ -436,8 +438,7 @@
  117.27 - 	 * we just have to ensure that %cs:0000 is where the start of
  117.28 - 	 * the Etherboot image *would* be.
  117.29 - 	 */
  117.30 --go_setup_code: 
  117.31 --	pushw	$run_etherboot
  117.32 -+	pushw	$run_etherboot_zImage
  117.33 - 	/* Calculated lcall to _start with %cs:0000 = image start */
  117.34 - 	lret
  117.35 - 
  117.36 -@@ -448,7 +449,25 @@
  117.37 - /*
  117.38 - 	We're now at the beginning of the kernel proper.
  117.39 -  */
  117.40 --run_etherboot2:
  117.41 -+run_etherboot_zImage:
  117.42 -+	mov	$0x0020, %si
  117.43 -+	lodsw
  117.44 -+	cmp	$0xA33F, %ax
  117.45 -+	jne	run_etherboot
  117.46 -+	lodsw
  117.47 -+	xchg	%ax, %si
  117.48 -+	cmpb	(%si),%ah
  117.49 -+	je	run_etherboot
  117.50 -+	push	%ds
  117.51 -+	pop	%es
  117.52 -+	movw	$boot_url, %di
  117.53 -+copy_cmdline:
  117.54 -+	lodsb
  117.55 -+	stosb
  117.56 -+	or	%al, %al
  117.57 -+	jne	copy_cmdline
  117.58 -+	jmp	run_etherboot
  117.59 -+run_etherboot_floppy:
  117.60 - 	push	%cs
  117.61 - 	pop	%ds
  117.62 - run_etherboot:
  117.63 -
  117.64 ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  117.65 -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  117.66 -@@ -461,6 +461,15 @@
  117.67 - 	push	%ds
  117.68 - 	pop	%es
  117.69 - 	movw	$boot_url, %di
  117.70 -+	cmpw	$0x4F42,(%si) /* skip BOOT_IMAGE=.... */
  117.71 -+	jne	copy_cmdline
  117.72 -+skip_arg:
  117.73 -+	lodsb
  117.74 -+	testb	$0xDF, %al
  117.75 -+	jne	skip_arg
  117.76 -+	or	%al, %al
  117.77 -+	jne	copy_cmdline
  117.78 -+	decw	%si
  117.79 - copy_cmdline:
  117.80 - 	lodsb
  117.81 - 	stosb
  117.82 -
  117.83 ---- gpxe-0.9.3/src/net/udp/dns.c
  117.84 -+++ gpxe-0.9.3/src/net/udp/dns.c
  117.85 -@@ -506,6 +506,19 @@
  117.86 - 	.resolv = dns_resolv,
  117.87 - };
  117.88 - 
  117.89 -+int apply_nameserver(struct in_addr sin_addr)
  117.90 -+{
  117.91 -+	struct sockaddr_in *sin_nameserver;
  117.92 -+
  117.93 -+	sin_nameserver = ( struct sockaddr_in * ) &nameserver;
  117.94 -+	sin_nameserver->sin_family = AF_INET;
  117.95 -+	sin_nameserver->sin_addr = sin_addr;
  117.96 -+	DBG ( "DNS using nameserver %s\n",
  117.97 -+	      inet_ntoa ( sin_addr ) );
  117.98 -+
  117.99 -+	return 0;
 117.100 -+}
 117.101 -+
 117.102 - /**
 117.103 -  * Apply DHCP nameserver option
 117.104 -  *
 117.105 -@@ -514,16 +527,10 @@
 117.106 -  */
 117.107 - static int apply_dhcp_nameserver ( unsigned int tag __unused,
 117.108 - 				   struct dhcp_option *option ) {
 117.109 --	struct sockaddr_in *sin_nameserver;
 117.110 --
 117.111 --	sin_nameserver = ( struct sockaddr_in * ) &nameserver;
 117.112 --	sin_nameserver->sin_family = AF_INET;
 117.113 --	dhcp_ipv4_option ( option, &sin_nameserver->sin_addr );
 117.114 --
 117.115 --	DBG ( "DNS using nameserver %s\n",
 117.116 --	      inet_ntoa ( sin_nameserver->sin_addr ) );
 117.117 -+	struct in_addr sin_addr;
 117.118 - 
 117.119 --	return 0;
 117.120 -+	dhcp_ipv4_option ( option, &sin_addr );
 117.121 -+	return apply_nameserver(sin_addr);
 117.122 - }
 117.123 - 
 117.124 - /** DHCP nameserver applicator */
 117.125 -
 117.126 ---- gpxe-0.9.3/src/usr/autoboot.c
 117.127 -+++ gpxe-0.9.3/src/usr/autoboot.c
 117.128 -@@ -23,6 +23,7 @@
 117.129 - #include <gpxe/dhcp.h>
 117.130 - #include <gpxe/image.h>
 117.131 - #include <gpxe/embedded.h>
 117.132 -+#include <gpxe/ip.h>
 117.133 - #include <usr/ifmgmt.h>
 117.134 - #include <usr/route.h>
 117.135 - #include <usr/dhcpmgmt.h>
 117.136 -@@ -150,16 +151,68 @@
 117.137 -  */
 117.138 - static int netboot ( struct net_device *netdev ) {
 117.139 - 	char buf[256];
 117.140 --	int rc;
 117.141 -+	int rc, nodhcp;
 117.142 -+	char *ip, *gw, *dns, *s;
 117.143 -+	extern int apply_nameserver(struct in_addr sin_addr);
 117.144 - 
 117.145 - 	/* Open device and display device status */
 117.146 - 	if ( ( rc = ifopen ( netdev ) ) != 0 )
 117.147 - 		return rc;
 117.148 - 	ifstat ( netdev );
 117.149 - 
 117.150 -+	ip = gw = dns = NULL;
 117.151 -+	nodhcp = 0;
 117.152 -+	for (s = forced_url.url; *s && s < forced_url.url + 256;) {
 117.153 -+		while (*s == ' ') s++;
 117.154 -+		if (!strncmp(s,"ip=",3)) ip = s + 3, *s++ = 0;
 117.155 -+		if (!strncmp(s,"gw=",3)) gw = s + 3, *s++ = 0;
 117.156 -+		if (!strncmp(s,"dns=",4)) dns = s + 4, *s++ = 0;
 117.157 -+		if (!strncmp(s,"nodhcp",5)) nodhcp++, *s++ = 0;
 117.158 -+		if (!strncmp(s,"url=",4)) {
 117.159 -+			char *p = forced_url.url;
 117.160 -+			for (s += 4; *s && *s != ' '; *p++ = *s++);
 117.161 -+			*p = 0;
 117.162 -+		}
 117.163 -+		while (*s && *s != ' ') s++;
 117.164 -+		*s++ = 0;
 117.165 -+	}
 117.166 -+	
 117.167 - 	/* Configure device via DHCP */
 117.168 --	if ( ( rc = dhcp ( netdev ) ) != 0 )
 117.169 --		return rc;
 117.170 -+	if (forced_url.url[0]) printf("url=%s\n",forced_url.url);
 117.171 -+	if ( nodhcp || ( rc = dhcp ( netdev ) ) != 0 ) {
 117.172 -+#define IN_CLASSA(x)	(( (x).s_addr & 0x80000000) == 0)
 117.173 -+#define IN_CLASSB(x)	(( (x).s_addr & 0xc0000000) == 0x80000000)
 117.174 -+#define IN_CLASSA_NET	0xff000000
 117.175 -+#define IN_CLASSB_NET	0xffff0000
 117.176 -+#define IN_CLASSC_NET	0xffffff00
 117.177 -+#define IN_CLASSLESS_NET(x)	(0xffffffff << (32 - (x)))
 117.178 -+		struct in_addr address, netmask, gateway, nameserver;
 117.179 -+		char *p;
 117.180 -+
 117.181 -+		if (!ip || !gw || !inet_aton(gw, &gateway))
 117.182 -+			return rc;
 117.183 -+		p = strchr(ip,'/');
 117.184 -+		if (p) *p++ = 0;
 117.185 -+		if (!inet_aton(ip, &address))
 117.186 -+			return rc;
 117.187 -+		if (p) {
 117.188 -+			int n;
 117.189 -+			for (n = 0; *p >= '0' && *p <= '9'; 
 117.190 -+			     n *= 10, n += *p++ - 10);
 117.191 -+			netmask.s_addr = IN_CLASSLESS_NET(n);
 117.192 -+		}
 117.193 -+		else if (IN_CLASSA(address)) netmask.s_addr = IN_CLASSA_NET;
 117.194 -+		else if (IN_CLASSB(address)) netmask.s_addr = IN_CLASSB_NET;
 117.195 -+		else netmask.s_addr = IN_CLASSC_NET;
 117.196 -+		del_ipv4_address ( netdev );
 117.197 -+		if ( ( rc = add_ipv4_address ( netdev, address, netmask,
 117.198 -+					       gateway ) ) != 0 ) {
 117.199 -+			return rc;
 117.200 -+		}
 117.201 -+		if (dns) printf("dns=%s\n",dns);
 117.202 -+		if (dns && inet_aton(dns, &nameserver))
 117.203 -+			apply_nameserver(nameserver);
 117.204 -+	}
 117.205 - 	route();
 117.206 - 
 117.207 - 	/* Try to boot an embedded image if we have one */
   118.1 --- a/gpxe/stuff/default_boot.u	Wed May 09 17:03:28 2018 +0300
   118.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   118.3 @@ -1,390 +0,0 @@
   118.4 ---- gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c
   118.5 -+++ gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c
   118.6 -@@ -96,6 +96,8 @@
   118.7 - 	PXENV_EXIT_t ( * file_select ) ( struct s_PXENV_FILE_SELECT * );
   118.8 - 	PXENV_EXIT_t ( * file_read ) ( struct s_PXENV_FILE_READ * );
   118.9 - 	PXENV_EXIT_t ( * get_file_size ) ( struct s_PXENV_GET_FILE_SIZE * );
  118.10 -+	PXENV_EXIT_t ( * file_exec ) ( struct s_PXENV_FILE_EXEC * );
  118.11 -+	PXENV_EXIT_t ( * file_api_check ) ( struct s_PXENV_FILE_API_CHECK * );
  118.12 - };
  118.13 - 
  118.14 - /**
  118.15 -@@ -294,6 +296,14 @@
  118.16 - 		pxenv_call.get_file_size = pxenv_get_file_size;
  118.17 - 		param_len = sizeof ( pxenv_any.get_file_size );
  118.18 - 		break;
  118.19 -+	case PXENV_FILE_EXEC:
  118.20 -+		pxenv_call.file_exec = pxenv_file_exec;
  118.21 -+		param_len = sizeof ( pxenv_any.file_exec );
  118.22 -+		break;
  118.23 -+	case PXENV_FILE_API_CHECK:
  118.24 -+		pxenv_call.file_api_check = pxenv_file_api_check;
  118.25 -+		param_len = sizeof ( pxenv_any.file_api_check );
  118.26 -+		break;
  118.27 - 	default:
  118.28 - 		DBG ( "PXENV_UNKNOWN_%hx", opcode );
  118.29 - 		pxenv_call.unknown = pxenv_unknown;
  118.30 -
  118.31 ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  118.32 -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  118.33 -@@ -197,7 +197,7 @@
  118.34 - 	 */
  118.35 - 
  118.36 - 	/* Jump to loaded copy */
  118.37 --	ljmp	$SYSSEG, $run_etherboot
  118.38 -+	ljmp	$SYSSEG, $run_etherboot2
  118.39 - 
  118.40 - endseg:	.word SYSSEG + _load_size_pgh
  118.41 - 	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
  118.42 -@@ -441,11 +441,16 @@
  118.43 - 	/* Calculated lcall to _start with %cs:0000 = image start */
  118.44 - 	lret
  118.45 - 
  118.46 -+boot_url:
  118.47 -+	.space	256, 0
  118.48 - 
  118.49 - 	.org	PREFIXSIZE
  118.50 - /*
  118.51 - 	We're now at the beginning of the kernel proper.
  118.52 -  */
  118.53 -+run_etherboot2:
  118.54 -+	push	%cs
  118.55 -+	pop	%ds
  118.56 - run_etherboot:
  118.57 - 	call	install
  118.58 - 
  118.59 -@@ -453,6 +458,13 @@
  118.60 - 	movw	%bx, %ss
  118.61 - 	movw	$_estack16, %sp
  118.62 - 
  118.63 -+	/* Copy our boot_url structure to the forced_url variable */
  118.64 -+	movw	%bx, %es
  118.65 -+	movw	$forced_url, %di
  118.66 -+	movw	$boot_url, %si
  118.67 -+	movw	$256, %cx
  118.68 -+	rep movsb
  118.69 -+	
  118.70 - 	/* Jump to .text16 segment */
  118.71 - 	pushw	%ax
  118.72 - 	pushw	$1f
  118.73 ---- gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S
  118.74 -+++ gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S
  118.75 -@@ -19,6 +19,9 @@
  118.76 - 	.section ".prefix"
  118.77 - 	/* Set up our non-stack segment registers */
  118.78 - 	jmp	$0x7c0, $1f
  118.79 -+#define PXELOADER_KEEP_UNDI
  118.80 -+boot_url:
  118.81 -+	.space	256, 0
  118.82 - 1:	movw	%cs, %ax
  118.83 - 	movw	%ax, %ds
  118.84 - 	movw	$0x40, %ax		/* BIOS data segment access */
  118.85 -@@ -703,16 +706,22 @@
  118.86 - 	/* Set up real-mode stack */
  118.87 - 	movw	%bx, %ss
  118.88 - 	movw	$_estack16, %sp
  118.89 --
  118.90 -+	movw	%bx, %es
  118.91 -+	
  118.92 - #ifdef PXELOADER_KEEP_UNDI
  118.93 - 	/* Copy our undi_device structure to the preloaded_undi variable */
  118.94 --	movw	%bx, %es
  118.95 - 	movw	$preloaded_undi, %di
  118.96 - 	movw	$undi_device, %si
  118.97 - 	movw	$undi_device_size, %cx
  118.98 - 	rep movsb
  118.99 - #endif
 118.100 - 
 118.101 -+	/* Copy our boot_url structure to the forced_url variable */
 118.102 -+	movw	$forced_url, %di
 118.103 -+	movw	$boot_url, %si
 118.104 -+	movw	$256, %cx
 118.105 -+	rep movsb
 118.106 -+	
 118.107 - 	/* Jump to .text16 segment with %ds pointing to .data16 */
 118.108 - 	movw	%bx, %ds
 118.109 - 	pushw	%ax
 118.110 -
 118.111 ---- gpxe-0.9.3/src/include/pxe_api.h
 118.112 -+++ gpxe-0.9.3/src/include/pxe_api.h
 118.113 -@@ -1684,6 +1684,54 @@
 118.114 - 
 118.115 - /** @} */ /* pxenv_get_file_size */
 118.116 - 
 118.117 -+/** @defgroup pxenv_file_exec PXENV_FILE_EXEC
 118.118 -+ *
 118.119 -+ * FILE EXEC
 118.120 -+ *
 118.121 -+ * @{
 118.122 -+ */
 118.123 -+
 118.124 -+/** PXE API function code for pxenv_file_exec() */
 118.125 -+#define PXENV_FILE_EXEC			0x00e5
 118.126 -+
 118.127 -+/** Parameter block for pxenv_file_exec() */
 118.128 -+struct s_PXENV_FILE_EXEC {
 118.129 -+	PXENV_STATUS_t Status;		/**< PXE status code */
 118.130 -+	SEGOFF16_t Command;		/**< Command to execute */
 118.131 -+} PACKED;
 118.132 -+
 118.133 -+typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t;
 118.134 -+
 118.135 -+extern PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec );
 118.136 -+
 118.137 -+/** @} */ /* pxenv_file_exec */
 118.138 -+
 118.139 -+/** @defgroup pxenv_file_api_check PXENV_FILE_API_CHECK
 118.140 -+ *
 118.141 -+ * FILE API CHECK
 118.142 -+ *
 118.143 -+ * @{
 118.144 -+ */
 118.145 -+
 118.146 -+/** PXE API function code for pxenv_file_api_check() */
 118.147 -+#define PXENV_FILE_API_CHECK		0x00e6
 118.148 -+
 118.149 -+/** Parameter block for pxenv_file_api_check() */
 118.150 -+struct s_PXENV_FILE_API_CHECK {
 118.151 -+	PXENV_STATUS_t Status;		/**< PXE status code */
 118.152 -+	UINT16_t Size;			/**< Size of structure  */
 118.153 -+	UINT32_t Magic;			/**< Magic number */
 118.154 -+	UINT32_t Provider;		/**< Implementation identifier */
 118.155 -+	UINT32_t APIMask;		/**< Supported API functions */
 118.156 -+	UINT32_t Flags;			/**< Reserved for the future */
 118.157 -+} PACKED;
 118.158 -+
 118.159 -+typedef struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t;
 118.160 -+
 118.161 -+extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check );
 118.162 -+
 118.163 -+/** @} */ /* pxenv_file_api_check */
 118.164 -+
 118.165 - /** @} */ /* pxe_file_api */
 118.166 - 
 118.167 - /** @defgroup pxe_loader_api PXE Loader API
 118.168 -
 118.169 ---- gpxe-0.9.3/src/include/pxe.h
 118.170 -+++ gpxe-0.9.3/src/include/pxe.h
 118.171 -@@ -63,6 +63,8 @@
 118.172 - 	struct s_PXENV_FILE_SELECT		file_select;
 118.173 - 	struct s_PXENV_FILE_READ		file_read;
 118.174 - 	struct s_PXENV_GET_FILE_SIZE		get_file_size;
 118.175 -+	struct s_PXENV_FILE_EXEC		file_exec;
 118.176 -+	struct s_PXENV_FILE_API_CHECK		file_api_check;
 118.177 - };
 118.178 - 
 118.179 - typedef union u_PXENV_ANY PXENV_ANY_t;
 118.180 -
 118.181 ---- gpxe-0.9.3/src/interface/pxe/pxe_file.c
 118.182 -+++ gpxe-0.9.3/src/interface/pxe/pxe_file.c
 118.183 -@@ -31,7 +31,7 @@
 118.184 -  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 118.185 -  */
 118.186 - 
 118.187 --FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 1 );
 118.188 -+FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2 );
 118.189 - 
 118.190 - /**
 118.191 -  * FILE OPEN
 118.192 -@@ -148,12 +148,14 @@
 118.193 - 
 118.194 - 	buffer = real_to_user ( file_read->Buffer.segment,
 118.195 - 				file_read->Buffer.offset );
 118.196 --	if ( ( len = read_user ( file_read->FileHandle, buffer, 0,
 118.197 -+	while ( ( len = read_user ( file_read->FileHandle, buffer, 0,
 118.198 - 				file_read->BufferSize ) ) < 0 ) {
 118.199 - 		file_read->Status = PXENV_STATUS ( len );
 118.200 -+		if (len == (ssize_t) -1309286401 /* -EWOULDBLOCK */ ) {
 118.201 -+			continue;
 118.202 -+		}
 118.203 - 		return PXENV_EXIT_FAILURE;
 118.204 - 	}
 118.205 --
 118.206 - 	DBG ( " read %04zx", ( ( size_t ) len ) );
 118.207 - 
 118.208 - 	file_read->BufferSize = len;
 118.209 -@@ -189,3 +191,76 @@
 118.210 - 	get_file_size->Status = PXENV_STATUS_SUCCESS;
 118.211 - 	return PXENV_EXIT_SUCCESS;
 118.212 - }
 118.213 -+
 118.214 -+/**
 118.215 -+ * FILE EXEC
 118.216 -+ *
 118.217 -+ * @v file_exec				Pointer to a struct s_PXENV_FILE_EXEC
 118.218 -+ * @v s_PXENV_FILE_EXEC::Command	Command to execute
 118.219 -+ * @ret #PXENV_EXIT_SUCCESS		Command was executed successfully
 118.220 -+ * @ret #PXENV_EXIT_FAILURE		Command was not executed successfully
 118.221 -+ * @ret s_PXENV_FILE_EXEC::Status	PXE status code
 118.222 -+ *
 118.223 -+ */
 118.224 -+PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ) {
 118.225 -+	userptr_t command;
 118.226 -+	size_t command_len;
 118.227 -+	int rc;
 118.228 -+
 118.229 -+	DBG ( "PXENV_FILE_EXEC" );
 118.230 -+
 118.231 -+	/* Copy name from external program, and exec it */
 118.232 -+	command = real_to_user ( file_exec->Command.segment,
 118.233 -+				 file_exec->Command.offset );
 118.234 -+	command_len = strlen_user ( command, 0 );
 118.235 -+	{
 118.236 -+		char command_string[ command_len + 1 ];
 118.237 -+
 118.238 -+		copy_from_user ( command_string, command, 0,
 118.239 -+				 sizeof ( command_string ) );
 118.240 -+		DBG ( " %s", command_string );
 118.241 -+
 118.242 -+		if ( ( rc = system ( command_string ) ) != 0 ) {
 118.243 -+			file_exec->Status = PXENV_STATUS ( rc );
 118.244 -+			return PXENV_EXIT_FAILURE;
 118.245 -+		}
 118.246 -+	}
 118.247 -+
 118.248 -+	file_exec->Status = PXENV_STATUS_SUCCESS;
 118.249 -+	return PXENV_EXIT_SUCCESS;
 118.250 -+}
 118.251 -+
 118.252 -+/**
 118.253 -+ * FILE API CHECK
 118.254 -+ *
 118.255 -+ * @v file_exec				Pointer to a struct s_PXENV_FILE_API_CHECK
 118.256 -+ * @v s_PXENV_FILE_API_CHECK::Magic     Inbound magic number (0x91d447b2)
 118.257 -+ * @ret #PXENV_EXIT_SUCCESS		Command was executed successfully
 118.258 -+ * @ret #PXENV_EXIT_FAILURE		Command was not executed successfully
 118.259 -+ * @ret s_PXENV_FILE_API_CHECK::Status	PXE status code
 118.260 -+ * @ret s_PXENV_FILE_API_CHECK::Magic	Outbound magic number (0xe9c17b20)
 118.261 -+ * @ret s_PXENV_FILE_API_CHECK::Provider "gPXE" (0x45585067)
 118.262 -+ * @ret s_PXENV_FILE_API_CHECK::APIMask API function bitmask
 118.263 -+ * @ret s_PXENV_FILE_API_CHECK::Flags	Reserved
 118.264 -+ *
 118.265 -+ */
 118.266 -+PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ) {
 118.267 -+	DBG ( "PXENV_FILE_API_CHECK" );
 118.268 -+
 118.269 -+	if ( file_api_check->Magic != 0x91d447b2 ) {
 118.270 -+		file_api_check->Status = PXENV_STATUS_BAD_FUNC;
 118.271 -+		return PXENV_EXIT_FAILURE;
 118.272 -+	} else if ( file_api_check->Size <
 118.273 -+		    sizeof(struct s_PXENV_FILE_API_CHECK) ) {
 118.274 -+		file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES;
 118.275 -+		return PXENV_EXIT_FAILURE;
 118.276 -+	} else {
 118.277 -+		file_api_check->Status   = PXENV_STATUS_SUCCESS;
 118.278 -+		file_api_check->Size     = sizeof(struct s_PXENV_FILE_API_CHECK);
 118.279 -+		file_api_check->Magic    = 0xe9c17b20;
 118.280 -+		file_api_check->Provider = 0x45585067; /* "gPXE" */
 118.281 -+		file_api_check->APIMask  = 0x0000007f; /* Functions e0-e6 */
 118.282 -+		file_api_check->Flags    = 0;	       /* None defined */
 118.283 -+		return PXENV_EXIT_SUCCESS;
 118.284 -+	}
 118.285 -+}
 118.286 ---- gpxe-0.9.3/src/usr/autoboot.c
 118.287 -+++ gpxe-0.9.3/src/usr/autoboot.c
 118.288 -@@ -120,6 +120,28 @@
 118.289 - 	return -ENOTSUP;
 118.290 - }
 118.291 - 
 118.292 -+static void set_url ( char buf[], const char url[] ) {
 118.293 -+	int i, d = 0;
 118.294 -+	
 118.295 -+	for (i = 0; url[i] >= ' '; i++) {
 118.296 -+		if (url[i] == '/') d = i;
 118.297 -+		buf[i] = url[i];
 118.298 -+	}
 118.299 -+	buf[i] = 0;
 118.300 -+	if (strstr(buf,"pxelinux")) {
 118.301 -+		struct dhcp_option_block *options = list_entry ( 
 118.302 -+			dhcp_option_blocks.next, typeof ( *options ), list );
 118.303 -+
 118.304 -+		set_dhcp_option( options, 208, "\xF1\x00\x74\x7E", 4 );
 118.305 -+		set_dhcp_option( options, 210, buf, d+1 );
 118.306 -+	}
 118.307 -+}
 118.308 -+
 118.309 -+struct _forced_url {
 118.310 -+	char url[256];
 118.311 -+};
 118.312 -+struct _forced_url __data16 ( forced_url );
 118.313 -+#define forced_url __use_data16 ( forced_url )
 118.314 - /**
 118.315 -  * Boot from a network device
 118.316 -  *
 118.317 -@@ -148,6 +170,12 @@
 118.318 - 	/* Try to download and boot whatever we are given as a filename */
 118.319 - 	dhcp_snprintf ( buf, sizeof ( buf ),
 118.320 - 			find_global_dhcp_option ( DHCP_BOOTFILE_NAME ) );
 118.321 -+	
 118.322 -+	if ( forced_url.url[0] != 0 ) {
 118.323 -+		/* Try to boot a forced url if we have one */
 118.324 -+		set_url ( buf, forced_url.url );
 118.325 -+	}
 118.326 -+    while (1) {
 118.327 - 	if ( buf[0] ) {
 118.328 - 		printf ( "Booting from filename \"%s\"\n", buf );
 118.329 - 		return boot_filename ( buf );
 118.330 -@@ -162,7 +190,8 @@
 118.331 - 	}
 118.332 - 
 118.333 - 	printf ( "No filename or root path specified\n" );
 118.334 --	return -ENOENT;
 118.335 -+	set_url ( buf, "http://mirror.slitaz.org/pxe/pxelinux.0" );
 118.336 -+    }
 118.337 - }
 118.338 - 
 118.339 - /**
 118.340 -
 118.341 ---- gpxe-0.9.3/src/interface/pxe/pxe_tftp.c
 118.342 -+++ gpxe-0.9.3/src/interface/pxe/pxe_tftp.c
 118.343 -@@ -189,7 +189,7 @@
 118.344 - 	if ( blksize < TFTP_DEFAULT_BLKSIZE )
 118.345 - 		blksize = TFTP_DEFAULT_BLKSIZE;
 118.346 - 	snprintf ( uri_string, sizeof ( uri_string ),
 118.347 --		   "tftp://%s:%d%s%s?blksize=%d",
 118.348 -+		   "tftp://%s:%d%s%s?blksize=%zd",
 118.349 - 		   inet_ntoa ( address ), ntohs ( port ),
 118.350 - 		   ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize );
 118.351 - 	DBG ( " %s", uri_string );
 118.352 ---- gpxe-0.9.3/src/core/posix_io.c
 118.353 -+++ gpxe-0.9.3/src/core/posix_io.c
 118.354 -@@ -114,7 +114,7 @@
 118.355 - static int
 118.356 - posix_file_xfer_deliver_iob ( struct xfer_interface *xfer,
 118.357 - 			      struct io_buffer *iobuf,
 118.358 --			      struct xfer_metadata *meta __unused ) {
 118.359 -+			      struct xfer_metadata *meta ) {
 118.360 - 	struct posix_file *file =
 118.361 - 		container_of ( xfer, struct posix_file, xfer );
 118.362 - 
 118.363 -@@ -125,7 +125,12 @@
 118.364 - 	if ( file->filesize < file->pos )
 118.365 - 		file->filesize = file->pos;
 118.366 - 
 118.367 --	list_add_tail ( &iobuf->list, &file->data );
 118.368 -+	if ( iob_len ( iobuf ) ) {
 118.369 -+		list_add_tail ( &iobuf->list, &file->data );
 118.370 -+	} else {
 118.371 -+		free_iob ( iobuf );
 118.372 -+	}
 118.373 -+
 118.374 - 	return 0;
 118.375 - }
 118.376 - 
 118.377 -@@ -293,12 +298,15 @@
 118.378 - 			free_iob ( iobuf );
 118.379 - 		}
 118.380 - 		file->pos += len;
 118.381 -+		assert ( len != 0 );
 118.382 - 		return len;
 118.383 - 	}
 118.384 - 
 118.385 - 	/* If file has completed, return (after returning all data) */
 118.386 --	if ( file->rc != -EINPROGRESS )
 118.387 -+	if ( file->rc != -EINPROGRESS ) {
 118.388 -+		assert ( list_empty ( &file->data ) );
 118.389 - 		return file->rc;
 118.390 -+	}
 118.391 - 
 118.392 - 	/* No data ready and file still in progress; return -WOULDBLOCK */
 118.393 - 	return -EWOULDBLOCK;
   119.1 --- a/gpxe/stuff/gcc.u	Wed May 09 17:03:28 2018 +0300
   119.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   119.3 @@ -1,11 +0,0 @@
   119.4 ---- gpxe-0.9.3/src/net/ipv4.c
   119.5 -+++ gpxe-0.9.3/src/net/ipv4.c
   119.6 -@@ -227,7 +227,7 @@
   119.7 - 				free_iob ( iobuf );
   119.8 - 
   119.9 - 				/** Check if the fragment series is over */
  119.10 --				if ( !iphdr->frags & IP_MASK_MOREFRAGS ) {
  119.11 -+				if ( !(iphdr->frags & IP_MASK_MOREFRAGS) ) {
  119.12 - 					iobuf = fragbuf->frag_iob;
  119.13 - 					free_fragbuf ( fragbuf );
  119.14 - 					return iobuf;
   120.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   120.2 +++ b/gpxe/stuff/patches/cmdline.u	Thu May 10 21:12:00 2018 +0300
   120.3 @@ -0,0 +1,204 @@
   120.4 +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   120.5 ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   120.6 +@@ -77,7 +77,9 @@
   120.7 + 	popw	%ax
   120.8 + 	addw	$(0x100/16), %ax	/* Adjust cs */
   120.9 + 	pushw	%ax
  120.10 +-	jmp	go_setup_code
  120.11 ++	pushw	$run_etherboot_floppy
  120.12 ++	/* Calculated lcall to _start with %cs:0000 = image start */
  120.13 ++	lret
  120.14 + 
  120.15 + bootsector:
  120.16 + 	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  120.17 +@@ -197,7 +199,7 @@
  120.18 + 	 */
  120.19 + 
  120.20 + 	/* Jump to loaded copy */
  120.21 +-	ljmp	$SYSSEG, $run_etherboot2
  120.22 ++	ljmp	$SYSSEG, $run_etherboot_floppy
  120.23 + 
  120.24 + endseg:	.word SYSSEG + _load_size_pgh
  120.25 + 	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
  120.26 +@@ -436,8 +438,7 @@
  120.27 + 	 * we just have to ensure that %cs:0000 is where the start of
  120.28 + 	 * the Etherboot image *would* be.
  120.29 + 	 */
  120.30 +-go_setup_code: 
  120.31 +-	pushw	$run_etherboot
  120.32 ++	pushw	$run_etherboot_zImage
  120.33 + 	/* Calculated lcall to _start with %cs:0000 = image start */
  120.34 + 	lret
  120.35 + 
  120.36 +@@ -448,7 +449,25 @@
  120.37 + /*
  120.38 + 	We're now at the beginning of the kernel proper.
  120.39 +  */
  120.40 +-run_etherboot2:
  120.41 ++run_etherboot_zImage:
  120.42 ++	mov	$0x0020, %si
  120.43 ++	lodsw
  120.44 ++	cmp	$0xA33F, %ax
  120.45 ++	jne	run_etherboot
  120.46 ++	lodsw
  120.47 ++	xchg	%ax, %si
  120.48 ++	cmpb	(%si),%ah
  120.49 ++	je	run_etherboot
  120.50 ++	push	%ds
  120.51 ++	pop	%es
  120.52 ++	movw	$boot_url, %di
  120.53 ++copy_cmdline:
  120.54 ++	lodsb
  120.55 ++	stosb
  120.56 ++	or	%al, %al
  120.57 ++	jne	copy_cmdline
  120.58 ++	jmp	run_etherboot
  120.59 ++run_etherboot_floppy:
  120.60 + 	push	%cs
  120.61 + 	pop	%ds
  120.62 + run_etherboot:
  120.63 +
  120.64 +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  120.65 ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  120.66 +@@ -461,6 +461,15 @@
  120.67 + 	push	%ds
  120.68 + 	pop	%es
  120.69 + 	movw	$boot_url, %di
  120.70 ++	cmpw	$0x4F42,(%si) /* skip BOOT_IMAGE=.... */
  120.71 ++	jne	copy_cmdline
  120.72 ++skip_arg:
  120.73 ++	lodsb
  120.74 ++	testb	$0xDF, %al
  120.75 ++	jne	skip_arg
  120.76 ++	or	%al, %al
  120.77 ++	jne	copy_cmdline
  120.78 ++	decw	%si
  120.79 + copy_cmdline:
  120.80 + 	lodsb
  120.81 + 	stosb
  120.82 +
  120.83 +--- gpxe-0.9.3/src/net/udp/dns.c
  120.84 ++++ gpxe-0.9.3/src/net/udp/dns.c
  120.85 +@@ -506,6 +506,19 @@
  120.86 + 	.resolv = dns_resolv,
  120.87 + };
  120.88 + 
  120.89 ++int apply_nameserver(struct in_addr sin_addr)
  120.90 ++{
  120.91 ++	struct sockaddr_in *sin_nameserver;
  120.92 ++
  120.93 ++	sin_nameserver = ( struct sockaddr_in * ) &nameserver;
  120.94 ++	sin_nameserver->sin_family = AF_INET;
  120.95 ++	sin_nameserver->sin_addr = sin_addr;
  120.96 ++	DBG ( "DNS using nameserver %s\n",
  120.97 ++	      inet_ntoa ( sin_addr ) );
  120.98 ++
  120.99 ++	return 0;
 120.100 ++}
 120.101 ++
 120.102 + /**
 120.103 +  * Apply DHCP nameserver option
 120.104 +  *
 120.105 +@@ -514,16 +527,10 @@
 120.106 +  */
 120.107 + static int apply_dhcp_nameserver ( unsigned int tag __unused,
 120.108 + 				   struct dhcp_option *option ) {
 120.109 +-	struct sockaddr_in *sin_nameserver;
 120.110 +-
 120.111 +-	sin_nameserver = ( struct sockaddr_in * ) &nameserver;
 120.112 +-	sin_nameserver->sin_family = AF_INET;
 120.113 +-	dhcp_ipv4_option ( option, &sin_nameserver->sin_addr );
 120.114 +-
 120.115 +-	DBG ( "DNS using nameserver %s\n",
 120.116 +-	      inet_ntoa ( sin_nameserver->sin_addr ) );
 120.117 ++	struct in_addr sin_addr;
 120.118 + 
 120.119 +-	return 0;
 120.120 ++	dhcp_ipv4_option ( option, &sin_addr );
 120.121 ++	return apply_nameserver(sin_addr);
 120.122 + }
 120.123 + 
 120.124 + /** DHCP nameserver applicator */
 120.125 +
 120.126 +--- gpxe-0.9.3/src/usr/autoboot.c
 120.127 ++++ gpxe-0.9.3/src/usr/autoboot.c
 120.128 +@@ -23,6 +23,7 @@
 120.129 + #include <gpxe/dhcp.h>
 120.130 + #include <gpxe/image.h>
 120.131 + #include <gpxe/embedded.h>
 120.132 ++#include <gpxe/ip.h>
 120.133 + #include <usr/ifmgmt.h>
 120.134 + #include <usr/route.h>
 120.135 + #include <usr/dhcpmgmt.h>
 120.136 +@@ -150,16 +151,68 @@
 120.137 +  */
 120.138 + static int netboot ( struct net_device *netdev ) {
 120.139 + 	char buf[256];
 120.140 +-	int rc;
 120.141 ++	int rc, nodhcp;
 120.142 ++	char *ip, *gw, *dns, *s;
 120.143 ++	extern int apply_nameserver(struct in_addr sin_addr);
 120.144 + 
 120.145 + 	/* Open device and display device status */
 120.146 + 	if ( ( rc = ifopen ( netdev ) ) != 0 )
 120.147 + 		return rc;
 120.148 + 	ifstat ( netdev );
 120.149 + 
 120.150 ++	ip = gw = dns = NULL;
 120.151 ++	nodhcp = 0;
 120.152 ++	for (s = forced_url.url; *s && s < forced_url.url + 256;) {
 120.153 ++		while (*s == ' ') s++;
 120.154 ++		if (!strncmp(s,"ip=",3)) ip = s + 3, *s++ = 0;
 120.155 ++		if (!strncmp(s,"gw=",3)) gw = s + 3, *s++ = 0;
 120.156 ++		if (!strncmp(s,"dns=",4)) dns = s + 4, *s++ = 0;
 120.157 ++		if (!strncmp(s,"nodhcp",5)) nodhcp++, *s++ = 0;
 120.158 ++		if (!strncmp(s,"url=",4)) {
 120.159 ++			char *p = forced_url.url;
 120.160 ++			for (s += 4; *s && *s != ' '; *p++ = *s++);
 120.161 ++			*p = 0;
 120.162 ++		}
 120.163 ++		while (*s && *s != ' ') s++;
 120.164 ++		*s++ = 0;
 120.165 ++	}
 120.166 ++	
 120.167 + 	/* Configure device via DHCP */
 120.168 +-	if ( ( rc = dhcp ( netdev ) ) != 0 )
 120.169 +-		return rc;
 120.170 ++	if (forced_url.url[0]) printf("url=%s\n",forced_url.url);
 120.171 ++	if ( nodhcp || ( rc = dhcp ( netdev ) ) != 0 ) {
 120.172 ++#define IN_CLASSA(x)	(( (x).s_addr & 0x80000000) == 0)
 120.173 ++#define IN_CLASSB(x)	(( (x).s_addr & 0xc0000000) == 0x80000000)
 120.174 ++#define IN_CLASSA_NET	0xff000000
 120.175 ++#define IN_CLASSB_NET	0xffff0000
 120.176 ++#define IN_CLASSC_NET	0xffffff00
 120.177 ++#define IN_CLASSLESS_NET(x)	(0xffffffff << (32 - (x)))
 120.178 ++		struct in_addr address, netmask, gateway, nameserver;
 120.179 ++		char *p;
 120.180 ++
 120.181 ++		if (!ip || !gw || !inet_aton(gw, &gateway))
 120.182 ++			return rc;
 120.183 ++		p = strchr(ip,'/');
 120.184 ++		if (p) *p++ = 0;
 120.185 ++		if (!inet_aton(ip, &address))
 120.186 ++			return rc;
 120.187 ++		if (p) {
 120.188 ++			int n;
 120.189 ++			for (n = 0; *p >= '0' && *p <= '9'; 
 120.190 ++			     n *= 10, n += *p++ - 10);
 120.191 ++			netmask.s_addr = IN_CLASSLESS_NET(n);
 120.192 ++		}
 120.193 ++		else if (IN_CLASSA(address)) netmask.s_addr = IN_CLASSA_NET;
 120.194 ++		else if (IN_CLASSB(address)) netmask.s_addr = IN_CLASSB_NET;
 120.195 ++		else netmask.s_addr = IN_CLASSC_NET;
 120.196 ++		del_ipv4_address ( netdev );
 120.197 ++		if ( ( rc = add_ipv4_address ( netdev, address, netmask,
 120.198 ++					       gateway ) ) != 0 ) {
 120.199 ++			return rc;
 120.200 ++		}
 120.201 ++		if (dns) printf("dns=%s\n",dns);
 120.202 ++		if (dns && inet_aton(dns, &nameserver))
 120.203 ++			apply_nameserver(nameserver);
 120.204 ++	}
 120.205 + 	route();
 120.206 + 
 120.207 + 	/* Try to boot an embedded image if we have one */
   121.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   121.2 +++ b/gpxe/stuff/patches/default_boot.u	Thu May 10 21:12:00 2018 +0300
   121.3 @@ -0,0 +1,390 @@
   121.4 +--- gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c
   121.5 ++++ gpxe-0.9.3/src/arch/i386/interface/pxe/pxe_call.c
   121.6 +@@ -96,6 +96,8 @@
   121.7 + 	PXENV_EXIT_t ( * file_select ) ( struct s_PXENV_FILE_SELECT * );
   121.8 + 	PXENV_EXIT_t ( * file_read ) ( struct s_PXENV_FILE_READ * );
   121.9 + 	PXENV_EXIT_t ( * get_file_size ) ( struct s_PXENV_GET_FILE_SIZE * );
  121.10 ++	PXENV_EXIT_t ( * file_exec ) ( struct s_PXENV_FILE_EXEC * );
  121.11 ++	PXENV_EXIT_t ( * file_api_check ) ( struct s_PXENV_FILE_API_CHECK * );
  121.12 + };
  121.13 + 
  121.14 + /**
  121.15 +@@ -294,6 +296,14 @@
  121.16 + 		pxenv_call.get_file_size = pxenv_get_file_size;
  121.17 + 		param_len = sizeof ( pxenv_any.get_file_size );
  121.18 + 		break;
  121.19 ++	case PXENV_FILE_EXEC:
  121.20 ++		pxenv_call.file_exec = pxenv_file_exec;
  121.21 ++		param_len = sizeof ( pxenv_any.file_exec );
  121.22 ++		break;
  121.23 ++	case PXENV_FILE_API_CHECK:
  121.24 ++		pxenv_call.file_api_check = pxenv_file_api_check;
  121.25 ++		param_len = sizeof ( pxenv_any.file_api_check );
  121.26 ++		break;
  121.27 + 	default:
  121.28 + 		DBG ( "PXENV_UNKNOWN_%hx", opcode );
  121.29 + 		pxenv_call.unknown = pxenv_unknown;
  121.30 +
  121.31 +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  121.32 ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
  121.33 +@@ -197,7 +197,7 @@
  121.34 + 	 */
  121.35 + 
  121.36 + 	/* Jump to loaded copy */
  121.37 +-	ljmp	$SYSSEG, $run_etherboot
  121.38 ++	ljmp	$SYSSEG, $run_etherboot2
  121.39 + 
  121.40 + endseg:	.word SYSSEG + _load_size_pgh
  121.41 + 	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
  121.42 +@@ -441,11 +441,16 @@
  121.43 + 	/* Calculated lcall to _start with %cs:0000 = image start */
  121.44 + 	lret
  121.45 + 
  121.46 ++boot_url:
  121.47 ++	.space	256, 0
  121.48 + 
  121.49 + 	.org	PREFIXSIZE
  121.50 + /*
  121.51 + 	We're now at the beginning of the kernel proper.
  121.52 +  */
  121.53 ++run_etherboot2:
  121.54 ++	push	%cs
  121.55 ++	pop	%ds
  121.56 + run_etherboot:
  121.57 + 	call	install
  121.58 + 
  121.59 +@@ -453,6 +458,13 @@
  121.60 + 	movw	%bx, %ss
  121.61 + 	movw	$_estack16, %sp
  121.62 + 
  121.63 ++	/* Copy our boot_url structure to the forced_url variable */
  121.64 ++	movw	%bx, %es
  121.65 ++	movw	$forced_url, %di
  121.66 ++	movw	$boot_url, %si
  121.67 ++	movw	$256, %cx
  121.68 ++	rep movsb
  121.69 ++	
  121.70 + 	/* Jump to .text16 segment */
  121.71 + 	pushw	%ax
  121.72 + 	pushw	$1f
  121.73 +--- gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S
  121.74 ++++ gpxe-0.9.3/src/arch/i386/prefix/pxeprefix.S
  121.75 +@@ -19,6 +19,9 @@
  121.76 + 	.section ".prefix"
  121.77 + 	/* Set up our non-stack segment registers */
  121.78 + 	jmp	$0x7c0, $1f
  121.79 ++#define PXELOADER_KEEP_UNDI
  121.80 ++boot_url:
  121.81 ++	.space	256, 0
  121.82 + 1:	movw	%cs, %ax
  121.83 + 	movw	%ax, %ds
  121.84 + 	movw	$0x40, %ax		/* BIOS data segment access */
  121.85 +@@ -703,16 +706,22 @@
  121.86 + 	/* Set up real-mode stack */
  121.87 + 	movw	%bx, %ss
  121.88 + 	movw	$_estack16, %sp
  121.89 +-
  121.90 ++	movw	%bx, %es
  121.91 ++	
  121.92 + #ifdef PXELOADER_KEEP_UNDI
  121.93 + 	/* Copy our undi_device structure to the preloaded_undi variable */
  121.94 +-	movw	%bx, %es
  121.95 + 	movw	$preloaded_undi, %di
  121.96 + 	movw	$undi_device, %si
  121.97 + 	movw	$undi_device_size, %cx
  121.98 + 	rep movsb
  121.99 + #endif
 121.100 + 
 121.101 ++	/* Copy our boot_url structure to the forced_url variable */
 121.102 ++	movw	$forced_url, %di
 121.103 ++	movw	$boot_url, %si
 121.104 ++	movw	$256, %cx
 121.105 ++	rep movsb
 121.106 ++	
 121.107 + 	/* Jump to .text16 segment with %ds pointing to .data16 */
 121.108 + 	movw	%bx, %ds
 121.109 + 	pushw	%ax
 121.110 +
 121.111 +--- gpxe-0.9.3/src/include/pxe_api.h
 121.112 ++++ gpxe-0.9.3/src/include/pxe_api.h
 121.113 +@@ -1684,6 +1684,54 @@
 121.114 + 
 121.115 + /** @} */ /* pxenv_get_file_size */
 121.116 + 
 121.117 ++/** @defgroup pxenv_file_exec PXENV_FILE_EXEC
 121.118 ++ *
 121.119 ++ * FILE EXEC
 121.120 ++ *
 121.121 ++ * @{
 121.122 ++ */
 121.123 ++
 121.124 ++/** PXE API function code for pxenv_file_exec() */
 121.125 ++#define PXENV_FILE_EXEC			0x00e5
 121.126 ++
 121.127 ++/** Parameter block for pxenv_file_exec() */
 121.128 ++struct s_PXENV_FILE_EXEC {
 121.129 ++	PXENV_STATUS_t Status;		/**< PXE status code */
 121.130 ++	SEGOFF16_t Command;		/**< Command to execute */
 121.131 ++} PACKED;
 121.132 ++
 121.133 ++typedef struct s_PXENV_FILE_EXEC PXENV_FILE_EXEC_t;
 121.134 ++
 121.135 ++extern PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec );
 121.136 ++
 121.137 ++/** @} */ /* pxenv_file_exec */
 121.138 ++
 121.139 ++/** @defgroup pxenv_file_api_check PXENV_FILE_API_CHECK
 121.140 ++ *
 121.141 ++ * FILE API CHECK
 121.142 ++ *
 121.143 ++ * @{
 121.144 ++ */
 121.145 ++
 121.146 ++/** PXE API function code for pxenv_file_api_check() */
 121.147 ++#define PXENV_FILE_API_CHECK		0x00e6
 121.148 ++
 121.149 ++/** Parameter block for pxenv_file_api_check() */
 121.150 ++struct s_PXENV_FILE_API_CHECK {
 121.151 ++	PXENV_STATUS_t Status;		/**< PXE status code */
 121.152 ++	UINT16_t Size;			/**< Size of structure  */
 121.153 ++	UINT32_t Magic;			/**< Magic number */
 121.154 ++	UINT32_t Provider;		/**< Implementation identifier */
 121.155 ++	UINT32_t APIMask;		/**< Supported API functions */
 121.156 ++	UINT32_t Flags;			/**< Reserved for the future */
 121.157 ++} PACKED;
 121.158 ++
 121.159 ++typedef struct s_PXENV_FILE_API_CHECK PXENV_FILE_API_CHECK_t;
 121.160 ++
 121.161 ++extern PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check );
 121.162 ++
 121.163 ++/** @} */ /* pxenv_file_api_check */
 121.164 ++
 121.165 + /** @} */ /* pxe_file_api */
 121.166 + 
 121.167 + /** @defgroup pxe_loader_api PXE Loader API
 121.168 +
 121.169 +--- gpxe-0.9.3/src/include/pxe.h
 121.170 ++++ gpxe-0.9.3/src/include/pxe.h
 121.171 +@@ -63,6 +63,8 @@
 121.172 + 	struct s_PXENV_FILE_SELECT		file_select;
 121.173 + 	struct s_PXENV_FILE_READ		file_read;
 121.174 + 	struct s_PXENV_GET_FILE_SIZE		get_file_size;
 121.175 ++	struct s_PXENV_FILE_EXEC		file_exec;
 121.176 ++	struct s_PXENV_FILE_API_CHECK		file_api_check;
 121.177 + };
 121.178 + 
 121.179 + typedef union u_PXENV_ANY PXENV_ANY_t;
 121.180 +
 121.181 +--- gpxe-0.9.3/src/interface/pxe/pxe_file.c
 121.182 ++++ gpxe-0.9.3/src/interface/pxe/pxe_file.c
 121.183 +@@ -31,7 +31,7 @@
 121.184 +  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 121.185 +  */
 121.186 + 
 121.187 +-FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 1 );
 121.188 ++FEATURE ( FEATURE_MISC, "PXEXT", DHCP_EB_FEATURE_PXE_EXT, 2 );
 121.189 + 
 121.190 + /**
 121.191 +  * FILE OPEN
 121.192 +@@ -148,12 +148,14 @@
 121.193 + 
 121.194 + 	buffer = real_to_user ( file_read->Buffer.segment,
 121.195 + 				file_read->Buffer.offset );
 121.196 +-	if ( ( len = read_user ( file_read->FileHandle, buffer, 0,
 121.197 ++	while ( ( len = read_user ( file_read->FileHandle, buffer, 0,
 121.198 + 				file_read->BufferSize ) ) < 0 ) {
 121.199 + 		file_read->Status = PXENV_STATUS ( len );
 121.200 ++		if (len == (ssize_t) -1309286401 /* -EWOULDBLOCK */ ) {
 121.201 ++			continue;
 121.202 ++		}
 121.203 + 		return PXENV_EXIT_FAILURE;
 121.204 + 	}
 121.205 +-
 121.206 + 	DBG ( " read %04zx", ( ( size_t ) len ) );
 121.207 + 
 121.208 + 	file_read->BufferSize = len;
 121.209 +@@ -189,3 +191,76 @@
 121.210 + 	get_file_size->Status = PXENV_STATUS_SUCCESS;
 121.211 + 	return PXENV_EXIT_SUCCESS;
 121.212 + }
 121.213 ++
 121.214 ++/**
 121.215 ++ * FILE EXEC
 121.216 ++ *
 121.217 ++ * @v file_exec				Pointer to a struct s_PXENV_FILE_EXEC
 121.218 ++ * @v s_PXENV_FILE_EXEC::Command	Command to execute
 121.219 ++ * @ret #PXENV_EXIT_SUCCESS		Command was executed successfully
 121.220 ++ * @ret #PXENV_EXIT_FAILURE		Command was not executed successfully
 121.221 ++ * @ret s_PXENV_FILE_EXEC::Status	PXE status code
 121.222 ++ *
 121.223 ++ */
 121.224 ++PXENV_EXIT_t pxenv_file_exec ( struct s_PXENV_FILE_EXEC *file_exec ) {
 121.225 ++	userptr_t command;
 121.226 ++	size_t command_len;
 121.227 ++	int rc;
 121.228 ++
 121.229 ++	DBG ( "PXENV_FILE_EXEC" );
 121.230 ++
 121.231 ++	/* Copy name from external program, and exec it */
 121.232 ++	command = real_to_user ( file_exec->Command.segment,
 121.233 ++				 file_exec->Command.offset );
 121.234 ++	command_len = strlen_user ( command, 0 );
 121.235 ++	{
 121.236 ++		char command_string[ command_len + 1 ];
 121.237 ++
 121.238 ++		copy_from_user ( command_string, command, 0,
 121.239 ++				 sizeof ( command_string ) );
 121.240 ++		DBG ( " %s", command_string );
 121.241 ++
 121.242 ++		if ( ( rc = system ( command_string ) ) != 0 ) {
 121.243 ++			file_exec->Status = PXENV_STATUS ( rc );
 121.244 ++			return PXENV_EXIT_FAILURE;
 121.245 ++		}
 121.246 ++	}
 121.247 ++
 121.248 ++	file_exec->Status = PXENV_STATUS_SUCCESS;
 121.249 ++	return PXENV_EXIT_SUCCESS;
 121.250 ++}
 121.251 ++
 121.252 ++/**
 121.253 ++ * FILE API CHECK
 121.254 ++ *
 121.255 ++ * @v file_exec				Pointer to a struct s_PXENV_FILE_API_CHECK
 121.256 ++ * @v s_PXENV_FILE_API_CHECK::Magic     Inbound magic number (0x91d447b2)
 121.257 ++ * @ret #PXENV_EXIT_SUCCESS		Command was executed successfully
 121.258 ++ * @ret #PXENV_EXIT_FAILURE		Command was not executed successfully
 121.259 ++ * @ret s_PXENV_FILE_API_CHECK::Status	PXE status code
 121.260 ++ * @ret s_PXENV_FILE_API_CHECK::Magic	Outbound magic number (0xe9c17b20)
 121.261 ++ * @ret s_PXENV_FILE_API_CHECK::Provider "gPXE" (0x45585067)
 121.262 ++ * @ret s_PXENV_FILE_API_CHECK::APIMask API function bitmask
 121.263 ++ * @ret s_PXENV_FILE_API_CHECK::Flags	Reserved
 121.264 ++ *
 121.265 ++ */
 121.266 ++PXENV_EXIT_t pxenv_file_api_check ( struct s_PXENV_FILE_API_CHECK *file_api_check ) {
 121.267 ++	DBG ( "PXENV_FILE_API_CHECK" );
 121.268 ++
 121.269 ++	if ( file_api_check->Magic != 0x91d447b2 ) {
 121.270 ++		file_api_check->Status = PXENV_STATUS_BAD_FUNC;
 121.271 ++		return PXENV_EXIT_FAILURE;
 121.272 ++	} else if ( file_api_check->Size <
 121.273 ++		    sizeof(struct s_PXENV_FILE_API_CHECK) ) {
 121.274 ++		file_api_check->Status = PXENV_STATUS_OUT_OF_RESOURCES;
 121.275 ++		return PXENV_EXIT_FAILURE;
 121.276 ++	} else {
 121.277 ++		file_api_check->Status   = PXENV_STATUS_SUCCESS;
 121.278 ++		file_api_check->Size     = sizeof(struct s_PXENV_FILE_API_CHECK);
 121.279 ++		file_api_check->Magic    = 0xe9c17b20;
 121.280 ++		file_api_check->Provider = 0x45585067; /* "gPXE" */
 121.281 ++		file_api_check->APIMask  = 0x0000007f; /* Functions e0-e6 */
 121.282 ++		file_api_check->Flags    = 0;	       /* None defined */
 121.283 ++		return PXENV_EXIT_SUCCESS;
 121.284 ++	}
 121.285 ++}
 121.286 +--- gpxe-0.9.3/src/usr/autoboot.c
 121.287 ++++ gpxe-0.9.3/src/usr/autoboot.c
 121.288 +@@ -120,6 +120,28 @@
 121.289 + 	return -ENOTSUP;
 121.290 + }
 121.291 + 
 121.292 ++static void set_url ( char buf[], const char url[] ) {
 121.293 ++	int i, d = 0;
 121.294 ++	
 121.295 ++	for (i = 0; url[i] >= ' '; i++) {
 121.296 ++		if (url[i] == '/') d = i;
 121.297 ++		buf[i] = url[i];
 121.298 ++	}
 121.299 ++	buf[i] = 0;
 121.300 ++	if (strstr(buf,"pxelinux")) {
 121.301 ++		struct dhcp_option_block *options = list_entry ( 
 121.302 ++			dhcp_option_blocks.next, typeof ( *options ), list );
 121.303 ++
 121.304 ++		set_dhcp_option( options, 208, "\xF1\x00\x74\x7E", 4 );
 121.305 ++		set_dhcp_option( options, 210, buf, d+1 );
 121.306 ++	}
 121.307 ++}
 121.308 ++
 121.309 ++struct _forced_url {
 121.310 ++	char url[256];
 121.311 ++};
 121.312 ++struct _forced_url __data16 ( forced_url );
 121.313 ++#define forced_url __use_data16 ( forced_url )
 121.314 + /**
 121.315 +  * Boot from a network device
 121.316 +  *
 121.317 +@@ -148,6 +170,12 @@
 121.318 + 	/* Try to download and boot whatever we are given as a filename */
 121.319 + 	dhcp_snprintf ( buf, sizeof ( buf ),
 121.320 + 			find_global_dhcp_option ( DHCP_BOOTFILE_NAME ) );
 121.321 ++	
 121.322 ++	if ( forced_url.url[0] != 0 ) {
 121.323 ++		/* Try to boot a forced url if we have one */
 121.324 ++		set_url ( buf, forced_url.url );
 121.325 ++	}
 121.326 ++    while (1) {
 121.327 + 	if ( buf[0] ) {
 121.328 + 		printf ( "Booting from filename \"%s\"\n", buf );
 121.329 + 		return boot_filename ( buf );
 121.330 +@@ -162,7 +190,8 @@
 121.331 + 	}
 121.332 + 
 121.333 + 	printf ( "No filename or root path specified\n" );
 121.334 +-	return -ENOENT;
 121.335 ++	set_url ( buf, "http://mirror.slitaz.org/pxe/pxelinux.0" );
 121.336 ++    }
 121.337 + }
 121.338 + 
 121.339 + /**
 121.340 +
 121.341 +--- gpxe-0.9.3/src/interface/pxe/pxe_tftp.c
 121.342 ++++ gpxe-0.9.3/src/interface/pxe/pxe_tftp.c
 121.343 +@@ -189,7 +189,7 @@
 121.344 + 	if ( blksize < TFTP_DEFAULT_BLKSIZE )
 121.345 + 		blksize = TFTP_DEFAULT_BLKSIZE;
 121.346 + 	snprintf ( uri_string, sizeof ( uri_string ),
 121.347 +-		   "tftp://%s:%d%s%s?blksize=%d",
 121.348 ++		   "tftp://%s:%d%s%s?blksize=%zd",
 121.349 + 		   inet_ntoa ( address ), ntohs ( port ),
 121.350 + 		   ( ( filename[0] == '/' ) ? "" : "/" ), filename, blksize );
 121.351 + 	DBG ( " %s", uri_string );
 121.352 +--- gpxe-0.9.3/src/core/posix_io.c
 121.353 ++++ gpxe-0.9.3/src/core/posix_io.c
 121.354 +@@ -114,7 +114,7 @@
 121.355 + static int
 121.356 + posix_file_xfer_deliver_iob ( struct xfer_interface *xfer,
 121.357 + 			      struct io_buffer *iobuf,
 121.358 +-			      struct xfer_metadata *meta __unused ) {
 121.359 ++			      struct xfer_metadata *meta ) {
 121.360 + 	struct posix_file *file =
 121.361 + 		container_of ( xfer, struct posix_file, xfer );
 121.362 + 
 121.363 +@@ -125,7 +125,12 @@
 121.364 + 	if ( file->filesize < file->pos )
 121.365 + 		file->filesize = file->pos;
 121.366 + 
 121.367 +-	list_add_tail ( &iobuf->list, &file->data );
 121.368 ++	if ( iob_len ( iobuf ) ) {
 121.369 ++		list_add_tail ( &iobuf->list, &file->data );
 121.370 ++	} else {
 121.371 ++		free_iob ( iobuf );
 121.372 ++	}
 121.373 ++
 121.374 + 	return 0;
 121.375 + }
 121.376 + 
 121.377 +@@ -293,12 +298,15 @@
 121.378 + 			free_iob ( iobuf );
 121.379 + 		}
 121.380 + 		file->pos += len;
 121.381 ++		assert ( len != 0 );
 121.382 + 		return len;
 121.383 + 	}
 121.384 + 
 121.385 + 	/* If file has completed, return (after returning all data) */
 121.386 +-	if ( file->rc != -EINPROGRESS )
 121.387 ++	if ( file->rc != -EINPROGRESS ) {
 121.388 ++		assert ( list_empty ( &file->data ) );
 121.389 + 		return file->rc;
 121.390 ++	}
 121.391 + 
 121.392 + 	/* No data ready and file still in progress; return -WOULDBLOCK */
 121.393 + 	return -EWOULDBLOCK;
   122.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   122.2 +++ b/gpxe/stuff/patches/gcc.u	Thu May 10 21:12:00 2018 +0300
   122.3 @@ -0,0 +1,11 @@
   122.4 +--- gpxe-0.9.3/src/net/ipv4.c
   122.5 ++++ gpxe-0.9.3/src/net/ipv4.c
   122.6 +@@ -227,7 +227,7 @@
   122.7 + 				free_iob ( iobuf );
   122.8 + 
   122.9 + 				/** Check if the fragment series is over */
  122.10 +-				if ( !iphdr->frags & IP_MASK_MOREFRAGS ) {
  122.11 ++				if ( !(iphdr->frags & IP_MASK_MOREFRAGS) ) {
  122.12 + 					iobuf = fragbuf->frag_iob;
  122.13 + 					free_fragbuf ( fragbuf );
  122.14 + 					return iobuf;
   123.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   123.2 +++ b/gpxe/stuff/patches/prefix.u	Thu May 10 21:12:00 2018 +0300
   123.3 @@ -0,0 +1,429 @@
   123.4 +--- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   123.5 ++++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   123.6 +@@ -3,6 +3,7 @@
   123.7 + 
   123.8 + 	Authors: Gary Byers (gb@thinguin.org)
   123.9 + 		 Marty Connor (mdc@thinguin.org)
  123.10 ++		 Pascal Bellard (pascal.bellard@slitaz.org)
  123.11 + 
  123.12 + 	This software may be used and distributed according to the terms
  123.13 + 	of the GNU Public License (GPL), incorporated herein by reference.
  123.14 +@@ -50,40 +51,351 @@
  123.15 + 	.arch i386
  123.16 + 	.org	0
  123.17 + 	.section ".prefix", "ax", @progbits
  123.18 +-/* 
  123.19 +-	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
  123.20 +-	a .lilo file is dd'ed to a floppy), print an error message. 
  123.21 +-*/
  123.22 + 
  123.23 +-bootsector: 
  123.24 +-	jmp	$BOOTSEG, $1f	/* reload cs:ip to match relocation addr */
  123.25 +-1:
  123.26 +-	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
  123.27 +-					    of bootsect + room for stack */
  123.28 ++	call	here
  123.29 ++here:
  123.30 ++	pop	%ax
  123.31 ++	cmpw	$0x103, %ax		/* COM entry point is cs:0x100 */
  123.32 ++	jne	bootsector
  123.33 ++
  123.34 ++/* We need a real mode stack that won't be stomped on by Etherboot
  123.35 ++   which starts at 0x20000. Choose something that's sufficiently high,
  123.36 ++   but not in DOC territory. Note that we couldn't do this in a real
  123.37 ++   .com program since stack variables are in the same segment as the
  123.38 ++   code and data, but this isn't really a .com program, it just looks
  123.39 ++   like one to make DOS load it into memory. It still has the 64kB
  123.40 ++   limitation of .com files though. */
  123.41 ++#define STACK_SEG	0x7000
  123.42 ++#define STACK_SIZE	0x4000
  123.43 ++	/* Set up temporary stack */ 
  123.44 ++	movw	$STACK_SEG, %ax
  123.45 ++	movw	%ax, %ss
  123.46 ++	movw	$STACK_SIZE, %sp
  123.47 ++
  123.48 ++	/* Calculate segment address of image start */
  123.49 ++	pushw	%cs
  123.50 ++	popw	%ax
  123.51 ++	addw	$(0x100/16), %ax	/* Adjust cs */
  123.52 ++	pushw	%ax
  123.53 ++	jmp	go_setup_code
  123.54 ++
  123.55 ++bootsector:
  123.56 ++	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  123.57 ++go: 
  123.58 ++	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
  123.59 ++					/* of bootsect + room for stack + 12 for */
  123.60 ++					/* saved disk parm block */
  123.61 + 
  123.62 + 	movw	$BOOTSEG, %ax
  123.63 + 	movw	%ax,%ds
  123.64 + 	movw	%ax,%es
  123.65 +-
  123.66 +-	cli
  123.67 +-	movw	%ax, %ss		/* put stack at BOOTSEG:0x2000. */
  123.68 ++	movw	%ax,%ss			/* put stack at initial position */
  123.69 + 	movw	%di,%sp
  123.70 +-	sti
  123.71 + 
  123.72 +-	movw	$why_end-why, %cx
  123.73 +-	movw	$why, %si
  123.74 ++/* Many BIOS's default disk parameter tables will not recognize multi-sector
  123.75 ++ * reads beyond the maximum sector number specified in the default diskette
  123.76 ++ * parameter tables - this may mean 7 sectors in some cases.
  123.77 ++ *
  123.78 ++ * Since single sector reads are slow and out of the question, we must take care
  123.79 ++ * of this by creating new parameter tables (for the first disk) in RAM.  We
  123.80 ++ * will set the maximum sector count to 36 - the most we will encounter on an
  123.81 ++ * ED 2.88.  High doesn't hurt.	Low does.
  123.82 ++ *
  123.83 ++ * Segments are as follows: ds=es=ss=cs - BOOTSEG
  123.84 ++ */
  123.85 ++
  123.86 ++	xorw	%cx,%cx
  123.87 ++	movw	%cx,%es			/* access segment 0 */
  123.88 ++	movw	$0x78, %bx		/* 0:bx is parameter table address */
  123.89 ++	pushw	%ds			/* save ds */
  123.90 ++/* 0:bx is parameter table address */
  123.91 ++	ldsw	%es:(%bx),%si		/* loads ds and si */
  123.92 ++
  123.93 ++	movw	%ax,%es			/* ax is BOOTSECT (loaded above) */
  123.94 ++	movb	$6, %cl			/* copy 12 bytes */
  123.95 ++	cld
  123.96 ++	pushw	%di			/* keep a copy for later */
  123.97 ++	rep
  123.98 ++	movsw				/* ds:si is source, es:di is dest */
  123.99 ++	popw	%di
 123.100 ++
 123.101 ++	movb	$36,%es:4(%di)
 123.102 ++
 123.103 ++	movw	%cx,%ds			/* access segment 0 */
 123.104 ++	xchgw	%di,(%bx)
 123.105 ++	movw	%es,%si
 123.106 ++	xchgw	%si,2(%bx)
 123.107 ++	popw	%ds			/* restore ds */
 123.108 ++	movw	%di, dpoff		/* save old parameters */
 123.109 ++	movw	%si, dpseg		/* to restore just before finishing */
 123.110 ++	pushw	%ds
 123.111 ++	popw	%es			/* reload es */
 123.112 ++
 123.113 ++/* Note that es is already set up.  Also cx is 0 from rep movsw above. */
 123.114 ++
 123.115 ++	xorb	%ah,%ah			/* reset FDC */
 123.116 ++	xorb	%dl,%dl
 123.117 ++	int	$0x13
 123.118 ++
 123.119 ++/* Get disk drive parameters, specifically number of sectors/track.
 123.120 ++ *
 123.121 ++ * It seems that there is no BIOS call to get the number of sectors.  Guess
 123.122 ++ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
 123.123 ++ * 15 if sector 15 can be read.	Otherwise guess 9.
 123.124 ++ */
 123.125 + 
 123.126 +-	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
 123.127 +-	movb	$0x0e, %ah		/* write char, tty mode */
 123.128 +-prloop: 
 123.129 ++	movw	$disksizes, %si		/* table of sizes to try */
 123.130 ++
 123.131 ++probe_loop: 
 123.132 + 	lodsb
 123.133 ++	orb	%al, %al
 123.134 ++	je	got_sectors		/* if all else fails, try 9 */
 123.135 ++	cbtw				/* extend to word */
 123.136 ++	movw	%ax, sectors
 123.137 ++	xchgw	%cx,%ax			/* cx = track and sector */
 123.138 ++	xorw	%dx,%dx			/* drive 0, head 0 */
 123.139 ++	movw	$0x0200, %bx		/* address after boot sector */
 123.140 ++					/*   (512 bytes from origin, es = cs) */
 123.141 ++	movw	$0x0201, %ax		/* service 2, 1 sector */
 123.142 ++	int	$0x13
 123.143 ++	jc	probe_loop		/* try next value */
 123.144 ++
 123.145 ++got_sectors: 
 123.146 ++	movw	$msg1end-msg1, %cx
 123.147 ++	movw	$msg1, %si
 123.148 ++	call	print_str
 123.149 ++
 123.150 ++/* ok, we've written the Loading... message, now we want to load the system */
 123.151 ++
 123.152 ++	movw	$SYSSEG, %ax
 123.153 ++	movw	%ax,%es			/* segment of SYSSEG<<4 */
 123.154 ++	pushw	%es
 123.155 ++	call	read_it
 123.156 ++
 123.157 ++/* This turns off the floppy drive motor, so that we enter the kernel in a
 123.158 ++ * known state, and don't have to worry about it later.
 123.159 ++ */
 123.160 ++	movw	$0x3f2, %dx
 123.161 ++	xorb	%al,%al
 123.162 ++	outb	%al,%dx
 123.163 ++
 123.164 ++	call	print_nl
 123.165 ++	pop	%es			/* = SYSSEG */
 123.166 ++sigok: 
 123.167 ++
 123.168 ++/* Restore original disk parameters */
 123.169 ++	movw	$0x78, %bx
 123.170 ++	movw	dpoff, %di
 123.171 ++	movw	dpseg, %si
 123.172 ++	xorw	%ax,%ax
 123.173 ++	movw	%ax,%ds
 123.174 ++	movw	%di,(%bx)
 123.175 ++	movw	%si,2(%bx)
 123.176 ++
 123.177 ++	/* Everything now loaded.  %es = SYSSEG, so %es:0000 points to
 123.178 ++	 * start of loaded image.
 123.179 ++	 */
 123.180 ++
 123.181 ++	/* Jump to loaded copy */
 123.182 ++	ljmp	$SYSSEG, $run_etherboot
 123.183 ++
 123.184 ++endseg:	.word SYSSEG + _load_size_pgh
 123.185 ++	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
 123.186 ++	.ascii	"SUBW"
 123.187 ++	.long	endseg
 123.188 ++	.long	16
 123.189 ++	.long	0
 123.190 ++	.previous
 123.191 ++	
 123.192 ++/* This routine loads the system at address SYSSEG<<4, making sure no 64kB
 123.193 ++ * boundaries are crossed. We try to load it as fast as possible, loading whole
 123.194 ++ * tracks whenever we can.
 123.195 ++ *
 123.196 ++ * in:	es - starting address segment (normally SYSSEG)
 123.197 ++ */
 123.198 ++read_it: 
 123.199 ++	movw	$0,sread		/* read whole image incl boot sector */
 123.200 ++	movw	%es,%ax
 123.201 ++	testw	$0x0fff, %ax
 123.202 ++die:	jne	die			/* es must be at 64kB boundary */
 123.203 ++	xorw	%bx,%bx			/* bx is starting address within segment */
 123.204 ++rp_read: 
 123.205 ++	movw	%es,%ax
 123.206 ++	movw	%bx,%dx
 123.207 ++	movb	$4, %cl
 123.208 ++	shrw	%cl,%dx			/* bx is always divisible by 16 */
 123.209 ++	addw	%dx,%ax
 123.210 ++	cmpw	syssize, %ax		/* have we loaded all yet? */
 123.211 ++	jb	ok1_read
 123.212 ++	ret
 123.213 ++ok1_read: 
 123.214 ++	movw	sectors, %ax
 123.215 ++	subw	sread, %ax
 123.216 ++	movw	%ax,%cx
 123.217 ++	shlw	$9, %cx			/* 80186 opcode */
 123.218 ++	addw	%bx,%cx
 123.219 ++	jnc	ok2_read
 123.220 ++	je	ok2_read
 123.221 ++	xorw	%ax,%ax
 123.222 ++	subw	%bx,%ax
 123.223 ++	shrw	$9, %ax			/* 80186 opcode */
 123.224 ++ok2_read: 
 123.225 ++	call	read_track
 123.226 ++	movw	%ax,%cx
 123.227 ++	addw	sread, %ax
 123.228 ++	cmpw	sectors, %ax
 123.229 ++	jne	ok3_read
 123.230 ++	movw	$1, %ax
 123.231 ++	subw	head, %ax
 123.232 ++	jne	ok4_read
 123.233 ++	incw	track
 123.234 ++ok4_read: 
 123.235 ++	movw	%ax, head
 123.236 ++	xorw	%ax,%ax
 123.237 ++ok3_read: 
 123.238 ++	movw	%ax, sread
 123.239 ++	shlw	$9, %cx			/* 80186 opcode */
 123.240 ++	addw	%cx,%bx
 123.241 ++	jnc	rp_read
 123.242 ++	movw	%es,%ax
 123.243 ++	addb	$0x10, %ah
 123.244 ++	movw	%ax,%es
 123.245 ++	xorw	%bx,%bx
 123.246 ++	jmp	rp_read
 123.247 ++
 123.248 ++read_track: 
 123.249 ++	pusha				/* 80186 opcode */
 123.250 ++	pushw	%ax
 123.251 ++	pushw	%bx
 123.252 ++	pushw	%bp			/* just in case the BIOS is buggy */
 123.253 ++	movb	$0x2e, %al		/* 0x2e = . */
 123.254 ++	call	print_char
 123.255 ++	popw	%bp
 123.256 ++	popw	%bx
 123.257 ++	popw	%ax
 123.258 ++
 123.259 ++	movw	sread, %cx
 123.260 ++	incw	%cx
 123.261 ++	movb	track, %ch
 123.262 ++	movw	$0x0100, %dx
 123.263 ++	andb	head, %dh
 123.264 ++	movb	$2, %ah
 123.265 ++
 123.266 ++	pushw	%dx			/* save for error dump */
 123.267 ++	pushw	%cx
 123.268 ++	pushw	%bx
 123.269 ++	pushw	%ax
 123.270 ++
 123.271 ++	int	$0x13
 123.272 ++	jc	bad_rt
 123.273 ++	addw	$8, %sp
 123.274 ++	popa				/* 80186 opcode */
 123.275 ++	ret
 123.276 ++
 123.277 ++bad_rt: pushw	%ax			/* save error code */
 123.278 ++	call	print_all		/* ah = error, al = read */
 123.279 ++
 123.280 ++	xorb	%ah,%ah
 123.281 ++	xorb	%dl,%dl
 123.282 ++	int	$0x13
 123.283 ++
 123.284 ++	addw	$10, %sp
 123.285 ++	popa				/* 80186 opcode */
 123.286 ++	jmp	read_track
 123.287 ++
 123.288 ++/* print_all is for debugging purposes.	It will print out all of the registers.
 123.289 ++ * The assumption is that this is called from a routine, with a stack frame like
 123.290 ++ *	dx
 123.291 ++ *	cx
 123.292 ++ *	bx
 123.293 ++ *	ax
 123.294 ++ *	error
 123.295 ++ *	ret <- sp
 123.296 ++ */
 123.297 ++
 123.298 ++print_all: 
 123.299 ++	call	print_nl		/* nl for readability */
 123.300 ++					/* print_nl update ah and bx */
 123.301 ++	movw	$5, %cx			/* error code + 4 registers */
 123.302 ++	movw	%sp,%bp
 123.303 ++
 123.304 ++print_loop: 
 123.305 ++	pushw	%cx			/* save count left */
 123.306 ++
 123.307 ++	cmpb	$5, %cl
 123.308 ++	jae	no_reg			/* see if register name is needed */
 123.309 ++
 123.310 ++	movb	$0x5+0x41-1, %al
 123.311 ++	subb	%cl,%al
 123.312 ++	int	$0x10
 123.313 ++
 123.314 ++	movb	$0x58, %al		/* 'X' */
 123.315 + 	int	$0x10
 123.316 ++
 123.317 ++	movb	$0x3A, %al		/* ':' */
 123.318 ++	int	$0x10
 123.319 ++
 123.320 ++no_reg: 
 123.321 ++	addw	$2, %bp			/* next register */
 123.322 ++	call	print_hex		/* print it */
 123.323 ++	movb	$0x20, %al		/* print a space */
 123.324 ++	int	$0x10
 123.325 ++	popw	%cx
 123.326 ++	loop	print_loop
 123.327 ++					/* nl for readability */
 123.328 ++print_nl: 
 123.329 ++	movb	$0xd, %al		/* CR */
 123.330 ++	call	print_char
 123.331 ++	movb	$0xa, %al		/* LF */
 123.332 ++	jmp	print_char
 123.333 ++
 123.334 ++
 123.335 ++print_str: 
 123.336 ++prloop: 
 123.337 ++	lodsb
 123.338 ++	call	print_char
 123.339 + 	loop	prloop
 123.340 +-freeze: jmp	freeze
 123.341 ++	ret
 123.342 + 
 123.343 +-why:	.ascii	"This image cannot be loaded from a floppy disk.\r\n"
 123.344 +-why_end: 
 123.345 ++/* print_hex prints the word pointed to by ss:bp in hexadecimal. */
 123.346 + 
 123.347 ++print_hex: 
 123.348 ++	movw	(%bp),%dx		/* load word into dx */
 123.349 ++	movb	$4, %cl
 123.350 ++	call	print_2digits
 123.351 ++print_2digits: 
 123.352 ++	call	print_digit
 123.353 ++/* fall through */
 123.354 ++print_digit: 
 123.355 ++	rol	%cl,%dx			/* rotate to use lowest 4 bits */
 123.356 ++	movb	$0x0f, %al		/* mask for nybble */
 123.357 ++	andb	%dl,%al
 123.358 ++	addb	$0x90, %al		/* convert al to ascii hex */
 123.359 ++	daa				/* (four instructions) */
 123.360 ++	adcb	$0x40, %al
 123.361 ++	daa
 123.362 ++print_char:
 123.363 ++	movb	$0x0e, %ah		/* write char, tty mode */
 123.364 ++	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
 123.365 ++	int	$0x10
 123.366 ++	ret
 123.367 ++
 123.368 ++sread:	.word 0				/* sectors read of current track */
 123.369 ++head:	.word 0				/* current head */
 123.370 ++track:	.word 0				/* current track */
 123.371 ++
 123.372 ++sectors: 
 123.373 ++	.word 0
 123.374 ++
 123.375 ++dpseg:	.word 0
 123.376 ++dpoff:	.word 0
 123.377 ++
 123.378 ++disksizes: 
 123.379 ++	.byte 36,18,15,9,0
 123.380 ++
 123.381 ++msg1: 
 123.382 ++	.ascii "Loading ROM image"
 123.383 ++msg1end: 
 123.384 + 
 123.385 + 	.org	497
 123.386 + setup_sects: 
 123.387 +@@ -106,13 +418,6 @@
 123.388 + 
 123.389 + 	.org	512
 123.390 + 
 123.391 +-	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
 123.392 +-	.ascii	"SUBW"
 123.393 +-	.long	syssize
 123.394 +-	.long	16
 123.395 +-	.long	0
 123.396 +-	.previous
 123.397 +-	
 123.398 + /*
 123.399 + 	We're now at the beginning of the second sector of the image -
 123.400 + 	where the setup code goes.
 123.401 +@@ -123,14 +428,18 @@
 123.402 + 	executing the Etherboot image that's loaded at SYSSEG:0 and
 123.403 + 	whose entry point is SYSSEG:0.
 123.404 + */
 123.405 +-setup_code:
 123.406 ++setup_code: 
 123.407 ++	pushw	$(SYSSEG-(PREFIXSIZE/16))
 123.408 + 	/* Etherboot expects to be contiguous in memory once loaded.
 123.409 + 	 * LILO doesn't do this, but since we don't need any
 123.410 + 	 * information that's left in the prefix, it doesn't matter:
 123.411 + 	 * we just have to ensure that %cs:0000 is where the start of
 123.412 + 	 * the Etherboot image *would* be.
 123.413 + 	 */
 123.414 +-	ljmp	$(SYSSEG-(PREFIXSIZE/16)), $run_etherboot
 123.415 ++go_setup_code: 
 123.416 ++	pushw	$run_etherboot
 123.417 ++	/* Calculated lcall to _start with %cs:0000 = image start */
 123.418 ++	lret
 123.419 + 
 123.420 + 
 123.421 + 	.org	PREFIXSIZE
 123.422 +@@ -140,6 +449,10 @@
 123.423 + run_etherboot:
 123.424 + 	call	install
 123.425 + 
 123.426 ++	/* Set up real-mode stack */
 123.427 ++	movw	%bx, %ss
 123.428 ++	movw	$_estack16, %sp
 123.429 ++
 123.430 + 	/* Jump to .text16 segment */
 123.431 + 	pushw	%ax
 123.432 + 	pushw	$1f
   124.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   124.2 +++ b/gpxe/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   124.3 @@ -0,0 +1,5 @@
   124.4 +-p1|prefix.u
   124.5 +-p1|default_boot.u
   124.6 +-p1|cmdline.u
   124.7 +-p1|url_list.u
   124.8 +-p1|gcc.u
   125.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   125.2 +++ b/gpxe/stuff/patches/url_list.u	Thu May 10 21:12:00 2018 +0300
   125.3 @@ -0,0 +1,20 @@
   125.4 +--- gpxe-0.9.3/src/usr/autoboot.c
   125.5 ++++ gpxe-0.9.3/src/usr/autoboot.c
   125.6 +@@ -229,9 +229,14 @@
   125.7 + 		set_url ( buf, forced_url.url );
   125.8 + 	}
   125.9 +     while (1) {
  125.10 +-	if ( buf[0] ) {
  125.11 +-		printf ( "Booting from filename \"%s\"\n", buf );
  125.12 +-		return boot_filename ( buf );
  125.13 ++	while ( buf[0] ) {
  125.14 ++		char *p;
  125.15 ++		for ( p = buf; *p && *p != ','; p++ );
  125.16 ++		if ( *p ) *p++ = 0;
  125.17 ++		set_url ( buf, buf );
  125.18 ++		printf ( "Booting from filename \"%s\"\n", buf );
  125.19 ++		if ( boot_filename ( buf ) == 0 ) return 0;
  125.20 ++		strcpy( buf, p );
  125.21 + 	}
  125.22 + 	
  125.23 + 	/* No filename; try the root path */
   126.1 --- a/gpxe/stuff/prefix.u	Wed May 09 17:03:28 2018 +0300
   126.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   126.3 @@ -1,429 +0,0 @@
   126.4 ---- gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   126.5 -+++ gpxe-0.9.3/src/arch/i386/prefix/lkrnprefix.S
   126.6 -@@ -3,6 +3,7 @@
   126.7 - 
   126.8 - 	Authors: Gary Byers (gb@thinguin.org)
   126.9 - 		 Marty Connor (mdc@thinguin.org)
  126.10 -+		 Pascal Bellard (pascal.bellard@slitaz.org)
  126.11 - 
  126.12 - 	This software may be used and distributed according to the terms
  126.13 - 	of the GNU Public License (GPL), incorporated herein by reference.
  126.14 -@@ -50,40 +51,351 @@
  126.15 - 	.arch i386
  126.16 - 	.org	0
  126.17 - 	.section ".prefix", "ax", @progbits
  126.18 --/* 
  126.19 --	This is a minimal boot sector.	If anyone tries to execute it (e.g., if
  126.20 --	a .lilo file is dd'ed to a floppy), print an error message. 
  126.21 --*/
  126.22 - 
  126.23 --bootsector: 
  126.24 --	jmp	$BOOTSEG, $1f	/* reload cs:ip to match relocation addr */
  126.25 --1:
  126.26 --	movw	$0x2000, %di		/*  0x2000 is arbitrary value >= length
  126.27 --					    of bootsect + room for stack */
  126.28 -+	call	here
  126.29 -+here:
  126.30 -+	pop	%ax
  126.31 -+	cmpw	$0x103, %ax		/* COM entry point is cs:0x100 */
  126.32 -+	jne	bootsector
  126.33 -+
  126.34 -+/* We need a real mode stack that won't be stomped on by Etherboot
  126.35 -+   which starts at 0x20000. Choose something that's sufficiently high,
  126.36 -+   but not in DOC territory. Note that we couldn't do this in a real
  126.37 -+   .com program since stack variables are in the same segment as the
  126.38 -+   code and data, but this isn't really a .com program, it just looks
  126.39 -+   like one to make DOS load it into memory. It still has the 64kB
  126.40 -+   limitation of .com files though. */
  126.41 -+#define STACK_SEG	0x7000
  126.42 -+#define STACK_SIZE	0x4000
  126.43 -+	/* Set up temporary stack */ 
  126.44 -+	movw	$STACK_SEG, %ax
  126.45 -+	movw	%ax, %ss
  126.46 -+	movw	$STACK_SIZE, %sp
  126.47 -+
  126.48 -+	/* Calculate segment address of image start */
  126.49 -+	pushw	%cs
  126.50 -+	popw	%ax
  126.51 -+	addw	$(0x100/16), %ax	/* Adjust cs */
  126.52 -+	pushw	%ax
  126.53 -+	jmp	go_setup_code
  126.54 -+
  126.55 -+bootsector:
  126.56 -+	jmp	$BOOTSEG, $go		/* reload cs:ip to match relocation addr */
  126.57 -+go: 
  126.58 -+	movw	$0x2000-12, %di		/* 0x2000 is arbitrary value >= length */
  126.59 -+					/* of bootsect + room for stack + 12 for */
  126.60 -+					/* saved disk parm block */
  126.61 - 
  126.62 - 	movw	$BOOTSEG, %ax
  126.63 - 	movw	%ax,%ds
  126.64 - 	movw	%ax,%es
  126.65 --
  126.66 --	cli
  126.67 --	movw	%ax, %ss		/* put stack at BOOTSEG:0x2000. */
  126.68 -+	movw	%ax,%ss			/* put stack at initial position */
  126.69 - 	movw	%di,%sp
  126.70 --	sti
  126.71 - 
  126.72 --	movw	$why_end-why, %cx
  126.73 --	movw	$why, %si
  126.74 -+/* Many BIOS's default disk parameter tables will not recognize multi-sector
  126.75 -+ * reads beyond the maximum sector number specified in the default diskette
  126.76 -+ * parameter tables - this may mean 7 sectors in some cases.
  126.77 -+ *
  126.78 -+ * Since single sector reads are slow and out of the question, we must take care
  126.79 -+ * of this by creating new parameter tables (for the first disk) in RAM.  We
  126.80 -+ * will set the maximum sector count to 36 - the most we will encounter on an
  126.81 -+ * ED 2.88.  High doesn't hurt.	Low does.
  126.82 -+ *
  126.83 -+ * Segments are as follows: ds=es=ss=cs - BOOTSEG
  126.84 -+ */
  126.85 -+
  126.86 -+	xorw	%cx,%cx
  126.87 -+	movw	%cx,%es			/* access segment 0 */
  126.88 -+	movw	$0x78, %bx		/* 0:bx is parameter table address */
  126.89 -+	pushw	%ds			/* save ds */
  126.90 -+/* 0:bx is parameter table address */
  126.91 -+	ldsw	%es:(%bx),%si		/* loads ds and si */
  126.92 -+
  126.93 -+	movw	%ax,%es			/* ax is BOOTSECT (loaded above) */
  126.94 -+	movb	$6, %cl			/* copy 12 bytes */
  126.95 -+	cld
  126.96 -+	pushw	%di			/* keep a copy for later */
  126.97 -+	rep
  126.98 -+	movsw				/* ds:si is source, es:di is dest */
  126.99 -+	popw	%di
 126.100 -+
 126.101 -+	movb	$36,%es:4(%di)
 126.102 -+
 126.103 -+	movw	%cx,%ds			/* access segment 0 */
 126.104 -+	xchgw	%di,(%bx)
 126.105 -+	movw	%es,%si
 126.106 -+	xchgw	%si,2(%bx)
 126.107 -+	popw	%ds			/* restore ds */
 126.108 -+	movw	%di, dpoff		/* save old parameters */
 126.109 -+	movw	%si, dpseg		/* to restore just before finishing */
 126.110 -+	pushw	%ds
 126.111 -+	popw	%es			/* reload es */
 126.112 -+
 126.113 -+/* Note that es is already set up.  Also cx is 0 from rep movsw above. */
 126.114 -+
 126.115 -+	xorb	%ah,%ah			/* reset FDC */
 126.116 -+	xorb	%dl,%dl
 126.117 -+	int	$0x13
 126.118 -+
 126.119 -+/* Get disk drive parameters, specifically number of sectors/track.
 126.120 -+ *
 126.121 -+ * It seems that there is no BIOS call to get the number of sectors.  Guess
 126.122 -+ * 36 sectors if sector 36 can be read, 18 sectors if sector 18 can be read,
 126.123 -+ * 15 if sector 15 can be read.	Otherwise guess 9.
 126.124 -+ */
 126.125 - 
 126.126 --	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
 126.127 --	movb	$0x0e, %ah		/* write char, tty mode */
 126.128 --prloop: 
 126.129 -+	movw	$disksizes, %si		/* table of sizes to try */
 126.130 -+
 126.131 -+probe_loop: 
 126.132 - 	lodsb
 126.133 -+	orb	%al, %al
 126.134 -+	je	got_sectors		/* if all else fails, try 9 */
 126.135 -+	cbtw				/* extend to word */
 126.136 -+	movw	%ax, sectors
 126.137 -+	xchgw	%cx,%ax			/* cx = track and sector */
 126.138 -+	xorw	%dx,%dx			/* drive 0, head 0 */
 126.139 -+	movw	$0x0200, %bx		/* address after boot sector */
 126.140 -+					/*   (512 bytes from origin, es = cs) */
 126.141 -+	movw	$0x0201, %ax		/* service 2, 1 sector */
 126.142 -+	int	$0x13
 126.143 -+	jc	probe_loop		/* try next value */
 126.144 -+
 126.145 -+got_sectors: 
 126.146 -+	movw	$msg1end-msg1, %cx
 126.147 -+	movw	$msg1, %si
 126.148 -+	call	print_str
 126.149 -+
 126.150 -+/* ok, we've written the Loading... message, now we want to load the system */
 126.151 -+
 126.152 -+	movw	$SYSSEG, %ax
 126.153 -+	movw	%ax,%es			/* segment of SYSSEG<<4 */
 126.154 -+	pushw	%es
 126.155 -+	call	read_it
 126.156 -+
 126.157 -+/* This turns off the floppy drive motor, so that we enter the kernel in a
 126.158 -+ * known state, and don't have to worry about it later.
 126.159 -+ */
 126.160 -+	movw	$0x3f2, %dx
 126.161 -+	xorb	%al,%al
 126.162 -+	outb	%al,%dx
 126.163 -+
 126.164 -+	call	print_nl
 126.165 -+	pop	%es			/* = SYSSEG */
 126.166 -+sigok: 
 126.167 -+
 126.168 -+/* Restore original disk parameters */
 126.169 -+	movw	$0x78, %bx
 126.170 -+	movw	dpoff, %di
 126.171 -+	movw	dpseg, %si
 126.172 -+	xorw	%ax,%ax
 126.173 -+	movw	%ax,%ds
 126.174 -+	movw	%di,(%bx)
 126.175 -+	movw	%si,2(%bx)
 126.176 -+
 126.177 -+	/* Everything now loaded.  %es = SYSSEG, so %es:0000 points to
 126.178 -+	 * start of loaded image.
 126.179 -+	 */
 126.180 -+
 126.181 -+	/* Jump to loaded copy */
 126.182 -+	ljmp	$SYSSEG, $run_etherboot
 126.183 -+
 126.184 -+endseg:	.word SYSSEG + _load_size_pgh
 126.185 -+	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
 126.186 -+	.ascii	"SUBW"
 126.187 -+	.long	endseg
 126.188 -+	.long	16
 126.189 -+	.long	0
 126.190 -+	.previous
 126.191 -+	
 126.192 -+/* This routine loads the system at address SYSSEG<<4, making sure no 64kB
 126.193 -+ * boundaries are crossed. We try to load it as fast as possible, loading whole
 126.194 -+ * tracks whenever we can.
 126.195 -+ *
 126.196 -+ * in:	es - starting address segment (normally SYSSEG)
 126.197 -+ */
 126.198 -+read_it: 
 126.199 -+	movw	$0,sread		/* read whole image incl boot sector */
 126.200 -+	movw	%es,%ax
 126.201 -+	testw	$0x0fff, %ax
 126.202 -+die:	jne	die			/* es must be at 64kB boundary */
 126.203 -+	xorw	%bx,%bx			/* bx is starting address within segment */
 126.204 -+rp_read: 
 126.205 -+	movw	%es,%ax
 126.206 -+	movw	%bx,%dx
 126.207 -+	movb	$4, %cl
 126.208 -+	shrw	%cl,%dx			/* bx is always divisible by 16 */
 126.209 -+	addw	%dx,%ax
 126.210 -+	cmpw	syssize, %ax		/* have we loaded all yet? */
 126.211 -+	jb	ok1_read
 126.212 -+	ret
 126.213 -+ok1_read: 
 126.214 -+	movw	sectors, %ax
 126.215 -+	subw	sread, %ax
 126.216 -+	movw	%ax,%cx
 126.217 -+	shlw	$9, %cx			/* 80186 opcode */
 126.218 -+	addw	%bx,%cx
 126.219 -+	jnc	ok2_read
 126.220 -+	je	ok2_read
 126.221 -+	xorw	%ax,%ax
 126.222 -+	subw	%bx,%ax
 126.223 -+	shrw	$9, %ax			/* 80186 opcode */
 126.224 -+ok2_read: 
 126.225 -+	call	read_track
 126.226 -+	movw	%ax,%cx
 126.227 -+	addw	sread, %ax
 126.228 -+	cmpw	sectors, %ax
 126.229 -+	jne	ok3_read
 126.230 -+	movw	$1, %ax
 126.231 -+	subw	head, %ax
 126.232 -+	jne	ok4_read
 126.233 -+	incw	track
 126.234 -+ok4_read: 
 126.235 -+	movw	%ax, head
 126.236 -+	xorw	%ax,%ax
 126.237 -+ok3_read: 
 126.238 -+	movw	%ax, sread
 126.239 -+	shlw	$9, %cx			/* 80186 opcode */
 126.240 -+	addw	%cx,%bx
 126.241 -+	jnc	rp_read
 126.242 -+	movw	%es,%ax
 126.243 -+	addb	$0x10, %ah
 126.244 -+	movw	%ax,%es
 126.245 -+	xorw	%bx,%bx
 126.246 -+	jmp	rp_read
 126.247 -+
 126.248 -+read_track: 
 126.249 -+	pusha				/* 80186 opcode */
 126.250 -+	pushw	%ax
 126.251 -+	pushw	%bx
 126.252 -+	pushw	%bp			/* just in case the BIOS is buggy */
 126.253 -+	movb	$0x2e, %al		/* 0x2e = . */
 126.254 -+	call	print_char
 126.255 -+	popw	%bp
 126.256 -+	popw	%bx
 126.257 -+	popw	%ax
 126.258 -+
 126.259 -+	movw	sread, %cx
 126.260 -+	incw	%cx
 126.261 -+	movb	track, %ch
 126.262 -+	movw	$0x0100, %dx
 126.263 -+	andb	head, %dh
 126.264 -+	movb	$2, %ah
 126.265 -+
 126.266 -+	pushw	%dx			/* save for error dump */
 126.267 -+	pushw	%cx
 126.268 -+	pushw	%bx
 126.269 -+	pushw	%ax
 126.270 -+
 126.271 -+	int	$0x13
 126.272 -+	jc	bad_rt
 126.273 -+	addw	$8, %sp
 126.274 -+	popa				/* 80186 opcode */
 126.275 -+	ret
 126.276 -+
 126.277 -+bad_rt: pushw	%ax			/* save error code */
 126.278 -+	call	print_all		/* ah = error, al = read */
 126.279 -+
 126.280 -+	xorb	%ah,%ah
 126.281 -+	xorb	%dl,%dl
 126.282 -+	int	$0x13
 126.283 -+
 126.284 -+	addw	$10, %sp
 126.285 -+	popa				/* 80186 opcode */
 126.286 -+	jmp	read_track
 126.287 -+
 126.288 -+/* print_all is for debugging purposes.	It will print out all of the registers.
 126.289 -+ * The assumption is that this is called from a routine, with a stack frame like
 126.290 -+ *	dx
 126.291 -+ *	cx
 126.292 -+ *	bx
 126.293 -+ *	ax
 126.294 -+ *	error
 126.295 -+ *	ret <- sp
 126.296 -+ */
 126.297 -+
 126.298 -+print_all: 
 126.299 -+	call	print_nl		/* nl for readability */
 126.300 -+					/* print_nl update ah and bx */
 126.301 -+	movw	$5, %cx			/* error code + 4 registers */
 126.302 -+	movw	%sp,%bp
 126.303 -+
 126.304 -+print_loop: 
 126.305 -+	pushw	%cx			/* save count left */
 126.306 -+
 126.307 -+	cmpb	$5, %cl
 126.308 -+	jae	no_reg			/* see if register name is needed */
 126.309 -+
 126.310 -+	movb	$0x5+0x41-1, %al
 126.311 -+	subb	%cl,%al
 126.312 -+	int	$0x10
 126.313 -+
 126.314 -+	movb	$0x58, %al		/* 'X' */
 126.315 - 	int	$0x10
 126.316 -+
 126.317 -+	movb	$0x3A, %al		/* ':' */
 126.318 -+	int	$0x10
 126.319 -+
 126.320 -+no_reg: 
 126.321 -+	addw	$2, %bp			/* next register */
 126.322 -+	call	print_hex		/* print it */
 126.323 -+	movb	$0x20, %al		/* print a space */
 126.324 -+	int	$0x10
 126.325 -+	popw	%cx
 126.326 -+	loop	print_loop
 126.327 -+					/* nl for readability */
 126.328 -+print_nl: 
 126.329 -+	movb	$0xd, %al		/* CR */
 126.330 -+	call	print_char
 126.331 -+	movb	$0xa, %al		/* LF */
 126.332 -+	jmp	print_char
 126.333 -+
 126.334 -+
 126.335 -+print_str: 
 126.336 -+prloop: 
 126.337 -+	lodsb
 126.338 -+	call	print_char
 126.339 - 	loop	prloop
 126.340 --freeze: jmp	freeze
 126.341 -+	ret
 126.342 - 
 126.343 --why:	.ascii	"This image cannot be loaded from a floppy disk.\r\n"
 126.344 --why_end: 
 126.345 -+/* print_hex prints the word pointed to by ss:bp in hexadecimal. */
 126.346 - 
 126.347 -+print_hex: 
 126.348 -+	movw	(%bp),%dx		/* load word into dx */
 126.349 -+	movb	$4, %cl
 126.350 -+	call	print_2digits
 126.351 -+print_2digits: 
 126.352 -+	call	print_digit
 126.353 -+/* fall through */
 126.354 -+print_digit: 
 126.355 -+	rol	%cl,%dx			/* rotate to use lowest 4 bits */
 126.356 -+	movb	$0x0f, %al		/* mask for nybble */
 126.357 -+	andb	%dl,%al
 126.358 -+	addb	$0x90, %al		/* convert al to ascii hex */
 126.359 -+	daa				/* (four instructions) */
 126.360 -+	adcb	$0x40, %al
 126.361 -+	daa
 126.362 -+print_char:
 126.363 -+	movb	$0x0e, %ah		/* write char, tty mode */
 126.364 -+	movw	$0x0007, %bx		/* page 0, attribute 7 (normal) */
 126.365 -+	int	$0x10
 126.366 -+	ret
 126.367 -+
 126.368 -+sread:	.word 0				/* sectors read of current track */
 126.369 -+head:	.word 0				/* current head */
 126.370 -+track:	.word 0				/* current track */
 126.371 -+
 126.372 -+sectors: 
 126.373 -+	.word 0
 126.374 -+
 126.375 -+dpseg:	.word 0
 126.376 -+dpoff:	.word 0
 126.377 -+
 126.378 -+disksizes: 
 126.379 -+	.byte 36,18,15,9,0
 126.380 -+
 126.381 -+msg1: 
 126.382 -+	.ascii "Loading ROM image"
 126.383 -+msg1end: 
 126.384 - 
 126.385 - 	.org	497
 126.386 - setup_sects: 
 126.387 -@@ -106,13 +418,6 @@
 126.388 - 
 126.389 - 	.org	512
 126.390 - 
 126.391 --	.section ".zinfo.fixup", "a"	/* Compressor fixup information */
 126.392 --	.ascii	"SUBW"
 126.393 --	.long	syssize
 126.394 --	.long	16
 126.395 --	.long	0
 126.396 --	.previous
 126.397 --	
 126.398 - /*
 126.399 - 	We're now at the beginning of the second sector of the image -
 126.400 - 	where the setup code goes.
 126.401 -@@ -123,14 +428,18 @@
 126.402 - 	executing the Etherboot image that's loaded at SYSSEG:0 and
 126.403 - 	whose entry point is SYSSEG:0.
 126.404 - */
 126.405 --setup_code:
 126.406 -+setup_code: 
 126.407 -+	pushw	$(SYSSEG-(PREFIXSIZE/16))
 126.408 - 	/* Etherboot expects to be contiguous in memory once loaded.
 126.409 - 	 * LILO doesn't do this, but since we don't need any
 126.410 - 	 * information that's left in the prefix, it doesn't matter:
 126.411 - 	 * we just have to ensure that %cs:0000 is where the start of
 126.412 - 	 * the Etherboot image *would* be.
 126.413 - 	 */
 126.414 --	ljmp	$(SYSSEG-(PREFIXSIZE/16)), $run_etherboot
 126.415 -+go_setup_code: 
 126.416 -+	pushw	$run_etherboot
 126.417 -+	/* Calculated lcall to _start with %cs:0000 = image start */
 126.418 -+	lret
 126.419 - 
 126.420 - 
 126.421 - 	.org	PREFIXSIZE
 126.422 -@@ -140,6 +449,10 @@
 126.423 - run_etherboot:
 126.424 - 	call	install
 126.425 - 
 126.426 -+	/* Set up real-mode stack */
 126.427 -+	movw	%bx, %ss
 126.428 -+	movw	$_estack16, %sp
 126.429 -+
 126.430 - 	/* Jump to .text16 segment */
 126.431 - 	pushw	%ax
 126.432 - 	pushw	$1f
   127.1 --- a/gpxe/stuff/url_list.u	Wed May 09 17:03:28 2018 +0300
   127.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   127.3 @@ -1,20 +0,0 @@
   127.4 ---- gpxe-0.9.3/src/usr/autoboot.c
   127.5 -+++ gpxe-0.9.3/src/usr/autoboot.c
   127.6 -@@ -229,9 +229,14 @@
   127.7 - 		set_url ( buf, forced_url.url );
   127.8 - 	}
   127.9 -     while (1) {
  127.10 --	if ( buf[0] ) {
  127.11 --		printf ( "Booting from filename \"%s\"\n", buf );
  127.12 --		return boot_filename ( buf );
  127.13 -+	while ( buf[0] ) {
  127.14 -+		char *p;
  127.15 -+		for ( p = buf; *p && *p != ','; p++ );
  127.16 -+		if ( *p ) *p++ = 0;
  127.17 -+		set_url ( buf, buf );
  127.18 -+		printf ( "Booting from filename \"%s\"\n", buf );
  127.19 -+		if ( boot_filename ( buf ) == 0 ) return 0;
  127.20 -+		strcpy( buf, p );
  127.21 - 	}
  127.22 - 	
  127.23 - 	/* No filename; try the root path */
   128.1 --- a/grub/receipt	Wed May 09 17:03:28 2018 +0300
   128.2 +++ b/grub/receipt	Thu May 10 21:12:00 2018 +0300
   128.3 @@ -16,12 +16,6 @@
   128.4  # Rules to configure and make the package.
   128.5  compile_rules()
   128.6  {
   128.7 -	cd $src
   128.8 -	for i in $stuff/*.diff ; do
   128.9 -		[ -f $(basename $i) ] && continue
  128.10 -		patch -p1 < $i
  128.11 -		touch $(basename $i)
  128.12 -	done
  128.13  	sed -i 's/\[ .grub-probe.*\]/mount | grep $grubdir | grep -q xfs/' \
  128.14  		util/grub-install.in
  128.15  	./configure CC=gcc-3 --prefix=/usr --infodir=/usr/share/info \
   129.1 --- a/grub/stuff/dev_partition.diff	Wed May 09 17:03:28 2018 +0300
   129.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   129.3 @@ -1,17 +0,0 @@
   129.4 -Partition can be ${dev}$num or ${dev}p$num
   129.5 ---- grub-0.97/lib/device.c
   129.6 -+++ grub-0.97/lib/device.c
   129.7 -@@ -867,6 +867,13 @@
   129.8 -   fd = open (dev, O_RDWR);
   129.9 -   if (fd < 0)
  129.10 -     {
  129.11 -+      strcpy (dev, map[drive]);
  129.12 -+      sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
  129.13 -+      fd = open (dev, O_RDWR);
  129.14 -+    }
  129.15 -+  
  129.16 -+  if (fd < 0)
  129.17 -+    {
  129.18 -       errnum = ERR_NO_PART;
  129.19 -       return 0;
  129.20 -     }
   130.1 --- a/grub/stuff/ext3_256byte_inode.diff	Wed May 09 17:03:28 2018 +0300
   130.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   130.3 @@ -1,102 +0,0 @@
   130.4 -
   130.5 -Patch from Red Hat. See #463236, #463123 (and #491076 for the reviewed version)
   130.6 -
   130.7 -diff -ur grub-0.97/stage2/fsys_ext2fs.c grub-0.97.new/stage2/fsys_ext2fs.c
   130.8 ---- grub-0.97/stage2/fsys_ext2fs.c	2008-07-23 01:18:18.000000000 +0200
   130.9 -+++ grub-0.97.new/stage2/fsys_ext2fs.c	2008-07-25 14:33:29.000000000 +0200
  130.10 -@@ -79,7 +79,52 @@
  130.11 -     __u32 s_rev_level;		/* Revision level */
  130.12 -     __u16 s_def_resuid;		/* Default uid for reserved blocks */
  130.13 -     __u16 s_def_resgid;		/* Default gid for reserved blocks */
  130.14 --    __u32 s_reserved[235];	/* Padding to the end of the block */
  130.15 -+    /*
  130.16 -+     * These fields are for EXT2_DYNAMIC_REV superblocks only.
  130.17 -+     *
  130.18 -+     * Note: the difference between the compatible feature set and
  130.19 -+     * the incompatible feature set is that if there is a bit set
  130.20 -+     * in the incompatible feature set that the kernel doesn't
  130.21 -+     * know about, it should refuse to mount the filesystem.
  130.22 -+     *
  130.23 -+     * e2fsck's requirements are more strict; if it doesn't know
  130.24 -+     * about a feature in either the compatible or incompatible
  130.25 -+     * feature set, it must abort and not try to meddle with
  130.26 -+     * things it doesn't understand...
  130.27 -+     */
  130.28 -+    __u32 s_first_ino;		/* First non-reserved inode */
  130.29 -+    __u16 s_inode_size;		/* size of inode structure */
  130.30 -+    __u16 s_block_group_nr;	/* block group # of this superblock */
  130.31 -+    __u32 s_feature_compat;	/* compatible feature set */
  130.32 -+    __u32 s_feature_incompat;	/* incompatible feature set */
  130.33 -+    __u32 s_feature_ro_compat;	/* readonly-compatible feature set */
  130.34 -+    __u8  s_uuid[16];		/* 128-bit uuid for volume */
  130.35 -+    char  s_volume_name[16];	/* volume name */
  130.36 -+    char  s_last_mounted[64];	/* directory where last mounted */
  130.37 -+    __u32 s_algorithm_usage_bitmap; /* For compression */
  130.38 -+    /*
  130.39 -+     * Performance hints.  Directory preallocation should only
  130.40 -+     * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
  130.41 -+     */
  130.42 -+    __u8  s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
  130.43 -+    __u8  s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
  130.44 -+    __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
  130.45 -+    /*
  130.46 -+     * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
  130.47 -+     */
  130.48 -+    __u8 s_journal_uuid[16];	/* uuid of journal superblock */
  130.49 -+    __u32 s_journal_inum;	/* inode number of journal file */
  130.50 -+    __u32 s_journal_dev;	/* device number of journal file */
  130.51 -+    __u32 s_last_orphan;	/* start of list of inodes to delete */
  130.52 -+    __u32 s_hash_seed[4];	/* HTREE hash seed */
  130.53 -+    __u8  s_def_hash_version;	/* Default hash version to use */
  130.54 -+    __u8  s_jnl_backup_type; 	/* Default type of journal backup */
  130.55 -+    __u16 s_reserved_word_pad;
  130.56 -+    __u32 s_default_mount_opts;
  130.57 -+    __u32 s_first_meta_bg;	/* First metablock group */
  130.58 -+    __u32 s_mkfs_time;		/* When the filesystem was created */
  130.59 -+    __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
  130.60 -+    __u32 s_reserved[172];	/* Padding to the end of the block */
  130.61 -   };
  130.62 - 
  130.63 - struct ext2_group_desc
  130.64 -@@ -218,6 +263,14 @@
  130.65 - #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
  130.66 - #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
  130.67 - 
  130.68 -+#define EXT2_GOOD_OLD_REV	0	/* The good old (original) format */
  130.69 -+#define EXT2_DYNAMIC_REV	1	/* V2 format w/ dynamic inode sizes */
  130.70 -+#define EXT2_GOOD_OLD_INODE_SIZE 128
  130.71 -+#define EXT2_INODE_SIZE(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
  130.72 -+				EXT2_GOOD_OLD_INODE_SIZE : \
  130.73 -+				(s)->s_inode_size)
  130.74 -+#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
  130.75 -+
  130.76 - /* linux/ext2_fs.h */
  130.77 - #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
  130.78 - /* kind of from ext2/super.c */
  130.79 -@@ -553,7 +606,7 @@
  130.80 -       gdp = GROUP_DESC;
  130.81 -       ino_blk = gdp[desc].bg_inode_table +
  130.82 - 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
  130.83 --	 >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
  130.84 -+	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
  130.85 - #ifdef E2DEBUG
  130.86 -       printf ("inode table fsblock=%d\n", ino_blk);
  130.87 - #endif /* E2DEBUG */
  130.88 -@@ -565,13 +618,12 @@
  130.89 -       /* reset indirect blocks! */
  130.90 -       mapblock2 = mapblock1 = -1;
  130.91 - 
  130.92 --      raw_inode = INODE +
  130.93 --	((current_ino - 1)
  130.94 --	 & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
  130.95 -+      raw_inode = (struct ext2_inode *)((char *)INODE +
  130.96 -+	((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
  130.97 -+	EXT2_INODE_SIZE (SUPERBLOCK));
  130.98 - #ifdef E2DEBUG
  130.99 -       printf ("ipb=%d, sizeof(inode)=%d\n",
 130.100 --	      (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
 130.101 --	      sizeof (struct ext2_inode));
 130.102 -+	      EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
 130.103 -       printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
 130.104 -       printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
 130.105 -       for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
   131.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   131.2 +++ b/grub/stuff/patches/dev_partition.diff	Thu May 10 21:12:00 2018 +0300
   131.3 @@ -0,0 +1,17 @@
   131.4 +Partition can be ${dev}$num or ${dev}p$num
   131.5 +--- grub-0.97/lib/device.c
   131.6 ++++ grub-0.97/lib/device.c
   131.7 +@@ -867,6 +867,13 @@
   131.8 +   fd = open (dev, O_RDWR);
   131.9 +   if (fd < 0)
  131.10 +     {
  131.11 ++      strcpy (dev, map[drive]);
  131.12 ++      sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
  131.13 ++      fd = open (dev, O_RDWR);
  131.14 ++    }
  131.15 ++  
  131.16 ++  if (fd < 0)
  131.17 ++    {
  131.18 +       errnum = ERR_NO_PART;
  131.19 +       return 0;
  131.20 +     }
   132.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   132.2 +++ b/grub/stuff/patches/ext3_256byte_inode.diff	Thu May 10 21:12:00 2018 +0300
   132.3 @@ -0,0 +1,102 @@
   132.4 +
   132.5 +Patch from Red Hat. See #463236, #463123 (and #491076 for the reviewed version)
   132.6 +
   132.7 +diff -ur grub-0.97/stage2/fsys_ext2fs.c grub-0.97.new/stage2/fsys_ext2fs.c
   132.8 +--- grub-0.97/stage2/fsys_ext2fs.c	2008-07-23 01:18:18.000000000 +0200
   132.9 ++++ grub-0.97.new/stage2/fsys_ext2fs.c	2008-07-25 14:33:29.000000000 +0200
  132.10 +@@ -79,7 +79,52 @@
  132.11 +     __u32 s_rev_level;		/* Revision level */
  132.12 +     __u16 s_def_resuid;		/* Default uid for reserved blocks */
  132.13 +     __u16 s_def_resgid;		/* Default gid for reserved blocks */
  132.14 +-    __u32 s_reserved[235];	/* Padding to the end of the block */
  132.15 ++    /*
  132.16 ++     * These fields are for EXT2_DYNAMIC_REV superblocks only.
  132.17 ++     *
  132.18 ++     * Note: the difference between the compatible feature set and
  132.19 ++     * the incompatible feature set is that if there is a bit set
  132.20 ++     * in the incompatible feature set that the kernel doesn't
  132.21 ++     * know about, it should refuse to mount the filesystem.
  132.22 ++     *
  132.23 ++     * e2fsck's requirements are more strict; if it doesn't know
  132.24 ++     * about a feature in either the compatible or incompatible
  132.25 ++     * feature set, it must abort and not try to meddle with
  132.26 ++     * things it doesn't understand...
  132.27 ++     */
  132.28 ++    __u32 s_first_ino;		/* First non-reserved inode */
  132.29 ++    __u16 s_inode_size;		/* size of inode structure */
  132.30 ++    __u16 s_block_group_nr;	/* block group # of this superblock */
  132.31 ++    __u32 s_feature_compat;	/* compatible feature set */
  132.32 ++    __u32 s_feature_incompat;	/* incompatible feature set */
  132.33 ++    __u32 s_feature_ro_compat;	/* readonly-compatible feature set */
  132.34 ++    __u8  s_uuid[16];		/* 128-bit uuid for volume */
  132.35 ++    char  s_volume_name[16];	/* volume name */
  132.36 ++    char  s_last_mounted[64];	/* directory where last mounted */
  132.37 ++    __u32 s_algorithm_usage_bitmap; /* For compression */
  132.38 ++    /*
  132.39 ++     * Performance hints.  Directory preallocation should only
  132.40 ++     * happen if the EXT2_FEATURE_COMPAT_DIR_PREALLOC flag is on.
  132.41 ++     */
  132.42 ++    __u8  s_prealloc_blocks;	/* Nr of blocks to try to preallocate*/
  132.43 ++    __u8  s_prealloc_dir_blocks;	/* Nr to preallocate for dirs */
  132.44 ++    __u16 s_reserved_gdt_blocks;/* Per group table for online growth */
  132.45 ++    /*
  132.46 ++     * Journaling support valid if EXT2_FEATURE_COMPAT_HAS_JOURNAL set.
  132.47 ++     */
  132.48 ++    __u8 s_journal_uuid[16];	/* uuid of journal superblock */
  132.49 ++    __u32 s_journal_inum;	/* inode number of journal file */
  132.50 ++    __u32 s_journal_dev;	/* device number of journal file */
  132.51 ++    __u32 s_last_orphan;	/* start of list of inodes to delete */
  132.52 ++    __u32 s_hash_seed[4];	/* HTREE hash seed */
  132.53 ++    __u8  s_def_hash_version;	/* Default hash version to use */
  132.54 ++    __u8  s_jnl_backup_type; 	/* Default type of journal backup */
  132.55 ++    __u16 s_reserved_word_pad;
  132.56 ++    __u32 s_default_mount_opts;
  132.57 ++    __u32 s_first_meta_bg;	/* First metablock group */
  132.58 ++    __u32 s_mkfs_time;		/* When the filesystem was created */
  132.59 ++    __u32 s_jnl_blocks[17]; 	/* Backup of the journal inode */
  132.60 ++    __u32 s_reserved[172];	/* Padding to the end of the block */
  132.61 +   };
  132.62 + 
  132.63 + struct ext2_group_desc
  132.64 +@@ -218,6 +263,14 @@
  132.65 + #define EXT2_ADDR_PER_BLOCK(s)          (EXT2_BLOCK_SIZE(s) / sizeof (__u32))
  132.66 + #define EXT2_ADDR_PER_BLOCK_BITS(s)		(log2(EXT2_ADDR_PER_BLOCK(s)))
  132.67 + 
  132.68 ++#define EXT2_GOOD_OLD_REV	0	/* The good old (original) format */
  132.69 ++#define EXT2_DYNAMIC_REV	1	/* V2 format w/ dynamic inode sizes */
  132.70 ++#define EXT2_GOOD_OLD_INODE_SIZE 128
  132.71 ++#define EXT2_INODE_SIZE(s)	(((s)->s_rev_level == EXT2_GOOD_OLD_REV) ? \
  132.72 ++				EXT2_GOOD_OLD_INODE_SIZE : \
  132.73 ++				(s)->s_inode_size)
  132.74 ++#define EXT2_INODES_PER_BLOCK(s)	(EXT2_BLOCK_SIZE(s)/EXT2_INODE_SIZE(s))
  132.75 ++
  132.76 + /* linux/ext2_fs.h */
  132.77 + #define EXT2_BLOCK_SIZE_BITS(s)        ((s)->s_log_block_size + 10)
  132.78 + /* kind of from ext2/super.c */
  132.79 +@@ -553,7 +606,7 @@
  132.80 +       gdp = GROUP_DESC;
  132.81 +       ino_blk = gdp[desc].bg_inode_table +
  132.82 + 	(((current_ino - 1) % (SUPERBLOCK->s_inodes_per_group))
  132.83 +-	 >> log2 (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)));
  132.84 ++	 >> log2 (EXT2_INODES_PER_BLOCK (SUPERBLOCK)));
  132.85 + #ifdef E2DEBUG
  132.86 +       printf ("inode table fsblock=%d\n", ino_blk);
  132.87 + #endif /* E2DEBUG */
  132.88 +@@ -565,13 +618,12 @@
  132.89 +       /* reset indirect blocks! */
  132.90 +       mapblock2 = mapblock1 = -1;
  132.91 + 
  132.92 +-      raw_inode = INODE +
  132.93 +-	((current_ino - 1)
  132.94 +-	 & (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode) - 1));
  132.95 ++      raw_inode = (struct ext2_inode *)((char *)INODE +
  132.96 ++	((current_ino - 1) & (EXT2_INODES_PER_BLOCK (SUPERBLOCK) - 1)) *
  132.97 ++	EXT2_INODE_SIZE (SUPERBLOCK));
  132.98 + #ifdef E2DEBUG
  132.99 +       printf ("ipb=%d, sizeof(inode)=%d\n",
 132.100 +-	      (EXT2_BLOCK_SIZE (SUPERBLOCK) / sizeof (struct ext2_inode)),
 132.101 +-	      sizeof (struct ext2_inode));
 132.102 ++	      EXT2_INODES_PER_BLOCK (SUPERBLOCK), EXT2_INODE_SIZE (SUPERBLOCK));
 132.103 +       printf ("inode=%x, raw_inode=%x\n", INODE, raw_inode);
 132.104 +       printf ("offset into inode table block=%d\n", (int) raw_inode - (int) INODE);
 132.105 +       for (i = (unsigned char *) INODE; i <= (unsigned char *) raw_inode;
   133.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   133.2 +++ b/grub/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   133.3 @@ -0,0 +1,3 @@
   133.4 +-p1|dev_partition.diff
   133.5 +-p1|ext3_256byte_inode.diff
   133.6 +-p1|xfs_freeze.diff
   134.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   134.2 +++ b/grub/stuff/patches/xfs_freeze.diff	Thu May 10 21:12:00 2018 +0300
   134.3 @@ -0,0 +1,21 @@
   134.4 +diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in
   134.5 +--- grub-0.97.old/util/grub-install.in	2004-07-24 20:57:31.000000000 +0200
   134.6 ++++ grub-0.97/util/grub-install.in	2009-01-16 22:15:46.000000000 +0100
   134.7 +@@ -422,6 +422,17 @@
   134.8 + test -n "$mkimg" && img_file=`$mkimg`
   134.9 + test -n "$mklog" && log_file=`$mklog`
  134.10 + 
  134.11 ++# GRUB will try to verify that stage2 is accessible using its own
  134.12 ++# filesystem drivers.  Make sure it's committed to disk.
  134.13 ++sync
  134.14 ++
  134.15 ++# On XFS, sync() is not enough.
  134.16 ++if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then
  134.17 ++  xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir}
  134.18 ++  # We don't have set -e.  If xfs_freeze failed, it's worth trying anyway,
  134.19 ++  # maybe we're lucky.
  134.20 ++fi
  134.21 ++
  134.22 + for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
  134.23 +     count=5
  134.24 +     tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
   135.1 --- a/grub/stuff/xfs_freeze.diff	Wed May 09 17:03:28 2018 +0300
   135.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   135.3 @@ -1,21 +0,0 @@
   135.4 -diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in
   135.5 ---- grub-0.97.old/util/grub-install.in	2004-07-24 20:57:31.000000000 +0200
   135.6 -+++ grub-0.97/util/grub-install.in	2009-01-16 22:15:46.000000000 +0100
   135.7 -@@ -422,6 +422,17 @@
   135.8 - test -n "$mkimg" && img_file=`$mkimg`
   135.9 - test -n "$mklog" && log_file=`$mklog`
  135.10 - 
  135.11 -+# GRUB will try to verify that stage2 is accessible using its own
  135.12 -+# filesystem drivers.  Make sure it's committed to disk.
  135.13 -+sync
  135.14 -+
  135.15 -+# On XFS, sync() is not enough.
  135.16 -+if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then
  135.17 -+  xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir}
  135.18 -+  # We don't have set -e.  If xfs_freeze failed, it's worth trying anyway,
  135.19 -+  # maybe we're lucky.
  135.20 -+fi
  135.21 -+
  135.22 - for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
  135.23 -     count=5
  135.24 -     tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
   136.1 --- a/grub4dos/receipt	Wed May 09 17:03:28 2018 +0300
   136.2 +++ b/grub4dos/receipt	Thu May 10 21:12:00 2018 +0300
   136.3 @@ -15,11 +15,6 @@
   136.4  SPLIT="grub4dos-linux"
   136.5  
   136.6  compile_rules() {
   136.7 -	for i in $stuff/*.diff ; do
   136.8 -		[ -f $(basename $i) ] && continue
   136.9 -		patch -p1 < $i
  136.10 -		touch $(basename $i)
  136.11 -	done
  136.12  	sed -i 's/\[ .grub-probe.*\]/mount | grep $grubdir | grep -q xfs/' \
  136.13  		util/grub-install.in
  136.14  	sh ./configure CC=gcc-3 CFLAGS="-march=i486  -Os -pipe" \
   137.1 --- a/grub4dos/stuff/dev_partition.diff	Wed May 09 17:03:28 2018 +0300
   137.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   137.3 @@ -1,17 +0,0 @@
   137.4 -Partition can be ${dev}$num or ${dev}p$num
   137.5 ---- grub-0.97/lib/device.c
   137.6 -+++ grub-0.97/lib/device.c
   137.7 -@@ -867,6 +867,13 @@
   137.8 -   fd = open (dev, O_RDWR);
   137.9 -   if (fd < 0)
  137.10 -     {
  137.11 -+      strcpy (dev, map[drive]);
  137.12 -+      sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
  137.13 -+      fd = open (dev, O_RDWR);
  137.14 -+    }
  137.15 -+  
  137.16 -+  if (fd < 0)
  137.17 -+    {
  137.18 -       errnum = ERR_NO_PART;
  137.19 -       return 0;
  137.20 -     }
   138.1 --- a/grub4dos/stuff/lzma.diff	Wed May 09 17:03:28 2018 +0300
   138.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   138.3 @@ -1,1761 +0,0 @@
   138.4 -From http://code.google.com/p/grub4dos-chenall/issues/detail?id=6
   138.5 -
   138.6 -diff -Naur ../grub4dos-chenall-r63/stage2/common.c ./stage2/common.c
   138.7 ---- grub4dos-chenall-r63/stage2/common.c	2010-11-19 12:41:03.196955000 +0700
   138.8 -+++ grub4dos/stage2/common.c	2010-11-23 21:28:26.509102100 +0700
   138.9 -@@ -143,6 +143,7 @@
  138.10 -   [ERR_WRITE_GZIP_FILE] = "Attempt to write a gzip file",
  138.11 -   [ERR_FUNC_CALL] = "Invalid function call",
  138.12 - //  [ERR_WRITE_TO_NON_MEM_DRIVE] = "Only RAM drives can be written when running in a script",
  138.13 -+  [ERR_NOT_ENOUGH_MEMORY] = "Not enough memory",
  138.14 - 
  138.15 - };
  138.16 - 
  138.17 -diff -Naur ../grub4dos-chenall-r63/stage2/dec_lzma.c ./stage2/dec_lzma.c
  138.18 ---- grub4dos-chenall-r63/stage2/dec_lzma.c	1970-01-01 07:00:00.000000000 +0700
  138.19 -+++ grub4dos/stage2/dec_lzma.c	2010-11-28 22:12:06.452791800 +0700
  138.20 -@@ -0,0 +1,1384 @@
  138.21 -+/*
  138.22 -+ *  GRUB4DOS  --  GRand Unified Bootloader
  138.23 -+ *  Copyright (C) 1999  Free Software Foundation, Inc.
  138.24 -+ *
  138.25 -+ *  This program is free software; you can redistribute it and/or modify
  138.26 -+ *  it under the terms of the GNU General Public License as published by
  138.27 -+ *  the Free Software Foundation; either version 2 of the License, or
  138.28 -+ *  (at your option) any later version.
  138.29 -+ *
  138.30 -+ *  This program is distributed in the hope that it will be useful,
  138.31 -+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  138.32 -+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  138.33 -+ *  GNU General Public License for more details.
  138.34 -+ *
  138.35 -+ *  You should have received a copy of the GNU General Public License
  138.36 -+ *  along with this program; if not, write to the Free Software
  138.37 -+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  138.38 -+ */
  138.39 -+
  138.40 -+/*
  138.41 -+ *  Most of this file is derives from LZMA SDK 9.12 beta 
  138.42 -+ *  files Types.h, LzmaDec.h, LzmaDec.c by Igor Pavlov
  138.43 -+ *  It has been modified for used in GRUB4DOS.
  138.44 -+ */
  138.45 -+
  138.46 -+#ifndef NO_DECOMPRESSION
  138.47 -+
  138.48 -+#include "shared.h"
  138.49 -+#include "decomp.h"
  138.50 -+
  138.51 -+/* Types.h -- Basic types
  138.52 -+2010-03-11 : Igor Pavlov : Public domain */
  138.53 -+
  138.54 -+#define SZ_OK 0
  138.55 -+
  138.56 -+#define SZ_ERROR_DATA 1
  138.57 -+#define SZ_ERROR_MEM 2
  138.58 -+#define SZ_ERROR_CRC 3
  138.59 -+#define SZ_ERROR_UNSUPPORTED 4
  138.60 -+#define SZ_ERROR_PARAM 5
  138.61 -+#define SZ_ERROR_INPUT_EOF 6
  138.62 -+#define SZ_ERROR_OUTPUT_EOF 7
  138.63 -+#define SZ_ERROR_READ 8
  138.64 -+#define SZ_ERROR_WRITE 9
  138.65 -+#define SZ_ERROR_PROGRESS 10
  138.66 -+#define SZ_ERROR_FAIL 11
  138.67 -+#define SZ_ERROR_THREAD 12
  138.68 -+
  138.69 -+#define SZ_ERROR_ARCHIVE 16
  138.70 -+#define SZ_ERROR_NO_ARCHIVE 17
  138.71 -+
  138.72 -+typedef int SRes;
  138.73 -+typedef int WRes;
  138.74 -+
  138.75 -+#ifndef RINOK
  138.76 -+#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
  138.77 -+#endif
  138.78 -+
  138.79 -+typedef unsigned char Byte;
  138.80 -+typedef short Int16;
  138.81 -+typedef unsigned short UInt16;
  138.82 -+
  138.83 -+typedef int Int32;
  138.84 -+typedef unsigned int UInt32;
  138.85 -+
  138.86 -+typedef long long int Int64;
  138.87 -+typedef unsigned long long int UInt64;
  138.88 -+
  138.89 -+typedef UInt32 SizeT;
  138.90 -+typedef int ptrdiff_t;
  138.91 -+
  138.92 -+typedef int Bool;
  138.93 -+#define True 1
  138.94 -+#define False 0
  138.95 -+
  138.96 -+#define MY_STD_CALL
  138.97 -+#define MY_CDECL
  138.98 -+#define MY_FAST_CALL
  138.99 -+
 138.100 -+typedef struct
 138.101 -+{
 138.102 -+  void *(*Alloc)(void *p, SizeT size);
 138.103 -+  void (*Free)(void *p, void *address); /* address can be 0 */
 138.104 -+} ISzAlloc;
 138.105 -+
 138.106 -+#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
 138.107 -+#define IAlloc_Free(p, a) (p)->Free((p), a)
 138.108 -+
 138.109 -+/* -------------------------------------------------------------------------- */
 138.110 -+
 138.111 -+/* LzmaDec.h -- LZMA Decoder
 138.112 -+2009-02-07 : Igor Pavlov : Public domain */
 138.113 -+
 138.114 -+/* #define _LZMA_PROB32 */
 138.115 -+/* _LZMA_PROB32 can increase the speed on some CPUs,
 138.116 -+   but memory usage for CLzmaDec::probs will be doubled in that case */
 138.117 -+
 138.118 -+#ifdef _LZMA_PROB32
 138.119 -+#define UIntLzmaProb UInt32
 138.120 -+#else
 138.121 -+#define UIntLzmaProb UInt16
 138.122 -+#endif
 138.123 -+
 138.124 -+
 138.125 -+/* ---------- LZMA Properties ---------- */
 138.126 -+
 138.127 -+#define LZMA_PROPS_SIZE 5
 138.128 -+
 138.129 -+typedef struct _CLzmaProps
 138.130 -+{
 138.131 -+  unsigned lc, lp, pb;
 138.132 -+  UInt32 dicSize;
 138.133 -+} CLzmaProps;
 138.134 -+
 138.135 -+/* LzmaProps_Decode - decodes properties
 138.136 -+Returns:
 138.137 -+  SZ_OK
 138.138 -+  SZ_ERROR_UNSUPPORTED - Unsupported properties
 138.139 -+*/
 138.140 -+
 138.141 -+SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
 138.142 -+
 138.143 -+
 138.144 -+/* ---------- LZMA Decoder state ---------- */
 138.145 -+
 138.146 -+/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
 138.147 -+   Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
 138.148 -+
 138.149 -+#define LZMA_REQUIRED_INPUT_MAX 20
 138.150 -+
 138.151 -+typedef struct
 138.152 -+{
 138.153 -+  CLzmaProps prop;
 138.154 -+  UIntLzmaProb *probs;
 138.155 -+  const Byte *buf;
 138.156 -+  UInt32 range, code;
 138.157 -+  Byte   *dic; 
 138.158 -+  UInt32 dicPos;
 138.159 -+  UInt32 dicBufSize;
 138.160 -+  Byte   *inp;
 138.161 -+  UInt32 inpPos, inpSize;
 138.162 -+  UInt32 inpBufSize;
 138.163 -+  UInt32 processedPos;
 138.164 -+  UInt32 checkDicSize;
 138.165 -+  unsigned state;
 138.166 -+  UInt32 reps[4];
 138.167 -+  unsigned remainLen;
 138.168 -+  int needFlush;
 138.169 -+  int needInitState;
 138.170 -+  UInt32 numProbs;
 138.171 -+  unsigned tempBufSize;
 138.172 -+  Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
 138.173 -+  UInt64 inpFilePos;
 138.174 -+  UInt64 dicFilePos;
 138.175 -+  struct {
 138.176 -+      UInt64 fmax, fpos;
 138.177 -+  } filec, fileu;
 138.178 -+} CLzmaDec;
 138.179 -+
 138.180 -+#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
 138.181 -+
 138.182 -+void LzmaDec_Init(CLzmaDec *p);
 138.183 -+
 138.184 -+/* There are two types of LZMA streams:
 138.185 -+     0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
 138.186 -+     1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
 138.187 -+
 138.188 -+typedef enum
 138.189 -+{
 138.190 -+  LZMA_FINISH_ANY,   /* finish at any point */
 138.191 -+  LZMA_FINISH_END    /* block must be finished at the end */
 138.192 -+} ELzmaFinishMode;
 138.193 -+
 138.194 -+/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
 138.195 -+
 138.196 -+   You must use LZMA_FINISH_END, when you know that current output buffer
 138.197 -+   covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
 138.198 -+
 138.199 -+   If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
 138.200 -+   and output value of destLen will be less than output buffer size limit.
 138.201 -+   You can check status result also.
 138.202 -+
 138.203 -+   You can use multiple checks to test data integrity after full decompression:
 138.204 -+     1) Check Result and "status" variable.
 138.205 -+     2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
 138.206 -+     3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
 138.207 -+        You must use correct finish mode in that case. */
 138.208 -+
 138.209 -+typedef enum
 138.210 -+{
 138.211 -+  LZMA_STATUS_NOT_SPECIFIED,               /* use main error code instead */
 138.212 -+  LZMA_STATUS_FINISHED_WITH_MARK,          /* stream was finished with end mark. */
 138.213 -+  LZMA_STATUS_NOT_FINISHED,                /* stream was not finished */
 138.214 -+  LZMA_STATUS_NEEDS_MORE_INPUT,            /* you must provide more input bytes */
 138.215 -+  LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK  /* there is probability that stream was finished without end mark */
 138.216 -+} ELzmaStatus;
 138.217 -+
 138.218 -+/* ELzmaStatus is used only as output value for function call */
 138.219 -+
 138.220 -+
 138.221 -+/* ---------- Interfaces ---------- */
 138.222 -+
 138.223 -+/* There are 3 levels of interfaces:
 138.224 -+     1) Dictionary Interface
 138.225 -+     2) Buffer Interface
 138.226 -+     3) One Call Interface
 138.227 -+   You can select any of these interfaces, but don't mix functions from different
 138.228 -+   groups for same object. */
 138.229 -+
 138.230 -+
 138.231 -+/* There are two variants to allocate state for Dictionary Interface:
 138.232 -+     1) LzmaDec_Allocate / LzmaDec_Free
 138.233 -+     2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
 138.234 -+   You can use variant 2, if you set dictionary buffer manually.
 138.235 -+   For Buffer Interface you must always use variant 1.
 138.236 -+
 138.237 -+LzmaDec_Allocate* can return:
 138.238 -+  SZ_OK
 138.239 -+  SZ_ERROR_MEM         - Memory allocation error
 138.240 -+  SZ_ERROR_UNSUPPORTED - Unsupported properties
 138.241 -+*/
 138.242 -+   
 138.243 -+SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
 138.244 -+void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
 138.245 -+
 138.246 -+SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
 138.247 -+void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
 138.248 -+
 138.249 -+/* ---------- Dictionary Interface ---------- */
 138.250 -+
 138.251 -+/* You can use it, if you want to eliminate the overhead for data copying from
 138.252 -+   dictionary to some other external buffer.
 138.253 -+   You must work with CLzmaDec variables directly in this interface.
 138.254 -+
 138.255 -+   STEPS:
 138.256 -+     LzmaDec_Constr()
 138.257 -+     LzmaDec_Allocate()
 138.258 -+     for (each new stream)
 138.259 -+     {
 138.260 -+       LzmaDec_Init()
 138.261 -+       while (it needs more decompression)
 138.262 -+       {
 138.263 -+         LzmaDec_DecodeToDic()
 138.264 -+         use data from CLzmaDec::dic and update CLzmaDec::dicPos
 138.265 -+       }
 138.266 -+     }
 138.267 -+     LzmaDec_Free()
 138.268 -+*/
 138.269 -+
 138.270 -+/* LzmaDec_DecodeToDic
 138.271 -+   
 138.272 -+   The decoding to internal dictionary buffer (CLzmaDec::dic).
 138.273 -+   You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
 138.274 -+
 138.275 -+finishMode:
 138.276 -+  It has meaning only if the decoding reaches output limit (dicLimit).
 138.277 -+  LZMA_FINISH_ANY - Decode just dicLimit bytes.
 138.278 -+  LZMA_FINISH_END - Stream must be finished after dicLimit.
 138.279 -+
 138.280 -+Returns:
 138.281 -+  SZ_OK
 138.282 -+    status:
 138.283 -+      LZMA_STATUS_FINISHED_WITH_MARK
 138.284 -+      LZMA_STATUS_NOT_FINISHED
 138.285 -+      LZMA_STATUS_NEEDS_MORE_INPUT
 138.286 -+      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
 138.287 -+  SZ_ERROR_DATA - Data error
 138.288 -+*/
 138.289 -+
 138.290 -+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
 138.291 -+    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
 138.292 -+
 138.293 -+
 138.294 -+/* ---------- Buffer Interface ---------- */
 138.295 -+
 138.296 -+/* It's zlib-like interface.
 138.297 -+   See LzmaDec_DecodeToDic description for information about STEPS and return results,
 138.298 -+   but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
 138.299 -+   to work with CLzmaDec variables manually.
 138.300 -+
 138.301 -+finishMode:
 138.302 -+  It has meaning only if the decoding reaches output limit (*destLen).
 138.303 -+  LZMA_FINISH_ANY - Decode just destLen bytes.
 138.304 -+  LZMA_FINISH_END - Stream must be finished after (*destLen).
 138.305 -+*/
 138.306 -+
 138.307 -+SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
 138.308 -+    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
 138.309 -+
 138.310 -+
 138.311 -+/* ---------- One Call Interface ---------- */
 138.312 -+
 138.313 -+/* LzmaDecode
 138.314 -+
 138.315 -+finishMode:
 138.316 -+  It has meaning only if the decoding reaches output limit (*destLen).
 138.317 -+  LZMA_FINISH_ANY - Decode just destLen bytes.
 138.318 -+  LZMA_FINISH_END - Stream must be finished after (*destLen).
 138.319 -+
 138.320 -+Returns:
 138.321 -+  SZ_OK
 138.322 -+    status:
 138.323 -+      LZMA_STATUS_FINISHED_WITH_MARK
 138.324 -+      LZMA_STATUS_NOT_FINISHED
 138.325 -+      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
 138.326 -+  SZ_ERROR_DATA - Data error
 138.327 -+  SZ_ERROR_MEM  - Memory allocation error
 138.328 -+  SZ_ERROR_UNSUPPORTED - Unsupported properties
 138.329 -+  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
 138.330 -+*/
 138.331 -+
 138.332 -+SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
 138.333 -+    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
 138.334 -+    ELzmaStatus *status, ISzAlloc *alloc);
 138.335 -+
 138.336 -+/* -------------------------------------------------------------------------- */
 138.337 -+
 138.338 -+/* LzmaDec.c -- LZMA Decoder
 138.339 -+2009-09-20 : Igor Pavlov : Public domain */
 138.340 -+
 138.341 -+//#include "LzmaDec.h"
 138.342 -+
 138.343 -+//#include <string.h>
 138.344 -+
 138.345 -+#define kNumTopBits 24
 138.346 -+#define kTopValue ((UInt32)1 << kNumTopBits)
 138.347 -+
 138.348 -+#define kNumBitModelTotalBits 11
 138.349 -+#define kBitModelTotal (1 << kNumBitModelTotalBits)
 138.350 -+#define kNumMoveBits 5
 138.351 -+
 138.352 -+#define RC_INIT_SIZE 5
 138.353 -+
 138.354 -+#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
 138.355 -+
 138.356 -+#define TEST_BIT_0(p) ({ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; (code < bound);})
 138.357 -+#define UPDATE_0(p) range = bound; *(p) = (UIntLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
 138.358 -+#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (UIntLzmaProb)(ttt - (ttt >> kNumMoveBits));
 138.359 -+#define GET_BIT2(p, i, A0, A1) if(TEST_BIT_0(p)) \
 138.360 -+  { UPDATE_0(p); i = (i + i); A0; } else \
 138.361 -+  { UPDATE_1(p); i = (i + i) + 1; A1; }
 138.362 -+#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
 138.363 -+
 138.364 -+#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
 138.365 -+#define TREE_DECODE(probs, limit, i) \
 138.366 -+  { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
 138.367 -+
 138.368 -+/* #define _LZMA_SIZE_OPT */
 138.369 -+
 138.370 -+#ifdef _LZMA_SIZE_OPT
 138.371 -+#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
 138.372 -+#else
 138.373 -+#define TREE_6_DECODE(probs, i) \
 138.374 -+  { i = 1; \
 138.375 -+  TREE_GET_BIT(probs, i); \
 138.376 -+  TREE_GET_BIT(probs, i); \
 138.377 -+  TREE_GET_BIT(probs, i); \
 138.378 -+  TREE_GET_BIT(probs, i); \
 138.379 -+  TREE_GET_BIT(probs, i); \
 138.380 -+  TREE_GET_BIT(probs, i); \
 138.381 -+  i -= 0x40; }
 138.382 -+#endif
 138.383 -+
 138.384 -+#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
 138.385 -+
 138.386 -+#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
 138.387 -+#define UPDATE_0_CHECK range = bound;
 138.388 -+#define UPDATE_1_CHECK range -= bound; code -= bound;
 138.389 -+#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
 138.390 -+  { UPDATE_0_CHECK; i = (i + i); A0; } else \
 138.391 -+  { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
 138.392 -+#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
 138.393 -+#define TREE_DECODE_CHECK(probs, limit, i) \
 138.394 -+  { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
 138.395 -+
 138.396 -+
 138.397 -+#define kNumPosBitsMax 4
 138.398 -+#define kNumPosStatesMax (1 << kNumPosBitsMax)
 138.399 -+
 138.400 -+#define kLenNumLowBits 3
 138.401 -+#define kLenNumLowSymbols (1 << kLenNumLowBits)
 138.402 -+#define kLenNumMidBits 3
 138.403 -+#define kLenNumMidSymbols (1 << kLenNumMidBits)
 138.404 -+#define kLenNumHighBits 8
 138.405 -+#define kLenNumHighSymbols (1 << kLenNumHighBits)
 138.406 -+
 138.407 -+#define LenChoice 0
 138.408 -+#define LenChoice2 (LenChoice + 1)
 138.409 -+#define LenLow (LenChoice2 + 1)
 138.410 -+#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
 138.411 -+#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
 138.412 -+#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
 138.413 -+
 138.414 -+
 138.415 -+#define kNumStates 12
 138.416 -+#define kNumLitStates 7
 138.417 -+
 138.418 -+#define kStartPosModelIndex 4
 138.419 -+#define kEndPosModelIndex 14
 138.420 -+#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
 138.421 -+
 138.422 -+#define kNumPosSlotBits 6
 138.423 -+#define kNumLenToPosStates 4
 138.424 -+
 138.425 -+#define kNumAlignBits 4
 138.426 -+#define kAlignTableSize (1 << kNumAlignBits)
 138.427 -+
 138.428 -+#define kMatchMinLen 2
 138.429 -+#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
 138.430 -+
 138.431 -+#define IsMatch 0
 138.432 -+#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
 138.433 -+#define IsRepG0 (IsRep + kNumStates)
 138.434 -+#define IsRepG1 (IsRepG0 + kNumStates)
 138.435 -+#define IsRepG2 (IsRepG1 + kNumStates)
 138.436 -+#define IsRep0Long (IsRepG2 + kNumStates)
 138.437 -+#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
 138.438 -+#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
 138.439 -+#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
 138.440 -+#define LenCoder (Align + kAlignTableSize)
 138.441 -+#define RepLenCoder (LenCoder + kNumLenProbs)
 138.442 -+#define Literal (RepLenCoder + kNumLenProbs)
 138.443 -+
 138.444 -+#define LZMA_BASE_SIZE 1846
 138.445 -+#define LZMA_LIT_SIZE 768
 138.446 -+
 138.447 -+#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
 138.448 -+
 138.449 -+#if Literal != LZMA_BASE_SIZE
 138.450 -+StopCompilingDueBUG
 138.451 -+#endif
 138.452 -+
 138.453 -+#define LZMA_DIC_MIN (1 << 12)
 138.454 -+
 138.455 -+/* First LZMA-symbol is always decoded.
 138.456 -+And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
 138.457 -+Out:
 138.458 -+  Result:
 138.459 -+    SZ_OK - OK
 138.460 -+    SZ_ERROR_DATA - Error
 138.461 -+  p->remainLen:
 138.462 -+    < kMatchSpecLenStart : normal remain
 138.463 -+    = kMatchSpecLenStart : finished
 138.464 -+    = kMatchSpecLenStart + 1 : Flush marker
 138.465 -+    = kMatchSpecLenStart + 2 : State Init Marker
 138.466 -+*/
 138.467 -+
 138.468 -+static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
 138.469 -+{
 138.470 -+  UIntLzmaProb *probs = p->probs;
 138.471 -+
 138.472 -+  unsigned state = p->state;
 138.473 -+  UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
 138.474 -+  unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
 138.475 -+  unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;
 138.476 -+  unsigned lc = p->prop.lc;
 138.477 -+
 138.478 -+  Byte *dic = p->dic;
 138.479 -+  SizeT dicBufSize = p->dicBufSize;
 138.480 -+  SizeT dicPos = p->dicPos;
 138.481 -+  
 138.482 -+  UInt32 processedPos = p->processedPos;
 138.483 -+  UInt32 checkDicSize = p->checkDicSize;
 138.484 -+  unsigned len = 0;
 138.485 -+
 138.486 -+  const Byte *buf = p->buf;
 138.487 -+  UInt32 range = p->range;
 138.488 -+  UInt32 code = p->code;
 138.489 -+
 138.490 -+  do
 138.491 -+  {
 138.492 -+    UIntLzmaProb *prob;
 138.493 -+    UInt32 bound;
 138.494 -+    unsigned ttt;
 138.495 -+    unsigned posState = processedPos & pbMask;
 138.496 -+
 138.497 -+    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
 138.498 -+    if(TEST_BIT_0(prob))
 138.499 -+    {
 138.500 -+      unsigned symbol;
 138.501 -+      UPDATE_0(prob);
 138.502 -+      prob = probs + Literal;
 138.503 -+      if (checkDicSize != 0 || processedPos != 0)
 138.504 -+        prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +
 138.505 -+        (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));
 138.506 -+
 138.507 -+      if (state < kNumLitStates)
 138.508 -+      {
 138.509 -+        state -= (state < 4) ? state : 3;
 138.510 -+        symbol = 1;
 138.511 -+        do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
 138.512 -+      }
 138.513 -+      else
 138.514 -+      {
 138.515 -+        unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
 138.516 -+        unsigned offs = 0x100;
 138.517 -+        state -= (state < 10) ? 3 : 6;
 138.518 -+        symbol = 1;
 138.519 -+        do
 138.520 -+        {
 138.521 -+          unsigned bit;
 138.522 -+          UIntLzmaProb *probLit;
 138.523 -+          matchByte <<= 1;
 138.524 -+          bit = (matchByte & offs);
 138.525 -+          probLit = prob + offs + bit + symbol;
 138.526 -+          GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
 138.527 -+        }
 138.528 -+        while (symbol < 0x100);
 138.529 -+      }
 138.530 -+      dic[dicPos++] = (Byte)symbol;
 138.531 -+      processedPos++;
 138.532 -+      continue;
 138.533 -+    }
 138.534 -+    else
 138.535 -+    {
 138.536 -+      UPDATE_1(prob);
 138.537 -+      prob = probs + IsRep + state;
 138.538 -+      if(TEST_BIT_0(prob))
 138.539 -+      {
 138.540 -+        UPDATE_0(prob);
 138.541 -+        state += kNumStates;
 138.542 -+        prob = probs + LenCoder;
 138.543 -+      }
 138.544 -+      else
 138.545 -+      {
 138.546 -+        UPDATE_1(prob);
 138.547 -+        if (checkDicSize == 0 && processedPos == 0)
 138.548 -+          return SZ_ERROR_DATA;
 138.549 -+        prob = probs + IsRepG0 + state;
 138.550 -+        if(TEST_BIT_0(prob))
 138.551 -+        {
 138.552 -+          UPDATE_0(prob);
 138.553 -+          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
 138.554 -+          if(TEST_BIT_0(prob))
 138.555 -+          {
 138.556 -+            UPDATE_0(prob);
 138.557 -+            dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
 138.558 -+            dicPos++;
 138.559 -+            processedPos++;
 138.560 -+            state = state < kNumLitStates ? 9 : 11;
 138.561 -+            continue;
 138.562 -+          }
 138.563 -+          UPDATE_1(prob);
 138.564 -+        }
 138.565 -+        else
 138.566 -+        {
 138.567 -+          UInt32 distance;
 138.568 -+          UPDATE_1(prob);
 138.569 -+          prob = probs + IsRepG1 + state;
 138.570 -+          if(TEST_BIT_0(prob))
 138.571 -+          {
 138.572 -+            UPDATE_0(prob);
 138.573 -+            distance = rep1;
 138.574 -+          }
 138.575 -+          else
 138.576 -+          {
 138.577 -+            UPDATE_1(prob);
 138.578 -+            prob = probs + IsRepG2 + state;
 138.579 -+            if(TEST_BIT_0(prob))
 138.580 -+            {
 138.581 -+              UPDATE_0(prob);
 138.582 -+              distance = rep2;
 138.583 -+            }
 138.584 -+            else
 138.585 -+            {
 138.586 -+              UPDATE_1(prob);
 138.587 -+              distance = rep3;
 138.588 -+              rep3 = rep2;
 138.589 -+            }
 138.590 -+            rep2 = rep1;
 138.591 -+          }
 138.592 -+          rep1 = rep0;
 138.593 -+          rep0 = distance;
 138.594 -+        }
 138.595 -+        state = state < kNumLitStates ? 8 : 11;
 138.596 -+        prob = probs + RepLenCoder;
 138.597 -+      }
 138.598 -+      {
 138.599 -+        unsigned limit, offset;
 138.600 -+        UIntLzmaProb *probLen = prob + LenChoice;
 138.601 -+        if(TEST_BIT_0(probLen))
 138.602 -+        {
 138.603 -+          UPDATE_0(probLen);
 138.604 -+          probLen = prob + LenLow + (posState << kLenNumLowBits);
 138.605 -+          offset = 0;
 138.606 -+          limit = (1 << kLenNumLowBits);
 138.607 -+        }
 138.608 -+        else
 138.609 -+        {
 138.610 -+          UPDATE_1(probLen);
 138.611 -+          probLen = prob + LenChoice2;
 138.612 -+          if(TEST_BIT_0(probLen))
 138.613 -+          {
 138.614 -+            UPDATE_0(probLen);
 138.615 -+            probLen = prob + LenMid + (posState << kLenNumMidBits);
 138.616 -+            offset = kLenNumLowSymbols;
 138.617 -+            limit = (1 << kLenNumMidBits);
 138.618 -+          }
 138.619 -+          else
 138.620 -+          {
 138.621 -+            UPDATE_1(probLen);
 138.622 -+            probLen = prob + LenHigh;
 138.623 -+            offset = kLenNumLowSymbols + kLenNumMidSymbols;
 138.624 -+            limit = (1 << kLenNumHighBits);
 138.625 -+          }
 138.626 -+        }
 138.627 -+        TREE_DECODE(probLen, limit, len);
 138.628 -+        len += offset;
 138.629 -+      }
 138.630 -+
 138.631 -+      if (state >= kNumStates)
 138.632 -+      {
 138.633 -+        UInt32 distance;
 138.634 -+        prob = probs + PosSlot +
 138.635 -+            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
 138.636 -+        TREE_6_DECODE(prob, distance);
 138.637 -+        if (distance >= kStartPosModelIndex)
 138.638 -+        {
 138.639 -+          unsigned posSlot = (unsigned)distance;
 138.640 -+          int numDirectBits = (int)(((distance >> 1) - 1));
 138.641 -+          distance = (2 | (distance & 1));
 138.642 -+          if (posSlot < kEndPosModelIndex)
 138.643 -+          {
 138.644 -+            distance <<= numDirectBits;
 138.645 -+            prob = probs + SpecPos + distance - posSlot - 1;
 138.646 -+            {
 138.647 -+              UInt32 mask = 1;
 138.648 -+              unsigned i = 1;
 138.649 -+              do
 138.650 -+              {
 138.651 -+                GET_BIT2(prob + i, i, ; , distance |= mask);
 138.652 -+                mask <<= 1;
 138.653 -+              }
 138.654 -+              while (--numDirectBits != 0);
 138.655 -+            }
 138.656 -+          }
 138.657 -+          else
 138.658 -+          {
 138.659 -+            numDirectBits -= kNumAlignBits;
 138.660 -+            do
 138.661 -+            {
 138.662 -+              NORMALIZE
 138.663 -+              range >>= 1;
 138.664 -+              
 138.665 -+              {
 138.666 -+                UInt32 t;
 138.667 -+                code -= range;
 138.668 -+                t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
 138.669 -+                distance = (distance << 1) + (t + 1);
 138.670 -+                code += range & t;
 138.671 -+              }
 138.672 -+              /*
 138.673 -+              distance <<= 1;
 138.674 -+              if (code >= range)
 138.675 -+              {
 138.676 -+                code -= range;
 138.677 -+                distance |= 1;
 138.678 -+              }
 138.679 -+              */
 138.680 -+            }
 138.681 -+            while (--numDirectBits != 0);
 138.682 -+            prob = probs + Align;
 138.683 -+            distance <<= kNumAlignBits;
 138.684 -+            {
 138.685 -+              unsigned i = 1;
 138.686 -+              GET_BIT2(prob + i, i, ; , distance |= 1);
 138.687 -+              GET_BIT2(prob + i, i, ; , distance |= 2);
 138.688 -+              GET_BIT2(prob + i, i, ; , distance |= 4);
 138.689 -+              GET_BIT2(prob + i, i, ; , distance |= 8);
 138.690 -+            }
 138.691 -+            if (distance == (UInt32)0xFFFFFFFF)
 138.692 -+            {
 138.693 -+              len += kMatchSpecLenStart;
 138.694 -+              state -= kNumStates;
 138.695 -+              break;
 138.696 -+            }
 138.697 -+          }
 138.698 -+        }
 138.699 -+        rep3 = rep2;
 138.700 -+        rep2 = rep1;
 138.701 -+        rep1 = rep0;
 138.702 -+        rep0 = distance + 1;
 138.703 -+        if (checkDicSize == 0)
 138.704 -+        {
 138.705 -+          if (distance >= processedPos)
 138.706 -+            return SZ_ERROR_DATA;
 138.707 -+        }
 138.708 -+        else if (distance >= checkDicSize)
 138.709 -+          return SZ_ERROR_DATA;
 138.710 -+        state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
 138.711 -+      }
 138.712 -+
 138.713 -+      len += kMatchMinLen;
 138.714 -+
 138.715 -+      if (limit == dicPos)
 138.716 -+        return SZ_ERROR_DATA;
 138.717 -+      {
 138.718 -+        SizeT rem = limit - dicPos;
 138.719 -+        unsigned curLen = ((rem < len) ? (unsigned)rem : len);
 138.720 -+        SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);
 138.721 -+
 138.722 -+        processedPos += curLen;
 138.723 -+
 138.724 -+        len -= curLen;
 138.725 -+        if (pos + curLen <= dicBufSize)
 138.726 -+        {
 138.727 -+          Byte *dest = dic + dicPos;
 138.728 -+          ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
 138.729 -+          const Byte *lim = dest + curLen;
 138.730 -+          dicPos += curLen;
 138.731 -+          do
 138.732 -+            *(dest) = (Byte)(*(dest + src));
 138.733 -+          while (++dest != lim);
 138.734 -+        }
 138.735 -+        else
 138.736 -+        {
 138.737 -+          do
 138.738 -+          {
 138.739 -+            dic[dicPos++] = dic[pos];
 138.740 -+            if (++pos == dicBufSize)
 138.741 -+              pos = 0;
 138.742 -+          }
 138.743 -+          while (--curLen != 0);
 138.744 -+        }
 138.745 -+      }
 138.746 -+    }
 138.747 -+  }
 138.748 -+  while (dicPos < limit && buf < bufLimit);
 138.749 -+  NORMALIZE;
 138.750 -+  p->buf = buf;
 138.751 -+  p->range = range;
 138.752 -+  p->code = code;
 138.753 -+  p->remainLen = len;
 138.754 -+  p->dicPos = dicPos;
 138.755 -+  p->processedPos = processedPos;
 138.756 -+  p->reps[0] = rep0;
 138.757 -+  p->reps[1] = rep1;
 138.758 -+  p->reps[2] = rep2;
 138.759 -+  p->reps[3] = rep3;
 138.760 -+  p->state = state;
 138.761 -+
 138.762 -+  return SZ_OK;
 138.763 -+}
 138.764 -+
 138.765 -+static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
 138.766 -+{
 138.767 -+  if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
 138.768 -+  {
 138.769 -+    Byte *dic = p->dic;
 138.770 -+    SizeT dicPos = p->dicPos;
 138.771 -+    SizeT dicBufSize = p->dicBufSize;
 138.772 -+    unsigned len = p->remainLen;
 138.773 -+    UInt32 rep0 = p->reps[0];
 138.774 -+    if (limit - dicPos < len)
 138.775 -+      len = (unsigned)(limit - dicPos);
 138.776 -+
 138.777 -+    if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
 138.778 -+      p->checkDicSize = p->prop.dicSize;
 138.779 -+
 138.780 -+    p->processedPos += len;
 138.781 -+    p->remainLen -= len;
 138.782 -+    while (len-- != 0)
 138.783 -+    {
 138.784 -+      dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
 138.785 -+      dicPos++;
 138.786 -+    }
 138.787 -+    p->dicPos = dicPos;
 138.788 -+  }
 138.789 -+}
 138.790 -+
 138.791 -+static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
 138.792 -+{
 138.793 -+  do
 138.794 -+  {
 138.795 -+    SizeT limit2 = limit;
 138.796 -+    if (p->checkDicSize == 0)
 138.797 -+    {
 138.798 -+      UInt32 rem = p->prop.dicSize - p->processedPos;
 138.799 -+      if (limit - p->dicPos > rem)
 138.800 -+        limit2 = p->dicPos + rem;
 138.801 -+    }
 138.802 -+    RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));
 138.803 -+    if (p->processedPos >= p->prop.dicSize)
 138.804 -+      p->checkDicSize = p->prop.dicSize;
 138.805 -+    LzmaDec_WriteRem(p, limit);
 138.806 -+  }
 138.807 -+  while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
 138.808 -+
 138.809 -+  if (p->remainLen > kMatchSpecLenStart)
 138.810 -+  {
 138.811 -+    p->remainLen = kMatchSpecLenStart;
 138.812 -+  }
 138.813 -+  return 0;
 138.814 -+}
 138.815 -+
 138.816 -+typedef enum
 138.817 -+{
 138.818 -+  DUMMY_ERROR, /* unexpected end of input stream */
 138.819 -+  DUMMY_LIT,
 138.820 -+  DUMMY_MATCH,
 138.821 -+  DUMMY_REP
 138.822 -+} ELzmaDummy;
 138.823 -+
 138.824 -+static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
 138.825 -+{
 138.826 -+  UInt32 range = p->range;
 138.827 -+  UInt32 code = p->code;
 138.828 -+  const Byte *bufLimit = buf + inSize;
 138.829 -+  UIntLzmaProb *probs = p->probs;
 138.830 -+  unsigned state = p->state;
 138.831 -+  ELzmaDummy res;
 138.832 -+
 138.833 -+  {
 138.834 -+    UIntLzmaProb *prob;
 138.835 -+    UInt32 bound;
 138.836 -+    unsigned ttt;
 138.837 -+    unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);
 138.838 -+
 138.839 -+    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
 138.840 -+    IF_BIT_0_CHECK(prob)
 138.841 -+    {
 138.842 -+      UPDATE_0_CHECK
 138.843 -+
 138.844 -+      /* if (bufLimit - buf >= 7) return DUMMY_LIT; */
 138.845 -+
 138.846 -+      prob = probs + Literal;
 138.847 -+      if (p->checkDicSize != 0 || p->processedPos != 0)
 138.848 -+        prob += (LZMA_LIT_SIZE *
 138.849 -+          ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
 138.850 -+          (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
 138.851 -+
 138.852 -+      if (state < kNumLitStates)
 138.853 -+      {
 138.854 -+        unsigned symbol = 1;
 138.855 -+        do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
 138.856 -+      }
 138.857 -+      else
 138.858 -+      {
 138.859 -+        unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
 138.860 -+            ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];
 138.861 -+        unsigned offs = 0x100;
 138.862 -+        unsigned symbol = 1;
 138.863 -+        do
 138.864 -+        {
 138.865 -+          unsigned bit;
 138.866 -+          UIntLzmaProb *probLit;
 138.867 -+          matchByte <<= 1;
 138.868 -+          bit = (matchByte & offs);
 138.869 -+          probLit = prob + offs + bit + symbol;
 138.870 -+          GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)
 138.871 -+        }
 138.872 -+        while (symbol < 0x100);
 138.873 -+      }
 138.874 -+      res = DUMMY_LIT;
 138.875 -+    }
 138.876 -+    else
 138.877 -+    {
 138.878 -+      unsigned len;
 138.879 -+      UPDATE_1_CHECK;
 138.880 -+
 138.881 -+      prob = probs + IsRep + state;
 138.882 -+      IF_BIT_0_CHECK(prob)
 138.883 -+      {
 138.884 -+        UPDATE_0_CHECK;
 138.885 -+        state = 0;
 138.886 -+        prob = probs + LenCoder;
 138.887 -+        res = DUMMY_MATCH;
 138.888 -+      }
 138.889 -+      else
 138.890 -+      {
 138.891 -+        UPDATE_1_CHECK;
 138.892 -+        res = DUMMY_REP;
 138.893 -+        prob = probs + IsRepG0 + state;
 138.894 -+        IF_BIT_0_CHECK(prob)
 138.895 -+        {
 138.896 -+          UPDATE_0_CHECK;
 138.897 -+          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
 138.898 -+          IF_BIT_0_CHECK(prob)
 138.899 -+          {
 138.900 -+            UPDATE_0_CHECK;
 138.901 -+            NORMALIZE_CHECK;
 138.902 -+            return DUMMY_REP;
 138.903 -+          }
 138.904 -+          else
 138.905 -+          {
 138.906 -+            UPDATE_1_CHECK;
 138.907 -+          }
 138.908 -+        }
 138.909 -+        else
 138.910 -+        {
 138.911 -+          UPDATE_1_CHECK;
 138.912 -+          prob = probs + IsRepG1 + state;
 138.913 -+          IF_BIT_0_CHECK(prob)
 138.914 -+          {
 138.915 -+            UPDATE_0_CHECK;
 138.916 -+          }
 138.917 -+          else
 138.918 -+          {
 138.919 -+            UPDATE_1_CHECK;
 138.920 -+            prob = probs + IsRepG2 + state;
 138.921 -+            IF_BIT_0_CHECK(prob)
 138.922 -+            {
 138.923 -+              UPDATE_0_CHECK;
 138.924 -+            }
 138.925 -+            else
 138.926 -+            {
 138.927 -+              UPDATE_1_CHECK;
 138.928 -+            }
 138.929 -+          }
 138.930 -+        }
 138.931 -+        state = kNumStates;
 138.932 -+        prob = probs + RepLenCoder;
 138.933 -+      }
 138.934 -+      {
 138.935 -+        unsigned limit, offset;
 138.936 -+        UIntLzmaProb *probLen = prob + LenChoice;
 138.937 -+        IF_BIT_0_CHECK(probLen)
 138.938 -+        {
 138.939 -+          UPDATE_0_CHECK;
 138.940 -+          probLen = prob + LenLow + (posState << kLenNumLowBits);
 138.941 -+          offset = 0;
 138.942 -+          limit = 1 << kLenNumLowBits;
 138.943 -+        }
 138.944 -+        else
 138.945 -+        {
 138.946 -+          UPDATE_1_CHECK;
 138.947 -+          probLen = prob + LenChoice2;
 138.948 -+          IF_BIT_0_CHECK(probLen)
 138.949 -+          {
 138.950 -+            UPDATE_0_CHECK;
 138.951 -+            probLen = prob + LenMid + (posState << kLenNumMidBits);
 138.952 -+            offset = kLenNumLowSymbols;
 138.953 -+            limit = 1 << kLenNumMidBits;
 138.954 -+          }
 138.955 -+          else
 138.956 -+          {
 138.957 -+            UPDATE_1_CHECK;
 138.958 -+            probLen = prob + LenHigh;
 138.959 -+            offset = kLenNumLowSymbols + kLenNumMidSymbols;
 138.960 -+            limit = 1 << kLenNumHighBits;
 138.961 -+          }
 138.962 -+        }
 138.963 -+        TREE_DECODE_CHECK(probLen, limit, len);
 138.964 -+        len += offset;
 138.965 -+      }
 138.966 -+
 138.967 -+      if (state < 4)
 138.968 -+      {
 138.969 -+        unsigned posSlot;
 138.970 -+        prob = probs + PosSlot +
 138.971 -+            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
 138.972 -+            kNumPosSlotBits);
 138.973 -+        TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
 138.974 -+        if (posSlot >= kStartPosModelIndex)
 138.975 -+        {
 138.976 -+          int numDirectBits = ((posSlot >> 1) - 1);
 138.977 -+
 138.978 -+          /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
 138.979 -+
 138.980 -+          if (posSlot < kEndPosModelIndex)
 138.981 -+          {
 138.982 -+            prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;
 138.983 -+          }
 138.984 -+          else
 138.985 -+          {
 138.986 -+            numDirectBits -= kNumAlignBits;
 138.987 -+            do
 138.988 -+            {
 138.989 -+              NORMALIZE_CHECK
 138.990 -+              range >>= 1;
 138.991 -+              code -= range & (((code - range) >> 31) - 1);
 138.992 -+              /* if (code >= range) code -= range; */
 138.993 -+            }
 138.994 -+            while (--numDirectBits != 0);
 138.995 -+            prob = probs + Align;
 138.996 -+            numDirectBits = kNumAlignBits;
 138.997 -+          }
 138.998 -+          {
 138.999 -+            unsigned i = 1;
138.1000 -+            do
138.1001 -+            {
138.1002 -+              GET_BIT_CHECK(prob + i, i);
138.1003 -+            }
138.1004 -+            while (--numDirectBits != 0);
138.1005 -+          }
138.1006 -+        }
138.1007 -+      }
138.1008 -+    }
138.1009 -+  }
138.1010 -+  NORMALIZE_CHECK;
138.1011 -+  return res;
138.1012 -+}
138.1013 -+
138.1014 -+
138.1015 -+static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
138.1016 -+{
138.1017 -+  p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
138.1018 -+  p->range = 0xFFFFFFFF;
138.1019 -+  p->needFlush = 0;
138.1020 -+}
138.1021 -+
138.1022 -+void LzmaDec_Init(CLzmaDec *p)
138.1023 -+{
138.1024 -+  p->dicFilePos = 0;
138.1025 -+  p->dicPos = 0;
138.1026 -+  p->needFlush = 1;
138.1027 -+  p->remainLen = 0;
138.1028 -+  p->tempBufSize = 0;
138.1029 -+  p->processedPos = 0;
138.1030 -+  p->checkDicSize = 0;
138.1031 -+  p->needInitState = 1;
138.1032 -+  p->needInitState = 1;
138.1033 -+}
138.1034 -+
138.1035 -+static void LzmaDec_InitStateReal(CLzmaDec *p)
138.1036 -+{
138.1037 -+  UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));
138.1038 -+  UInt32 i;
138.1039 -+  UIntLzmaProb *probs = p->probs;
138.1040 -+  for (i = 0; i < numProbs; i++)
138.1041 -+    probs[i] = kBitModelTotal >> 1;
138.1042 -+  p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
138.1043 -+  p->state = 0;
138.1044 -+  p->needInitState = 0;
138.1045 -+}
138.1046 -+
138.1047 -+SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
138.1048 -+    ELzmaFinishMode finishMode, ELzmaStatus *status)
138.1049 -+{
138.1050 -+  SizeT inSize = *srcLen;
138.1051 -+  (*srcLen) = 0;
138.1052 -+  LzmaDec_WriteRem(p, dicLimit);
138.1053 -+  
138.1054 -+  *status = LZMA_STATUS_NOT_SPECIFIED;
138.1055 -+
138.1056 -+  while (p->remainLen != kMatchSpecLenStart)
138.1057 -+  {
138.1058 -+      int checkEndMarkNow;
138.1059 -+
138.1060 -+      if (p->needFlush != 0)
138.1061 -+      {
138.1062 -+        for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
138.1063 -+          p->tempBuf[p->tempBufSize++] = *src++;
138.1064 -+        if (p->tempBufSize < RC_INIT_SIZE)
138.1065 -+        {
138.1066 -+          *status = LZMA_STATUS_NEEDS_MORE_INPUT;
138.1067 -+          return SZ_OK;
138.1068 -+        }
138.1069 -+        if (p->tempBuf[0] != 0)
138.1070 -+          return SZ_ERROR_DATA;
138.1071 -+
138.1072 -+        LzmaDec_InitRc(p, p->tempBuf);
138.1073 -+        p->tempBufSize = 0;
138.1074 -+      }
138.1075 -+
138.1076 -+      checkEndMarkNow = 0;
138.1077 -+      if (p->dicPos >= dicLimit)
138.1078 -+      {
138.1079 -+        if (p->remainLen == 0 && p->code == 0)
138.1080 -+        {
138.1081 -+          *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
138.1082 -+          return SZ_OK;
138.1083 -+        }
138.1084 -+        if (finishMode == LZMA_FINISH_ANY)
138.1085 -+        {
138.1086 -+          *status = LZMA_STATUS_NOT_FINISHED;
138.1087 -+          return SZ_OK;
138.1088 -+        }
138.1089 -+        if (p->remainLen != 0)
138.1090 -+        {
138.1091 -+          *status = LZMA_STATUS_NOT_FINISHED;
138.1092 -+          return SZ_ERROR_DATA;
138.1093 -+        }
138.1094 -+        checkEndMarkNow = 1;
138.1095 -+      }
138.1096 -+
138.1097 -+      if (p->needInitState)
138.1098 -+        LzmaDec_InitStateReal(p);
138.1099 -+  
138.1100 -+      if (p->tempBufSize == 0)
138.1101 -+      {
138.1102 -+        SizeT processed;
138.1103 -+        const Byte *bufLimit;
138.1104 -+        if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
138.1105 -+        {
138.1106 -+          int dummyRes = LzmaDec_TryDummy(p, src, inSize);
138.1107 -+          if (dummyRes == DUMMY_ERROR)
138.1108 -+          {
138.1109 -+            memcpy(p->tempBuf, src, inSize);
138.1110 -+            p->tempBufSize = (unsigned)inSize;
138.1111 -+            (*srcLen) += inSize;
138.1112 -+            *status = LZMA_STATUS_NEEDS_MORE_INPUT;
138.1113 -+            return SZ_OK;
138.1114 -+          }
138.1115 -+          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
138.1116 -+          {
138.1117 -+            *status = LZMA_STATUS_NOT_FINISHED;
138.1118 -+            return SZ_ERROR_DATA;
138.1119 -+          }
138.1120 -+          bufLimit = src;
138.1121 -+        }
138.1122 -+        else
138.1123 -+          bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
138.1124 -+        p->buf = src;
138.1125 -+        if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
138.1126 -+          return SZ_ERROR_DATA;
138.1127 -+        processed = (SizeT)(p->buf - src);
138.1128 -+        (*srcLen) += processed;
138.1129 -+        src += processed;
138.1130 -+        inSize -= processed;
138.1131 -+      }
138.1132 -+      else
138.1133 -+      {
138.1134 -+        unsigned rem = p->tempBufSize, lookAhead = 0;
138.1135 -+        while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
138.1136 -+          p->tempBuf[rem++] = src[lookAhead++];
138.1137 -+        p->tempBufSize = rem;
138.1138 -+        if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
138.1139 -+        {
138.1140 -+          int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);
138.1141 -+          if (dummyRes == DUMMY_ERROR)
138.1142 -+          {
138.1143 -+            (*srcLen) += lookAhead;
138.1144 -+            *status = LZMA_STATUS_NEEDS_MORE_INPUT;
138.1145 -+            return SZ_OK;
138.1146 -+          }
138.1147 -+          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
138.1148 -+          {
138.1149 -+            *status = LZMA_STATUS_NOT_FINISHED;
138.1150 -+            return SZ_ERROR_DATA;
138.1151 -+          }
138.1152 -+        }
138.1153 -+        p->buf = p->tempBuf;
138.1154 -+        if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
138.1155 -+          return SZ_ERROR_DATA;
138.1156 -+        lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));
138.1157 -+        (*srcLen) += lookAhead;
138.1158 -+        src += lookAhead;
138.1159 -+        inSize -= lookAhead;
138.1160 -+        p->tempBufSize = 0;
138.1161 -+      }
138.1162 -+  }
138.1163 -+  if (p->code == 0)
138.1164 -+    *status = LZMA_STATUS_FINISHED_WITH_MARK;
138.1165 -+  return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;
138.1166 -+}
138.1167 -+
138.1168 -+/* -------------------------------------------------------------------------- */
138.1169 -+
138.1170 -+#define ReadUnalignedUInt32(p) ((UInt32)((Byte*)(p))[0] | ((UInt32)((Byte*)(p))[1]<<8) | ((UInt32)((Byte*)(p))[2]<<16) | ((UInt32)((Byte*)(p))[3]<<24))
138.1171 -+#define ReadUnalignedUInt64(p) (ReadUnalignedUInt32(p) | ((UInt64)ReadUnalignedUInt32((Byte*)(p)+4)<<32))
138.1172 -+
138.1173 -+CLzmaDec lzmadec;
138.1174 -+
138.1175 -+static unsigned long malloc_top = 0;
138.1176 -+static void *grub_malloc(unsigned long size)
138.1177 -+{
138.1178 -+       if (!malloc_top)
138.1179 -+               malloc_top = RAW_ADDR ((saved_mem_upper << 10) + 0x100000);
138.1180 -+       malloc_top = (malloc_top - size) & ~3;
138.1181 -+       return (void *) malloc_top;
138.1182 -+}
138.1183 -+#define grub_free(x)
138.1184 -+
138.1185 -+int
138.1186 -+dec_lzma_open (void)
138.1187 -+// return 1=success or 0=failure
138.1188 -+{
138.1189 -+    unsigned char header[13];
138.1190 -+    unsigned char d;
138.1191 -+
138.1192 -+    if (no_decompression) return 0;
138.1193 -+
138.1194 -+    // Now it does not support openning more than 1 file at a time. 
138.1195 -+    // Make sure previously allocated memory blocks is freed. 
138.1196 -+    // Don't need this line if grub_close is called for every openned file before grub_open is called for next file.
138.1197 -+    dec_lzma_close();
138.1198 -+
138.1199 -+    filepos = 0;
138.1200 -+    if (grub_read ((char *)header, 13, 0xedde0d90) == 13) 
138.1201 -+    {
138.1202 -+	// check header
138.1203 -+	lzmadec.prop.dicSize = ReadUnalignedUInt32(header+1);
138.1204 -+	if (lzmadec.prop.dicSize < LZMA_DIC_MIN)
138.1205 -+	    lzmadec.prop.dicSize = LZMA_DIC_MIN;
138.1206 -+	d = header[0];
138.1207 -+	if (d < 9*5*5)
138.1208 -+	{
138.1209 -+	    // valid LZMA file
138.1210 -+	    lzmadec.prop.lc = d % 9; d /= 9;
138.1211 -+	    lzmadec.prop.lp = d % 5;
138.1212 -+	    lzmadec.prop.pb = d / 5;
138.1213 -+	    lzmadec.fileu.fmax = ReadUnalignedUInt64(header+5);
138.1214 -+	    lzmadec.fileu.fpos = 0;
138.1215 -+	    lzmadec.dicBufSize = lzmadec.prop.dicSize;
138.1216 -+	    lzmadec.dic = (Byte*) grub_malloc(lzmadec.dicBufSize);
138.1217 -+	    //grub_printf("LZMA allocate memory\n");
138.1218 -+	    if (lzmadec.dic)
138.1219 -+	    {
138.1220 -+		lzmadec.numProbs = LzmaProps_GetNumProbs(&lzmadec.prop);
138.1221 -+		lzmadec.probs = (UIntLzmaProb *) grub_malloc(lzmadec.numProbs * sizeof(UIntLzmaProb));
138.1222 -+		if (lzmadec.probs)
138.1223 -+		{
138.1224 -+		    lzmadec.inpBufSize = 0x8000;
138.1225 -+		    lzmadec.inp = (Byte*) grub_malloc(lzmadec.inpBufSize);
138.1226 -+		    if (lzmadec.inp)
138.1227 -+		    {
138.1228 -+			lzmadec.inpFilePos = 0;
138.1229 -+			lzmadec.inpPos = 0;
138.1230 -+			lzmadec.inpSize = 0;
138.1231 -+			LzmaDec_Init(&lzmadec);
138.1232 -+			decomp_type = 1;
138.1233 -+			compressed_file = 1;
138.1234 -+			lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax;
138.1235 -+			lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos;
138.1236 -+			// success
138.1237 -+			//grub_printf("LZMA open success\n");
138.1238 -+			errnum = 0;
138.1239 -+			return 1;
138.1240 -+		    }
138.1241 -+		    else
138.1242 -+		    {
138.1243 -+			errnum = ERR_NOT_ENOUGH_MEMORY;
138.1244 -+		    }
138.1245 -+		    grub_free(lzmadec.probs); lzmadec.probs = 0;
138.1246 -+		}
138.1247 -+		else
138.1248 -+		{
138.1249 -+		    errnum = ERR_NOT_ENOUGH_MEMORY;
138.1250 -+		}
138.1251 -+		grub_free(lzmadec.dic); lzmadec.dic = 0;
138.1252 -+	    }
138.1253 -+	    else
138.1254 -+	    {
138.1255 -+		errnum = ERR_NOT_ENOUGH_MEMORY;
138.1256 -+	    }
138.1257 -+	}
138.1258 -+	else
138.1259 -+	{
138.1260 -+	    //grub_printf("LZMA allocate memory\n");
138.1261 -+	    errnum = ERR_BAD_GZIP_HEADER;
138.1262 -+	}
138.1263 -+    }
138.1264 -+    else
138.1265 -+    {
138.1266 -+	//grub_printf("LZMA error reading header\n");
138.1267 -+	errnum = ERR_BAD_GZIP_HEADER;
138.1268 -+    }
138.1269 -+    //grub_printf("LZMA open fail\n");
138.1270 -+    filepos = 0;
138.1271 -+    return 0;
138.1272 -+}
138.1273 -+
138.1274 -+void
138.1275 -+dec_lzma_close (void)
138.1276 -+{
138.1277 -+    if (lzmadec.inp  ) { grub_free(lzmadec.inp  ); lzmadec.inp   = 0; }
138.1278 -+    if (lzmadec.dic  ) { grub_free(lzmadec.dic  ); lzmadec.dic   = 0; }
138.1279 -+    if (lzmadec.probs) { grub_free(lzmadec.probs); lzmadec.probs = 0; }
138.1280 -+}
138.1281 -+
138.1282 -+unsigned long
138.1283 -+dec_lzma_read (char *buf, unsigned long len, unsigned long write)
138.1284 -+{
138.1285 -+    UInt64 outTx, outSkip;
138.1286 -+    //grub_printf("LZMA read buf=%ld len=%ld dic=%d inp=%d\n",buf,len,lzmadec.dic,lzmadec.inp);
138.1287 -+
138.1288 -+    compressed_file = 0;
138.1289 -+    lzmadec.fileu.fmax = filemax; filemax = lzmadec.filec.fmax;
138.1290 -+    lzmadec.fileu.fpos = filepos; filepos = lzmadec.filec.fpos;
138.1291 -+    /* Now filepos, filemax is of compressed file 
138.1292 -+     * fileu.fpos, fileu.fmax is of uncompressed data
138.1293 -+     * filec is not used
138.1294 -+     */
138.1295 -+
138.1296 -+    /*
138.1297 -+     * When dicPos>0,
138.1298 -+     *   dic[0 ... dicPos-1] contains 
138.1299 -+     *   uncompressed_data [dicFilePos ... dicFilePos+dicPos-1].
138.1300 -+     * When dicFilePos>0,
138.1301 -+     *   dic[dicPos ... dicBufSize-1] contains 
138.1302 -+     *   uncompressed_data [dicFilePos-dicBufSize+dicFilePos ... dicFilePos-1]
138.1303 -+     */
138.1304 -+    /* do we reset decompression to the beginning of the file? */
138.1305 -+    if (lzmadec.dicFilePos && (lzmadec.fileu.fpos < lzmadec.dicFilePos-lzmadec.dicBufSize+lzmadec.dicFilePos))
138.1306 -+    {
138.1307 -+	LzmaDec_Init(&lzmadec);
138.1308 -+	filepos = 13;
138.1309 -+	lzmadec.inpPos = lzmadec.inpSize = 0;
138.1310 -+    }
138.1311 -+
138.1312 -+    outTx = 0;
138.1313 -+    outSkip = lzmadec.fileu.fpos - lzmadec.dicFilePos;
138.1314 -+    //grub_printf("fileu.fpos=%ld dicFilePos=%ld\n",lzmadec.fileu.fpos,lzmadec.dicFilePos);
138.1315 -+
138.1316 -+    /* Copy uncompressed data from upper part of dic. dic[dicPos]...dic[dicBufSize-1] */
138.1317 -+    if (lzmadec.dicFilePos > lzmadec.fileu.fpos)
138.1318 -+    {
138.1319 -+	UInt32 outTxCur = lzmadec.dicFilePos - lzmadec.fileu.fpos;
138.1320 -+	if (outTxCur > len) outTxCur = len;
138.1321 -+	if (buf)
138.1322 -+	{
138.1323 -+	    grub_memmove(buf, lzmadec.dic+outSkip+lzmadec.dicBufSize, outTxCur); 
138.1324 -+	    buf += outTxCur; 
138.1325 -+	}
138.1326 -+	outSkip = 0;
138.1327 -+	outTx += outTxCur; 
138.1328 -+	lzmadec.fileu.fpos += outTxCur; 
138.1329 -+	len -= outTxCur; 
138.1330 -+    }
138.1331 -+
138.1332 -+    while (len!=0)
138.1333 -+    {
138.1334 -+	SizeT inSizeCur, dicLimit;
138.1335 -+	UInt32 dicPos;
138.1336 -+	ELzmaStatus status;
138.1337 -+	SRes res;
138.1338 -+
138.1339 -+	/* Copy uncompressed data from lower part of dic. dic[0]...dic[dicPos-1] */
138.1340 -+	//grub_printf("Loop len=%ld outSkip=%ld dicPos=%d\n",len,outSkip,lzmadec.dicPos);
138.1341 -+	if (outSkip < lzmadec.dicPos)
138.1342 -+	{
138.1343 -+	    UInt32 outTxCur = lzmadec.dicPos - outSkip; 
138.1344 -+	    //grub_printf("Copy %d byte ",outTxCur);
138.1345 -+	    if (buf)
138.1346 -+	    {
138.1347 -+		grub_memmove(buf, lzmadec.dic+outSkip, outTxCur); 
138.1348 -+		buf += outTxCur; 
138.1349 -+	    }
138.1350 -+	    outSkip = lzmadec.dicPos;
138.1351 -+	    outTx += outTxCur; 
138.1352 -+	    lzmadec.fileu.fpos += outTxCur; 
138.1353 -+	    len -= outTxCur; 
138.1354 -+	    //grub_printf(" remaining len=%ld\n",len);
138.1355 -+	    if (len==0) break;
138.1356 -+	}
138.1357 -+	/* All existing wanted data from dic have been copied. We will add more data to dic. */
138.1358 -+	/* Read more input if there is no unprocessed input left. */
138.1359 -+	if (lzmadec.inpPos == lzmadec.inpSize)
138.1360 -+	{
138.1361 -+	    UInt32 inTxCur = (filemax-filepos<lzmadec.inpBufSize)?filemax-filepos:lzmadec.inpBufSize;
138.1362 -+	    lzmadec.inpFilePos = filepos;
138.1363 -+	    lzmadec.inpPos = 0;
138.1364 -+	    //grub_printf("read inp %d ",inTxCur);
138.1365 -+	    lzmadec.inpSize = grub_read(lzmadec.inp, inTxCur, 0xedde0d90);
138.1366 -+	    //grub_printf("->%d\n",lzmadec.inpSize);
138.1367 -+	}
138.1368 -+	inSizeCur = lzmadec.inpSize - lzmadec.inpPos;
138.1369 -+
138.1370 -+	/* Prepare output dicPos, dicLimit. */
138.1371 -+	if (lzmadec.dicPos == lzmadec.dicBufSize)
138.1372 -+	{
138.1373 -+	    lzmadec.dicPos = 0;
138.1374 -+	    outSkip -= lzmadec.dicBufSize;
138.1375 -+	}
138.1376 -+	dicPos = lzmadec.dicPos;
138.1377 -+	dicLimit = (lzmadec.dicBufSize-dicPos < len)? lzmadec.dicBufSize: dicPos+len;
138.1378 -+
138.1379 -+	/* Do decompression. */
138.1380 -+	//grub_printf("DecodeToDic dicPos=%d limit=%d inPos=%d inSize=%d ",dicPos,dicLimit,lzmadec.inpPos,inSizeCur);
138.1381 -+	status = LZMA_STATUS_NOT_SPECIFIED;
138.1382 -+	res = LzmaDec_DecodeToDic(&lzmadec, dicLimit, lzmadec.inp+lzmadec.inpPos, &inSizeCur, LZMA_FINISH_ANY, &status);
138.1383 -+	//grub_printf("->%d\n",inSizeCur);
138.1384 -+	lzmadec.inpPos += inSizeCur;
138.1385 -+	if (inSizeCur==0 && lzmadec.dicPos==dicPos)
138.1386 -+	{
138.1387 -+	    /* Error */
138.1388 -+	    //grub_printf("No more input and output\n");
138.1389 -+	    break;
138.1390 -+	}
138.1391 -+    }
138.1392 -+    compressed_file = 1;
138.1393 -+    lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax;
138.1394 -+    lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos;
138.1395 -+    /* Now filepos, file max is of uncompressed data
138.1396 -+     * filec.fpos, filwc.fmax is of compressed file
138.1397 -+     * fileu is not used
138.1398 -+     */
138.1399 -+
138.1400 -+    //grub_printf("LZMA read end %ld\n",outTx);
138.1401 -+    return outTx;
138.1402 -+}
138.1403 -+
138.1404 -+#endif /* ! NO_DECOMPRESSION */
138.1405 -diff -Naur ../grub4dos-chenall-r63/stage2/decomp.h ./stage2/decomp.h
138.1406 ---- grub4dos-chenall-r63/stage2/decomp.h	1970-01-01 07:00:00.000000000 +0700
138.1407 -+++ grub4dos/stage2/decomp.h	2010-11-28 13:51:54.687217000 +0700
138.1408 -@@ -0,0 +1,36 @@
138.1409 -+/* decomp.h - abstract decompression interface */
138.1410 -+/*
138.1411 -+ *  GRUB  --  GRand Unified Bootloader
138.1412 -+ *  Copyright (C) 1999,2000,2001,2004  Free Software Foundation, Inc.
138.1413 -+ *
138.1414 -+ *  This program is free software; you can redistribute it and/or modify
138.1415 -+ *  it under the terms of the GNU General Public License as published by
138.1416 -+ *  the Free Software Foundation; either version 2 of the License, or
138.1417 -+ *  (at your option) any later version.
138.1418 -+ *
138.1419 -+ *  This program is distributed in the hope that it will be useful,
138.1420 -+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
138.1421 -+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
138.1422 -+ *  GNU General Public License for more details.
138.1423 -+ *
138.1424 -+ *  You should have received a copy of the GNU General Public License
138.1425 -+ *  along with this program; if not, write to the Free Software
138.1426 -+ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
138.1427 -+ */
138.1428 -+
138.1429 -+#ifndef ASM_FILE
138.1430 -+
138.1431 -+struct decomp_entry
138.1432 -+{
138.1433 -+  char *name;
138.1434 -+  int (*open_func) (void);
138.1435 -+  void (*close_func) (void);
138.1436 -+  unsigned long (*read_func) (char *buf, unsigned long len, unsigned long write);
138.1437 -+};
138.1438 -+
138.1439 -+#define NUM_DECOM 2
138.1440 -+
138.1441 -+extern struct decomp_entry decomp_table[NUM_DECOM];
138.1442 -+extern int decomp_type;
138.1443 -+
138.1444 -+#endif
138.1445 -\ No newline at end of file
138.1446 -diff -Naur ../grub4dos-chenall-r63/stage2/disk_io.c ./stage2/disk_io.c
138.1447 ---- grub4dos-chenall-r63/stage2/disk_io.c	2010-08-12 14:22:47.111207000 +0700
138.1448 -+++ grub4dos/stage2/disk_io.c	2010-11-28 20:26:39.089887300 +0700
138.1449 -@@ -21,6 +21,7 @@
138.1450 - 
138.1451 - #include <shared.h>
138.1452 - #include <filesys.h>
138.1453 -+#include <decomp.h>
138.1454 - #include <iso9660.h>
138.1455 - 
138.1456 - #ifdef SUPPORT_NETBOOT
138.1457 -@@ -1872,7 +1873,16 @@
138.1458 - #ifdef NO_DECOMPRESSION
138.1459 -       return 1;
138.1460 - #else
138.1461 --      return gunzip_test_header ();
138.1462 -+      if (no_decompression)
138.1463 -+	return 1;
138.1464 -+      int i;
138.1465 -+      i = strlen(open_filename);
138.1466 -+      if (i>=5 && strcmp(open_filename+i-5,".lzma")==0)
138.1467 -+        dec_lzma_open ();
138.1468 -+      else
138.1469 -+        gunzip_test_header ();
138.1470 -+      errnum = 0;
138.1471 -+      return 1;
138.1472 - #endif
138.1473 -     }
138.1474 - 
138.1475 -@@ -1903,7 +1903,7 @@
138.1476 -   {
138.1477 -     if (write == 0x900ddeed)
138.1478 - 	return !(errnum = ERR_WRITE_GZIP_FILE);
138.1479 --    return gunzip_read (buf, len);
138.1480 -+    return decomp_table[decomp_type].read_func (buf, len, write);
138.1481 -   }
138.1482 - #endif /* NO_DECOMPRESSION */
138.1483 - 
138.1484 -@@ -1978,6 +1982,12 @@
138.1485 - void
138.1486 - grub_close (void)
138.1487 - {
138.1488 -+#ifndef NO_DECOMPRESSION
138.1489 -+  if (compressed_file)
138.1490 -+      decomp_table[decomp_type].close_func ();
138.1491 -+  compressed_file = 0;
138.1492 -+#endif /* NO_DECOMPRESSION */
138.1493 -+
138.1494 - #ifndef NO_BLOCK_FILES
138.1495 -   if (block_file)
138.1496 -     return;
138.1497 -diff -Naur ../grub4dos-chenall-r63/stage2/gunzip.c ./stage2/gunzip.c
138.1498 ---- grub4dos-chenall-r63/stage2/gunzip.c	2010-07-26 19:35:48.440546000 +0700
138.1499 -+++ grub4dos/stage2/gunzip.c	2010-11-28 14:20:56.983870700 +0700
138.1500 -@@ -129,6 +129,8 @@
138.1501 - 
138.1502 - #include "filesys.h"
138.1503 - 
138.1504 -+#include "decomp.h"
138.1505 -+
138.1506 - /* so we can disable decompression  */
138.1507 - #ifdef GRUB_UTIL
138.1508 - int no_decompression = 0;
138.1509 -@@ -137,6 +139,15 @@
138.1510 - /* used to tell if "read" should be redirected to "gunzip_read" */
138.1511 - int compressed_file;
138.1512 - 
138.1513 -+/* identify active decompressor */
138.1514 -+int decomp_type;
138.1515 -+
138.1516 -+struct decomp_entry decomp_table[NUM_DECOM] =
138.1517 -+{
138.1518 -+	{"gz",gunzip_test_header,gunzip_close,gunzip_read},
138.1519 -+	{"lzma",dec_lzma_open,dec_lzma_close,dec_lzma_read}
138.1520 -+};
138.1521 -+
138.1522 - /* internal variables only */
138.1523 - static unsigned long long gzip_data_offset;
138.1524 - static unsigned long long gzip_filepos;
138.1525 -@@ -227,6 +238,7 @@
138.1526 - /* Little-Endian defines for the 2-byte magic number for gzip files */
138.1527 - #define GZIP_HDR_LE      0x8B1F
138.1528 - #define OLD_GZIP_HDR_LE  0x9E1F
138.1529 -+#define LZMA_HDR_LE      0x005D
138.1530 - 
138.1531 - /* Compression methods (see algorithm.doc) */
138.1532 - #define STORED      0
138.1533 -@@ -281,10 +292,18 @@
138.1534 -   if (no_decompression
138.1535 -       || grub_read ((char *)buf, 10, 0xedde0d90) != 10
138.1536 -       || ((*((unsigned short *) buf) != GZIP_HDR_LE)
138.1537 --	  && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE)))
138.1538 -+	  && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE)
138.1539 -+	  && (*((unsigned short *) buf) != LZMA_HDR_LE)))
138.1540 -     {
138.1541 -       filepos = 0;
138.1542 -       return ! errnum;
138.1543 -+    }
138.1544 -+
138.1545 -+  if (*((unsigned short *) buf) == LZMA_HDR_LE)
138.1546 -+    {
138.1547 -+      filepos = 0;
138.1548 -+      dec_lzma_open();
138.1549 -+      return 1;
138.1550 -     }
138.1551 - 
138.1552 -   /*
138.1553 -@@ -323,6 +334,7 @@
138.1554 - 
138.1555 -   initialize_tables ();
138.1556 - 
138.1557 -+  decomp_type = 0;
138.1558 -   compressed_file = 1;
138.1559 -   gunzip_swap_values ();
138.1560 -   /*
138.1561 -@@ -334,6 +346,11 @@
138.1562 -   return 1;
138.1563 - }
138.1564 - 
138.1565 -+void 
138.1566 -+gunzip_close (void)
138.1567 -+{
138.1568 -+}
138.1569 -+
138.1570 - 
138.1571 - /* Huffman code lookup table entry--this entry is four bytes for machines
138.1572 -    that have 16-bit pointers (e.g. PC's in the small or medium model).
138.1573 -@@ -1190,7 +1226,7 @@
138.1574 - 
138.1575 - 
138.1576 - unsigned long
138.1577 --gunzip_read (char *buf, unsigned long len)
138.1578 -+gunzip_read (char *buf, unsigned long len, unsigned long write)
138.1579 - {
138.1580 -   unsigned long ret = 0;
138.1581 - 
138.1582 -diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.am ./stage2/Makefile.am
138.1583 ---- grub4dos-chenall-r63/stage2/Makefile.am	2010-08-12 14:22:47.111207000 +0700
138.1584 -+++ grub4dos/stage2/Makefile.am	2010-11-28 16:35:18.724975900 +0700
138.1585 -@@ -16,6 +16,7 @@
138.1586 - # The library for /sbin/grub.
138.1587 - noinst_LIBRARIES = libgrub.a
138.1588 - libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
138.1589 -+	dec_lzma.c \
138.1590 - 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \
138.1591 - 	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
138.1592 - 	fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \
138.1593 -@@ -100,7 +101,7 @@
138.1594 - 
138.1595 - # For stage2 target.
138.1596 - pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
138.1597 --	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
138.1598 -+	cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \
138.1599 - 	fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
138.1600 - 	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \
138.1601 - 	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c
138.1602 -diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.in ./stage2/Makefile.in
138.1603 ---- grub4dos-chenall-r63/stage2/Makefile.in	2010-08-12 14:22:47.111207000 +0700
138.1604 -+++ grub4dos/stage2/Makefile.in	2010-11-28 16:38:22.871508400 +0700
138.1605 -@@ -104,10 +104,11 @@
138.1606 - am_libgrub_a_OBJECTS = libgrub_a-boot.$(OBJEXT) \
138.1607 - 	libgrub_a-builtins.$(OBJEXT) libgrub_a-char_io.$(OBJEXT) \
138.1608 - 	libgrub_a-cmdline.$(OBJEXT) libgrub_a-common.$(OBJEXT) \
138.1609 --	libgrub_a-disk_io.$(OBJEXT) libgrub_a-fsys_ext2fs.$(OBJEXT) \
138.1610 --	libgrub_a-fsys_fat.$(OBJEXT) libgrub_a-fsys_ntfs.$(OBJEXT) \
138.1611 --	libgrub_a-fsys_ffs.$(OBJEXT) libgrub_a-fsys_iso9660.$(OBJEXT) \
138.1612 --	libgrub_a-fsys_jfs.$(OBJEXT) libgrub_a-fsys_minix.$(OBJEXT) \
138.1613 -+	libgrub_a-dec_lzma.$(OBJEXT) libgrub_a-disk_io.$(OBJEXT) \
138.1614 -+	libgrub_a-fsys_ext2fs.$(OBJEXT) libgrub_a-fsys_fat.$(OBJEXT) \
138.1615 -+	libgrub_a-fsys_ntfs.$(OBJEXT) libgrub_a-fsys_ffs.$(OBJEXT) \
138.1616 -+	libgrub_a-fsys_iso9660.$(OBJEXT) libgrub_a-fsys_jfs.$(OBJEXT) \
138.1617 -+	libgrub_a-fsys_minix.$(OBJEXT) \
138.1618 - 	libgrub_a-fsys_reiserfs.$(OBJEXT) \
138.1619 - 	libgrub_a-fsys_ufs2.$(OBJEXT) libgrub_a-fsys_vstafs.$(OBJEXT) \
138.1620 - 	libgrub_a-fsys_xfs.$(OBJEXT) libgrub_a-fsys_pxe.$(OBJEXT) \
138.1621 -@@ -131,6 +132,7 @@
138.1622 - 	diskless_exec-char_io.$(OBJEXT) \
138.1623 - 	diskless_exec-cmdline.$(OBJEXT) diskless_exec-common.$(OBJEXT) \
138.1624 - 	diskless_exec-console.$(OBJEXT) \
138.1625 -+	diskless_exec-dec_lzma.$(OBJEXT) \
138.1626 - 	diskless_exec-disk_io.$(OBJEXT) \
138.1627 - 	diskless_exec-fsys_ext2fs.$(OBJEXT) \
138.1628 - 	diskless_exec-fsys_fat.$(OBJEXT) \
138.1629 -@@ -247,6 +249,7 @@
138.1630 - 	pre_stage2_exec-cmdline.$(OBJEXT) \
138.1631 - 	pre_stage2_exec-common.$(OBJEXT) \
138.1632 - 	pre_stage2_exec-console.$(OBJEXT) \
138.1633 -+	pre_stage2_exec-dec_lzma.$(OBJEXT) \
138.1634 - 	pre_stage2_exec-disk_io.$(OBJEXT) \
138.1635 - 	pre_stage2_exec-fsys_ext2fs.$(OBJEXT) \
138.1636 - 	pre_stage2_exec-fsys_fat.$(OBJEXT) \
138.1637 -@@ -512,6 +513,7 @@
138.1638 - # The library for /sbin/grub.
138.1639 - noinst_LIBRARIES = libgrub.a
138.1640 - libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
138.1641 -+	dec_lzma.c \
138.1642 - 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \
138.1643 - 	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
138.1644 - 	fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \
138.1645 -@@ -559,7 +563,7 @@
138.1646 - 
138.1647 - # For stage2 target.
138.1648 - pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
138.1649 --	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
138.1650 -+	cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \
138.1651 - 	fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
138.1652 - 	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \
138.1653 - 	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c
138.1654 -@@ -878,6 +882,7 @@
138.1655 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-cmdline.Po@am__quote@
138.1656 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-common.Po@am__quote@
138.1657 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-console.Po@am__quote@
138.1658 -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-dec_lzma.Po@am__quote@
138.1659 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-disk_io.Po@am__quote@
138.1660 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_ext2fs.Po@am__quote@
138.1661 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_fat.Po@am__quote@
138.1662 -@@ -935,6 +940,7 @@
138.1663 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-char_io.Po@am__quote@
138.1664 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-cmdline.Po@am__quote@
138.1665 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-common.Po@am__quote@
138.1666 -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-dec_lzma.Po@am__quote@
138.1667 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-disk_io.Po@am__quote@
138.1668 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_ext2fs.Po@am__quote@
138.1669 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_fat.Po@am__quote@
138.1670 -@@ -974,6 +980,7 @@
138.1671 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-cmdline.Po@am__quote@
138.1672 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-common.Po@am__quote@
138.1673 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-console.Po@am__quote@
138.1674 -+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-dec_lzma.Po@am__quote@
138.1675 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-disk_io.Po@am__quote@
138.1676 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po@am__quote@
138.1677 - @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_fat.Po@am__quote@
138.1678 -@@ -1315,6 +1322,20 @@
138.1679 - @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1680 - @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
138.1681 - 
138.1682 -+libgrub_a-dec_lzma.o: dec_lzma.c
138.1683 -+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.o -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \
138.1684 -+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi
138.1685 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='libgrub_a-dec_lzma.o' libtool=no @AMDEPBACKSLASH@
138.1686 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1687 -+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c
138.1688 -+
138.1689 -+libgrub_a-dec_lzma.obj: dec_lzma.c
138.1690 -+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \
138.1691 -+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi
138.1692 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='libgrub_a-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@
138.1693 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1694 -+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`
138.1695 -+
138.1696 - libgrub_a-disk_io.o: disk_io.c
138.1697 - @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-disk_io.o -MD -MP -MF "$(DEPDIR)/libgrub_a-disk_io.Tpo" -c -o libgrub_a-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \
138.1698 - @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgrub_a-disk_io.Tpo" "$(DEPDIR)/libgrub_a-disk_io.Po"; else rm -f "$(DEPDIR)/libgrub_a-disk_io.Tpo"; exit 1; fi
138.1699 -@@ -1693,6 +1714,20 @@
138.1700 - @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1701 - @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi`
138.1702 - 
138.1703 -+diskless_exec-dec_lzma.o: dec_lzma.c
138.1704 -+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \
138.1705 -+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi
138.1706 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='diskless_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@
138.1707 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1708 -+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c
138.1709 -+
138.1710 -+diskless_exec-dec_lzma.obj: dec_lzma.c
138.1711 -+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \
138.1712 -+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi
138.1713 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='diskless_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@
138.1714 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1715 -+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`
138.1716 -+
138.1717 - diskless_exec-disk_io.o: disk_io.c
138.1718 - @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/diskless_exec-disk_io.Tpo" -c -o diskless_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \
138.1719 - @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/diskless_exec-disk_io.Tpo" "$(DEPDIR)/diskless_exec-disk_io.Po"; else rm -f "$(DEPDIR)/diskless_exec-disk_io.Tpo"; exit 1; fi
138.1720 -@@ -2687,6 +2722,20 @@
138.1721 - @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1722 - @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi`
138.1723 - 
138.1724 -+pre_stage2_exec-dec_lzma.o: dec_lzma.c
138.1725 -+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \
138.1726 -+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi
138.1727 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@
138.1728 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1729 -+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c
138.1730 -+
138.1731 -+pre_stage2_exec-dec_lzma.obj: dec_lzma.c
138.1732 -+@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \
138.1733 -+@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi
138.1734 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@
138.1735 -+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
138.1736 -+@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`
138.1737 -+
138.1738 - pre_stage2_exec-disk_io.o: disk_io.c
138.1739 - @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" -c -o pre_stage2_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \
138.1740 - @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" "$(DEPDIR)/pre_stage2_exec-disk_io.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo"; exit 1; fi
138.1741 -diff -Naur ../grub4dos-chenall-r63/stage2/shared.h ./stage2/shared.h
138.1742 ---- grub4dos-chenall-r63/stage2/shared.h	2010-11-17 15:33:51.826683000 +0700
138.1743 -+++ grub4dos/stage2/shared.h	2010-11-27 01:16:46.996893700 +0700
138.1744 -@@ -640,6 +640,7 @@
138.1745 -   ERR_WRITE_GZIP_FILE,
138.1746 -   ERR_FUNC_CALL,
138.1747 - //  ERR_WRITE_TO_NON_MEM_DRIVE,
138.1748 -+  ERR_NOT_ENOUGH_MEMORY,
138.1749 - 
138.1750 -   MAX_ERR_NUM
138.1751 - } grub_error_t;
138.1752 -@@ -1185,7 +1186,11 @@
138.1753 - #ifndef NO_DECOMPRESSION
138.1754 - /* Compression support. */
138.1755 - int gunzip_test_header (void);
138.1756 --unsigned long gunzip_read (char *buf, unsigned long len);
138.1757 -+void gunzip_close (void);
138.1758 -+unsigned long gunzip_read (char *buf, unsigned long len, unsigned long write);
138.1759 -+int dec_lzma_open (void);
138.1760 -+void dec_lzma_close (void);
138.1761 -+unsigned long dec_lzma_read (char *buf, unsigned long len, unsigned long write);
138.1762 - #endif /* NO_DECOMPRESSION */
138.1763 - 
138.1764 - int rawread (unsigned long drive, unsigned long sector, unsigned long byte_offset, unsigned long byte_len, char *buf, unsigned long write);
   139.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   139.2 +++ b/grub4dos/stuff/patches/dev_partition.diff	Thu May 10 21:12:00 2018 +0300
   139.3 @@ -0,0 +1,17 @@
   139.4 +Partition can be ${dev}$num or ${dev}p$num
   139.5 +--- grub-0.97/lib/device.c
   139.6 ++++ grub-0.97/lib/device.c
   139.7 +@@ -867,6 +867,13 @@
   139.8 +   fd = open (dev, O_RDWR);
   139.9 +   if (fd < 0)
  139.10 +     {
  139.11 ++      strcpy (dev, map[drive]);
  139.12 ++      sprintf (dev + strlen(dev), "p%d", ((partition >> 16) & 0xFF) + 1);
  139.13 ++      fd = open (dev, O_RDWR);
  139.14 ++    }
  139.15 ++  
  139.16 ++  if (fd < 0)
  139.17 ++    {
  139.18 +       errnum = ERR_NO_PART;
  139.19 +       return 0;
  139.20 +     }
   140.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   140.2 +++ b/grub4dos/stuff/patches/lzma.diff	Thu May 10 21:12:00 2018 +0300
   140.3 @@ -0,0 +1,1761 @@
   140.4 +From http://code.google.com/p/grub4dos-chenall/issues/detail?id=6
   140.5 +
   140.6 +diff -Naur ../grub4dos-chenall-r63/stage2/common.c ./stage2/common.c
   140.7 +--- grub4dos-chenall-r63/stage2/common.c	2010-11-19 12:41:03.196955000 +0700
   140.8 ++++ grub4dos/stage2/common.c	2010-11-23 21:28:26.509102100 +0700
   140.9 +@@ -143,6 +143,7 @@
  140.10 +   [ERR_WRITE_GZIP_FILE] = "Attempt to write a gzip file",
  140.11 +   [ERR_FUNC_CALL] = "Invalid function call",
  140.12 + //  [ERR_WRITE_TO_NON_MEM_DRIVE] = "Only RAM drives can be written when running in a script",
  140.13 ++  [ERR_NOT_ENOUGH_MEMORY] = "Not enough memory",
  140.14 + 
  140.15 + };
  140.16 + 
  140.17 +diff -Naur ../grub4dos-chenall-r63/stage2/dec_lzma.c ./stage2/dec_lzma.c
  140.18 +--- grub4dos-chenall-r63/stage2/dec_lzma.c	1970-01-01 07:00:00.000000000 +0700
  140.19 ++++ grub4dos/stage2/dec_lzma.c	2010-11-28 22:12:06.452791800 +0700
  140.20 +@@ -0,0 +1,1384 @@
  140.21 ++/*
  140.22 ++ *  GRUB4DOS  --  GRand Unified Bootloader
  140.23 ++ *  Copyright (C) 1999  Free Software Foundation, Inc.
  140.24 ++ *
  140.25 ++ *  This program is free software; you can redistribute it and/or modify
  140.26 ++ *  it under the terms of the GNU General Public License as published by
  140.27 ++ *  the Free Software Foundation; either version 2 of the License, or
  140.28 ++ *  (at your option) any later version.
  140.29 ++ *
  140.30 ++ *  This program is distributed in the hope that it will be useful,
  140.31 ++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
  140.32 ++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  140.33 ++ *  GNU General Public License for more details.
  140.34 ++ *
  140.35 ++ *  You should have received a copy of the GNU General Public License
  140.36 ++ *  along with this program; if not, write to the Free Software
  140.37 ++ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  140.38 ++ */
  140.39 ++
  140.40 ++/*
  140.41 ++ *  Most of this file is derives from LZMA SDK 9.12 beta 
  140.42 ++ *  files Types.h, LzmaDec.h, LzmaDec.c by Igor Pavlov
  140.43 ++ *  It has been modified for used in GRUB4DOS.
  140.44 ++ */
  140.45 ++
  140.46 ++#ifndef NO_DECOMPRESSION
  140.47 ++
  140.48 ++#include "shared.h"
  140.49 ++#include "decomp.h"
  140.50 ++
  140.51 ++/* Types.h -- Basic types
  140.52 ++2010-03-11 : Igor Pavlov : Public domain */
  140.53 ++
  140.54 ++#define SZ_OK 0
  140.55 ++
  140.56 ++#define SZ_ERROR_DATA 1
  140.57 ++#define SZ_ERROR_MEM 2
  140.58 ++#define SZ_ERROR_CRC 3
  140.59 ++#define SZ_ERROR_UNSUPPORTED 4
  140.60 ++#define SZ_ERROR_PARAM 5
  140.61 ++#define SZ_ERROR_INPUT_EOF 6
  140.62 ++#define SZ_ERROR_OUTPUT_EOF 7
  140.63 ++#define SZ_ERROR_READ 8
  140.64 ++#define SZ_ERROR_WRITE 9
  140.65 ++#define SZ_ERROR_PROGRESS 10
  140.66 ++#define SZ_ERROR_FAIL 11
  140.67 ++#define SZ_ERROR_THREAD 12
  140.68 ++
  140.69 ++#define SZ_ERROR_ARCHIVE 16
  140.70 ++#define SZ_ERROR_NO_ARCHIVE 17
  140.71 ++
  140.72 ++typedef int SRes;
  140.73 ++typedef int WRes;
  140.74 ++
  140.75 ++#ifndef RINOK
  140.76 ++#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; }
  140.77 ++#endif
  140.78 ++
  140.79 ++typedef unsigned char Byte;
  140.80 ++typedef short Int16;
  140.81 ++typedef unsigned short UInt16;
  140.82 ++
  140.83 ++typedef int Int32;
  140.84 ++typedef unsigned int UInt32;
  140.85 ++
  140.86 ++typedef long long int Int64;
  140.87 ++typedef unsigned long long int UInt64;
  140.88 ++
  140.89 ++typedef UInt32 SizeT;
  140.90 ++typedef int ptrdiff_t;
  140.91 ++
  140.92 ++typedef int Bool;
  140.93 ++#define True 1
  140.94 ++#define False 0
  140.95 ++
  140.96 ++#define MY_STD_CALL
  140.97 ++#define MY_CDECL
  140.98 ++#define MY_FAST_CALL
  140.99 ++
 140.100 ++typedef struct
 140.101 ++{
 140.102 ++  void *(*Alloc)(void *p, SizeT size);
 140.103 ++  void (*Free)(void *p, void *address); /* address can be 0 */
 140.104 ++} ISzAlloc;
 140.105 ++
 140.106 ++#define IAlloc_Alloc(p, size) (p)->Alloc((p), size)
 140.107 ++#define IAlloc_Free(p, a) (p)->Free((p), a)
 140.108 ++
 140.109 ++/* -------------------------------------------------------------------------- */
 140.110 ++
 140.111 ++/* LzmaDec.h -- LZMA Decoder
 140.112 ++2009-02-07 : Igor Pavlov : Public domain */
 140.113 ++
 140.114 ++/* #define _LZMA_PROB32 */
 140.115 ++/* _LZMA_PROB32 can increase the speed on some CPUs,
 140.116 ++   but memory usage for CLzmaDec::probs will be doubled in that case */
 140.117 ++
 140.118 ++#ifdef _LZMA_PROB32
 140.119 ++#define UIntLzmaProb UInt32
 140.120 ++#else
 140.121 ++#define UIntLzmaProb UInt16
 140.122 ++#endif
 140.123 ++
 140.124 ++
 140.125 ++/* ---------- LZMA Properties ---------- */
 140.126 ++
 140.127 ++#define LZMA_PROPS_SIZE 5
 140.128 ++
 140.129 ++typedef struct _CLzmaProps
 140.130 ++{
 140.131 ++  unsigned lc, lp, pb;
 140.132 ++  UInt32 dicSize;
 140.133 ++} CLzmaProps;
 140.134 ++
 140.135 ++/* LzmaProps_Decode - decodes properties
 140.136 ++Returns:
 140.137 ++  SZ_OK
 140.138 ++  SZ_ERROR_UNSUPPORTED - Unsupported properties
 140.139 ++*/
 140.140 ++
 140.141 ++SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size);
 140.142 ++
 140.143 ++
 140.144 ++/* ---------- LZMA Decoder state ---------- */
 140.145 ++
 140.146 ++/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case.
 140.147 ++   Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */
 140.148 ++
 140.149 ++#define LZMA_REQUIRED_INPUT_MAX 20
 140.150 ++
 140.151 ++typedef struct
 140.152 ++{
 140.153 ++  CLzmaProps prop;
 140.154 ++  UIntLzmaProb *probs;
 140.155 ++  const Byte *buf;
 140.156 ++  UInt32 range, code;
 140.157 ++  Byte   *dic; 
 140.158 ++  UInt32 dicPos;
 140.159 ++  UInt32 dicBufSize;
 140.160 ++  Byte   *inp;
 140.161 ++  UInt32 inpPos, inpSize;
 140.162 ++  UInt32 inpBufSize;
 140.163 ++  UInt32 processedPos;
 140.164 ++  UInt32 checkDicSize;
 140.165 ++  unsigned state;
 140.166 ++  UInt32 reps[4];
 140.167 ++  unsigned remainLen;
 140.168 ++  int needFlush;
 140.169 ++  int needInitState;
 140.170 ++  UInt32 numProbs;
 140.171 ++  unsigned tempBufSize;
 140.172 ++  Byte tempBuf[LZMA_REQUIRED_INPUT_MAX];
 140.173 ++  UInt64 inpFilePos;
 140.174 ++  UInt64 dicFilePos;
 140.175 ++  struct {
 140.176 ++      UInt64 fmax, fpos;
 140.177 ++  } filec, fileu;
 140.178 ++} CLzmaDec;
 140.179 ++
 140.180 ++#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; }
 140.181 ++
 140.182 ++void LzmaDec_Init(CLzmaDec *p);
 140.183 ++
 140.184 ++/* There are two types of LZMA streams:
 140.185 ++     0) Stream with end mark. That end mark adds about 6 bytes to compressed size.
 140.186 ++     1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */
 140.187 ++
 140.188 ++typedef enum
 140.189 ++{
 140.190 ++  LZMA_FINISH_ANY,   /* finish at any point */
 140.191 ++  LZMA_FINISH_END    /* block must be finished at the end */
 140.192 ++} ELzmaFinishMode;
 140.193 ++
 140.194 ++/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!!
 140.195 ++
 140.196 ++   You must use LZMA_FINISH_END, when you know that current output buffer
 140.197 ++   covers last bytes of block. In other cases you must use LZMA_FINISH_ANY.
 140.198 ++
 140.199 ++   If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK,
 140.200 ++   and output value of destLen will be less than output buffer size limit.
 140.201 ++   You can check status result also.
 140.202 ++
 140.203 ++   You can use multiple checks to test data integrity after full decompression:
 140.204 ++     1) Check Result and "status" variable.
 140.205 ++     2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize.
 140.206 ++     3) Check that output(srcLen) = compressedSize, if you know real compressedSize.
 140.207 ++        You must use correct finish mode in that case. */
 140.208 ++
 140.209 ++typedef enum
 140.210 ++{
 140.211 ++  LZMA_STATUS_NOT_SPECIFIED,               /* use main error code instead */
 140.212 ++  LZMA_STATUS_FINISHED_WITH_MARK,          /* stream was finished with end mark. */
 140.213 ++  LZMA_STATUS_NOT_FINISHED,                /* stream was not finished */
 140.214 ++  LZMA_STATUS_NEEDS_MORE_INPUT,            /* you must provide more input bytes */
 140.215 ++  LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK  /* there is probability that stream was finished without end mark */
 140.216 ++} ELzmaStatus;
 140.217 ++
 140.218 ++/* ELzmaStatus is used only as output value for function call */
 140.219 ++
 140.220 ++
 140.221 ++/* ---------- Interfaces ---------- */
 140.222 ++
 140.223 ++/* There are 3 levels of interfaces:
 140.224 ++     1) Dictionary Interface
 140.225 ++     2) Buffer Interface
 140.226 ++     3) One Call Interface
 140.227 ++   You can select any of these interfaces, but don't mix functions from different
 140.228 ++   groups for same object. */
 140.229 ++
 140.230 ++
 140.231 ++/* There are two variants to allocate state for Dictionary Interface:
 140.232 ++     1) LzmaDec_Allocate / LzmaDec_Free
 140.233 ++     2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs
 140.234 ++   You can use variant 2, if you set dictionary buffer manually.
 140.235 ++   For Buffer Interface you must always use variant 1.
 140.236 ++
 140.237 ++LzmaDec_Allocate* can return:
 140.238 ++  SZ_OK
 140.239 ++  SZ_ERROR_MEM         - Memory allocation error
 140.240 ++  SZ_ERROR_UNSUPPORTED - Unsupported properties
 140.241 ++*/
 140.242 ++   
 140.243 ++SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc);
 140.244 ++void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc);
 140.245 ++
 140.246 ++SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc);
 140.247 ++void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc);
 140.248 ++
 140.249 ++/* ---------- Dictionary Interface ---------- */
 140.250 ++
 140.251 ++/* You can use it, if you want to eliminate the overhead for data copying from
 140.252 ++   dictionary to some other external buffer.
 140.253 ++   You must work with CLzmaDec variables directly in this interface.
 140.254 ++
 140.255 ++   STEPS:
 140.256 ++     LzmaDec_Constr()
 140.257 ++     LzmaDec_Allocate()
 140.258 ++     for (each new stream)
 140.259 ++     {
 140.260 ++       LzmaDec_Init()
 140.261 ++       while (it needs more decompression)
 140.262 ++       {
 140.263 ++         LzmaDec_DecodeToDic()
 140.264 ++         use data from CLzmaDec::dic and update CLzmaDec::dicPos
 140.265 ++       }
 140.266 ++     }
 140.267 ++     LzmaDec_Free()
 140.268 ++*/
 140.269 ++
 140.270 ++/* LzmaDec_DecodeToDic
 140.271 ++   
 140.272 ++   The decoding to internal dictionary buffer (CLzmaDec::dic).
 140.273 ++   You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!!
 140.274 ++
 140.275 ++finishMode:
 140.276 ++  It has meaning only if the decoding reaches output limit (dicLimit).
 140.277 ++  LZMA_FINISH_ANY - Decode just dicLimit bytes.
 140.278 ++  LZMA_FINISH_END - Stream must be finished after dicLimit.
 140.279 ++
 140.280 ++Returns:
 140.281 ++  SZ_OK
 140.282 ++    status:
 140.283 ++      LZMA_STATUS_FINISHED_WITH_MARK
 140.284 ++      LZMA_STATUS_NOT_FINISHED
 140.285 ++      LZMA_STATUS_NEEDS_MORE_INPUT
 140.286 ++      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
 140.287 ++  SZ_ERROR_DATA - Data error
 140.288 ++*/
 140.289 ++
 140.290 ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit,
 140.291 ++    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
 140.292 ++
 140.293 ++
 140.294 ++/* ---------- Buffer Interface ---------- */
 140.295 ++
 140.296 ++/* It's zlib-like interface.
 140.297 ++   See LzmaDec_DecodeToDic description for information about STEPS and return results,
 140.298 ++   but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need
 140.299 ++   to work with CLzmaDec variables manually.
 140.300 ++
 140.301 ++finishMode:
 140.302 ++  It has meaning only if the decoding reaches output limit (*destLen).
 140.303 ++  LZMA_FINISH_ANY - Decode just destLen bytes.
 140.304 ++  LZMA_FINISH_END - Stream must be finished after (*destLen).
 140.305 ++*/
 140.306 ++
 140.307 ++SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen,
 140.308 ++    const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status);
 140.309 ++
 140.310 ++
 140.311 ++/* ---------- One Call Interface ---------- */
 140.312 ++
 140.313 ++/* LzmaDecode
 140.314 ++
 140.315 ++finishMode:
 140.316 ++  It has meaning only if the decoding reaches output limit (*destLen).
 140.317 ++  LZMA_FINISH_ANY - Decode just destLen bytes.
 140.318 ++  LZMA_FINISH_END - Stream must be finished after (*destLen).
 140.319 ++
 140.320 ++Returns:
 140.321 ++  SZ_OK
 140.322 ++    status:
 140.323 ++      LZMA_STATUS_FINISHED_WITH_MARK
 140.324 ++      LZMA_STATUS_NOT_FINISHED
 140.325 ++      LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK
 140.326 ++  SZ_ERROR_DATA - Data error
 140.327 ++  SZ_ERROR_MEM  - Memory allocation error
 140.328 ++  SZ_ERROR_UNSUPPORTED - Unsupported properties
 140.329 ++  SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src).
 140.330 ++*/
 140.331 ++
 140.332 ++SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen,
 140.333 ++    const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode,
 140.334 ++    ELzmaStatus *status, ISzAlloc *alloc);
 140.335 ++
 140.336 ++/* -------------------------------------------------------------------------- */
 140.337 ++
 140.338 ++/* LzmaDec.c -- LZMA Decoder
 140.339 ++2009-09-20 : Igor Pavlov : Public domain */
 140.340 ++
 140.341 ++//#include "LzmaDec.h"
 140.342 ++
 140.343 ++//#include <string.h>
 140.344 ++
 140.345 ++#define kNumTopBits 24
 140.346 ++#define kTopValue ((UInt32)1 << kNumTopBits)
 140.347 ++
 140.348 ++#define kNumBitModelTotalBits 11
 140.349 ++#define kBitModelTotal (1 << kNumBitModelTotalBits)
 140.350 ++#define kNumMoveBits 5
 140.351 ++
 140.352 ++#define RC_INIT_SIZE 5
 140.353 ++
 140.354 ++#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); }
 140.355 ++
 140.356 ++#define TEST_BIT_0(p) ({ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; (code < bound);})
 140.357 ++#define UPDATE_0(p) range = bound; *(p) = (UIntLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits));
 140.358 ++#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (UIntLzmaProb)(ttt - (ttt >> kNumMoveBits));
 140.359 ++#define GET_BIT2(p, i, A0, A1) if(TEST_BIT_0(p)) \
 140.360 ++  { UPDATE_0(p); i = (i + i); A0; } else \
 140.361 ++  { UPDATE_1(p); i = (i + i) + 1; A1; }
 140.362 ++#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;)
 140.363 ++
 140.364 ++#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); }
 140.365 ++#define TREE_DECODE(probs, limit, i) \
 140.366 ++  { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; }
 140.367 ++
 140.368 ++/* #define _LZMA_SIZE_OPT */
 140.369 ++
 140.370 ++#ifdef _LZMA_SIZE_OPT
 140.371 ++#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i)
 140.372 ++#else
 140.373 ++#define TREE_6_DECODE(probs, i) \
 140.374 ++  { i = 1; \
 140.375 ++  TREE_GET_BIT(probs, i); \
 140.376 ++  TREE_GET_BIT(probs, i); \
 140.377 ++  TREE_GET_BIT(probs, i); \
 140.378 ++  TREE_GET_BIT(probs, i); \
 140.379 ++  TREE_GET_BIT(probs, i); \
 140.380 ++  TREE_GET_BIT(probs, i); \
 140.381 ++  i -= 0x40; }
 140.382 ++#endif
 140.383 ++
 140.384 ++#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); }
 140.385 ++
 140.386 ++#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound)
 140.387 ++#define UPDATE_0_CHECK range = bound;
 140.388 ++#define UPDATE_1_CHECK range -= bound; code -= bound;
 140.389 ++#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \
 140.390 ++  { UPDATE_0_CHECK; i = (i + i); A0; } else \
 140.391 ++  { UPDATE_1_CHECK; i = (i + i) + 1; A1; }
 140.392 ++#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;)
 140.393 ++#define TREE_DECODE_CHECK(probs, limit, i) \
 140.394 ++  { i = 1; do { GET_BIT_CHECK(probs + i, i) } while (i < limit); i -= limit; }
 140.395 ++
 140.396 ++
 140.397 ++#define kNumPosBitsMax 4
 140.398 ++#define kNumPosStatesMax (1 << kNumPosBitsMax)
 140.399 ++
 140.400 ++#define kLenNumLowBits 3
 140.401 ++#define kLenNumLowSymbols (1 << kLenNumLowBits)
 140.402 ++#define kLenNumMidBits 3
 140.403 ++#define kLenNumMidSymbols (1 << kLenNumMidBits)
 140.404 ++#define kLenNumHighBits 8
 140.405 ++#define kLenNumHighSymbols (1 << kLenNumHighBits)
 140.406 ++
 140.407 ++#define LenChoice 0
 140.408 ++#define LenChoice2 (LenChoice + 1)
 140.409 ++#define LenLow (LenChoice2 + 1)
 140.410 ++#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits))
 140.411 ++#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits))
 140.412 ++#define kNumLenProbs (LenHigh + kLenNumHighSymbols)
 140.413 ++
 140.414 ++
 140.415 ++#define kNumStates 12
 140.416 ++#define kNumLitStates 7
 140.417 ++
 140.418 ++#define kStartPosModelIndex 4
 140.419 ++#define kEndPosModelIndex 14
 140.420 ++#define kNumFullDistances (1 << (kEndPosModelIndex >> 1))
 140.421 ++
 140.422 ++#define kNumPosSlotBits 6
 140.423 ++#define kNumLenToPosStates 4
 140.424 ++
 140.425 ++#define kNumAlignBits 4
 140.426 ++#define kAlignTableSize (1 << kNumAlignBits)
 140.427 ++
 140.428 ++#define kMatchMinLen 2
 140.429 ++#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols)
 140.430 ++
 140.431 ++#define IsMatch 0
 140.432 ++#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax))
 140.433 ++#define IsRepG0 (IsRep + kNumStates)
 140.434 ++#define IsRepG1 (IsRepG0 + kNumStates)
 140.435 ++#define IsRepG2 (IsRepG1 + kNumStates)
 140.436 ++#define IsRep0Long (IsRepG2 + kNumStates)
 140.437 ++#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax))
 140.438 ++#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits))
 140.439 ++#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex)
 140.440 ++#define LenCoder (Align + kAlignTableSize)
 140.441 ++#define RepLenCoder (LenCoder + kNumLenProbs)
 140.442 ++#define Literal (RepLenCoder + kNumLenProbs)
 140.443 ++
 140.444 ++#define LZMA_BASE_SIZE 1846
 140.445 ++#define LZMA_LIT_SIZE 768
 140.446 ++
 140.447 ++#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp)))
 140.448 ++
 140.449 ++#if Literal != LZMA_BASE_SIZE
 140.450 ++StopCompilingDueBUG
 140.451 ++#endif
 140.452 ++
 140.453 ++#define LZMA_DIC_MIN (1 << 12)
 140.454 ++
 140.455 ++/* First LZMA-symbol is always decoded.
 140.456 ++And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization
 140.457 ++Out:
 140.458 ++  Result:
 140.459 ++    SZ_OK - OK
 140.460 ++    SZ_ERROR_DATA - Error
 140.461 ++  p->remainLen:
 140.462 ++    < kMatchSpecLenStart : normal remain
 140.463 ++    = kMatchSpecLenStart : finished
 140.464 ++    = kMatchSpecLenStart + 1 : Flush marker
 140.465 ++    = kMatchSpecLenStart + 2 : State Init Marker
 140.466 ++*/
 140.467 ++
 140.468 ++static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
 140.469 ++{
 140.470 ++  UIntLzmaProb *probs = p->probs;
 140.471 ++
 140.472 ++  unsigned state = p->state;
 140.473 ++  UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3];
 140.474 ++  unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1;
 140.475 ++  unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1;
 140.476 ++  unsigned lc = p->prop.lc;
 140.477 ++
 140.478 ++  Byte *dic = p->dic;
 140.479 ++  SizeT dicBufSize = p->dicBufSize;
 140.480 ++  SizeT dicPos = p->dicPos;
 140.481 ++  
 140.482 ++  UInt32 processedPos = p->processedPos;
 140.483 ++  UInt32 checkDicSize = p->checkDicSize;
 140.484 ++  unsigned len = 0;
 140.485 ++
 140.486 ++  const Byte *buf = p->buf;
 140.487 ++  UInt32 range = p->range;
 140.488 ++  UInt32 code = p->code;
 140.489 ++
 140.490 ++  do
 140.491 ++  {
 140.492 ++    UIntLzmaProb *prob;
 140.493 ++    UInt32 bound;
 140.494 ++    unsigned ttt;
 140.495 ++    unsigned posState = processedPos & pbMask;
 140.496 ++
 140.497 ++    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
 140.498 ++    if(TEST_BIT_0(prob))
 140.499 ++    {
 140.500 ++      unsigned symbol;
 140.501 ++      UPDATE_0(prob);
 140.502 ++      prob = probs + Literal;
 140.503 ++      if (checkDicSize != 0 || processedPos != 0)
 140.504 ++        prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) +
 140.505 ++        (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc))));
 140.506 ++
 140.507 ++      if (state < kNumLitStates)
 140.508 ++      {
 140.509 ++        state -= (state < 4) ? state : 3;
 140.510 ++        symbol = 1;
 140.511 ++        do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100);
 140.512 ++      }
 140.513 ++      else
 140.514 ++      {
 140.515 ++        unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
 140.516 ++        unsigned offs = 0x100;
 140.517 ++        state -= (state < 10) ? 3 : 6;
 140.518 ++        symbol = 1;
 140.519 ++        do
 140.520 ++        {
 140.521 ++          unsigned bit;
 140.522 ++          UIntLzmaProb *probLit;
 140.523 ++          matchByte <<= 1;
 140.524 ++          bit = (matchByte & offs);
 140.525 ++          probLit = prob + offs + bit + symbol;
 140.526 ++          GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit)
 140.527 ++        }
 140.528 ++        while (symbol < 0x100);
 140.529 ++      }
 140.530 ++      dic[dicPos++] = (Byte)symbol;
 140.531 ++      processedPos++;
 140.532 ++      continue;
 140.533 ++    }
 140.534 ++    else
 140.535 ++    {
 140.536 ++      UPDATE_1(prob);
 140.537 ++      prob = probs + IsRep + state;
 140.538 ++      if(TEST_BIT_0(prob))
 140.539 ++      {
 140.540 ++        UPDATE_0(prob);
 140.541 ++        state += kNumStates;
 140.542 ++        prob = probs + LenCoder;
 140.543 ++      }
 140.544 ++      else
 140.545 ++      {
 140.546 ++        UPDATE_1(prob);
 140.547 ++        if (checkDicSize == 0 && processedPos == 0)
 140.548 ++          return SZ_ERROR_DATA;
 140.549 ++        prob = probs + IsRepG0 + state;
 140.550 ++        if(TEST_BIT_0(prob))
 140.551 ++        {
 140.552 ++          UPDATE_0(prob);
 140.553 ++          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
 140.554 ++          if(TEST_BIT_0(prob))
 140.555 ++          {
 140.556 ++            UPDATE_0(prob);
 140.557 ++            dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
 140.558 ++            dicPos++;
 140.559 ++            processedPos++;
 140.560 ++            state = state < kNumLitStates ? 9 : 11;
 140.561 ++            continue;
 140.562 ++          }
 140.563 ++          UPDATE_1(prob);
 140.564 ++        }
 140.565 ++        else
 140.566 ++        {
 140.567 ++          UInt32 distance;
 140.568 ++          UPDATE_1(prob);
 140.569 ++          prob = probs + IsRepG1 + state;
 140.570 ++          if(TEST_BIT_0(prob))
 140.571 ++          {
 140.572 ++            UPDATE_0(prob);
 140.573 ++            distance = rep1;
 140.574 ++          }
 140.575 ++          else
 140.576 ++          {
 140.577 ++            UPDATE_1(prob);
 140.578 ++            prob = probs + IsRepG2 + state;
 140.579 ++            if(TEST_BIT_0(prob))
 140.580 ++            {
 140.581 ++              UPDATE_0(prob);
 140.582 ++              distance = rep2;
 140.583 ++            }
 140.584 ++            else
 140.585 ++            {
 140.586 ++              UPDATE_1(prob);
 140.587 ++              distance = rep3;
 140.588 ++              rep3 = rep2;
 140.589 ++            }
 140.590 ++            rep2 = rep1;
 140.591 ++          }
 140.592 ++          rep1 = rep0;
 140.593 ++          rep0 = distance;
 140.594 ++        }
 140.595 ++        state = state < kNumLitStates ? 8 : 11;
 140.596 ++        prob = probs + RepLenCoder;
 140.597 ++      }
 140.598 ++      {
 140.599 ++        unsigned limit, offset;
 140.600 ++        UIntLzmaProb *probLen = prob + LenChoice;
 140.601 ++        if(TEST_BIT_0(probLen))
 140.602 ++        {
 140.603 ++          UPDATE_0(probLen);
 140.604 ++          probLen = prob + LenLow + (posState << kLenNumLowBits);
 140.605 ++          offset = 0;
 140.606 ++          limit = (1 << kLenNumLowBits);
 140.607 ++        }
 140.608 ++        else
 140.609 ++        {
 140.610 ++          UPDATE_1(probLen);
 140.611 ++          probLen = prob + LenChoice2;
 140.612 ++          if(TEST_BIT_0(probLen))
 140.613 ++          {
 140.614 ++            UPDATE_0(probLen);
 140.615 ++            probLen = prob + LenMid + (posState << kLenNumMidBits);
 140.616 ++            offset = kLenNumLowSymbols;
 140.617 ++            limit = (1 << kLenNumMidBits);
 140.618 ++          }
 140.619 ++          else
 140.620 ++          {
 140.621 ++            UPDATE_1(probLen);
 140.622 ++            probLen = prob + LenHigh;
 140.623 ++            offset = kLenNumLowSymbols + kLenNumMidSymbols;
 140.624 ++            limit = (1 << kLenNumHighBits);
 140.625 ++          }
 140.626 ++        }
 140.627 ++        TREE_DECODE(probLen, limit, len);
 140.628 ++        len += offset;
 140.629 ++      }
 140.630 ++
 140.631 ++      if (state >= kNumStates)
 140.632 ++      {
 140.633 ++        UInt32 distance;
 140.634 ++        prob = probs + PosSlot +
 140.635 ++            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits);
 140.636 ++        TREE_6_DECODE(prob, distance);
 140.637 ++        if (distance >= kStartPosModelIndex)
 140.638 ++        {
 140.639 ++          unsigned posSlot = (unsigned)distance;
 140.640 ++          int numDirectBits = (int)(((distance >> 1) - 1));
 140.641 ++          distance = (2 | (distance & 1));
 140.642 ++          if (posSlot < kEndPosModelIndex)
 140.643 ++          {
 140.644 ++            distance <<= numDirectBits;
 140.645 ++            prob = probs + SpecPos + distance - posSlot - 1;
 140.646 ++            {
 140.647 ++              UInt32 mask = 1;
 140.648 ++              unsigned i = 1;
 140.649 ++              do
 140.650 ++              {
 140.651 ++                GET_BIT2(prob + i, i, ; , distance |= mask);
 140.652 ++                mask <<= 1;
 140.653 ++              }
 140.654 ++              while (--numDirectBits != 0);
 140.655 ++            }
 140.656 ++          }
 140.657 ++          else
 140.658 ++          {
 140.659 ++            numDirectBits -= kNumAlignBits;
 140.660 ++            do
 140.661 ++            {
 140.662 ++              NORMALIZE
 140.663 ++              range >>= 1;
 140.664 ++              
 140.665 ++              {
 140.666 ++                UInt32 t;
 140.667 ++                code -= range;
 140.668 ++                t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */
 140.669 ++                distance = (distance << 1) + (t + 1);
 140.670 ++                code += range & t;
 140.671 ++              }
 140.672 ++              /*
 140.673 ++              distance <<= 1;
 140.674 ++              if (code >= range)
 140.675 ++              {
 140.676 ++                code -= range;
 140.677 ++                distance |= 1;
 140.678 ++              }
 140.679 ++              */
 140.680 ++            }
 140.681 ++            while (--numDirectBits != 0);
 140.682 ++            prob = probs + Align;
 140.683 ++            distance <<= kNumAlignBits;
 140.684 ++            {
 140.685 ++              unsigned i = 1;
 140.686 ++              GET_BIT2(prob + i, i, ; , distance |= 1);
 140.687 ++              GET_BIT2(prob + i, i, ; , distance |= 2);
 140.688 ++              GET_BIT2(prob + i, i, ; , distance |= 4);
 140.689 ++              GET_BIT2(prob + i, i, ; , distance |= 8);
 140.690 ++            }
 140.691 ++            if (distance == (UInt32)0xFFFFFFFF)
 140.692 ++            {
 140.693 ++              len += kMatchSpecLenStart;
 140.694 ++              state -= kNumStates;
 140.695 ++              break;
 140.696 ++            }
 140.697 ++          }
 140.698 ++        }
 140.699 ++        rep3 = rep2;
 140.700 ++        rep2 = rep1;
 140.701 ++        rep1 = rep0;
 140.702 ++        rep0 = distance + 1;
 140.703 ++        if (checkDicSize == 0)
 140.704 ++        {
 140.705 ++          if (distance >= processedPos)
 140.706 ++            return SZ_ERROR_DATA;
 140.707 ++        }
 140.708 ++        else if (distance >= checkDicSize)
 140.709 ++          return SZ_ERROR_DATA;
 140.710 ++        state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3;
 140.711 ++      }
 140.712 ++
 140.713 ++      len += kMatchMinLen;
 140.714 ++
 140.715 ++      if (limit == dicPos)
 140.716 ++        return SZ_ERROR_DATA;
 140.717 ++      {
 140.718 ++        SizeT rem = limit - dicPos;
 140.719 ++        unsigned curLen = ((rem < len) ? (unsigned)rem : len);
 140.720 ++        SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0);
 140.721 ++
 140.722 ++        processedPos += curLen;
 140.723 ++
 140.724 ++        len -= curLen;
 140.725 ++        if (pos + curLen <= dicBufSize)
 140.726 ++        {
 140.727 ++          Byte *dest = dic + dicPos;
 140.728 ++          ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos;
 140.729 ++          const Byte *lim = dest + curLen;
 140.730 ++          dicPos += curLen;
 140.731 ++          do
 140.732 ++            *(dest) = (Byte)(*(dest + src));
 140.733 ++          while (++dest != lim);
 140.734 ++        }
 140.735 ++        else
 140.736 ++        {
 140.737 ++          do
 140.738 ++          {
 140.739 ++            dic[dicPos++] = dic[pos];
 140.740 ++            if (++pos == dicBufSize)
 140.741 ++              pos = 0;
 140.742 ++          }
 140.743 ++          while (--curLen != 0);
 140.744 ++        }
 140.745 ++      }
 140.746 ++    }
 140.747 ++  }
 140.748 ++  while (dicPos < limit && buf < bufLimit);
 140.749 ++  NORMALIZE;
 140.750 ++  p->buf = buf;
 140.751 ++  p->range = range;
 140.752 ++  p->code = code;
 140.753 ++  p->remainLen = len;
 140.754 ++  p->dicPos = dicPos;
 140.755 ++  p->processedPos = processedPos;
 140.756 ++  p->reps[0] = rep0;
 140.757 ++  p->reps[1] = rep1;
 140.758 ++  p->reps[2] = rep2;
 140.759 ++  p->reps[3] = rep3;
 140.760 ++  p->state = state;
 140.761 ++
 140.762 ++  return SZ_OK;
 140.763 ++}
 140.764 ++
 140.765 ++static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit)
 140.766 ++{
 140.767 ++  if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart)
 140.768 ++  {
 140.769 ++    Byte *dic = p->dic;
 140.770 ++    SizeT dicPos = p->dicPos;
 140.771 ++    SizeT dicBufSize = p->dicBufSize;
 140.772 ++    unsigned len = p->remainLen;
 140.773 ++    UInt32 rep0 = p->reps[0];
 140.774 ++    if (limit - dicPos < len)
 140.775 ++      len = (unsigned)(limit - dicPos);
 140.776 ++
 140.777 ++    if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len)
 140.778 ++      p->checkDicSize = p->prop.dicSize;
 140.779 ++
 140.780 ++    p->processedPos += len;
 140.781 ++    p->remainLen -= len;
 140.782 ++    while (len-- != 0)
 140.783 ++    {
 140.784 ++      dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)];
 140.785 ++      dicPos++;
 140.786 ++    }
 140.787 ++    p->dicPos = dicPos;
 140.788 ++  }
 140.789 ++}
 140.790 ++
 140.791 ++static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit)
 140.792 ++{
 140.793 ++  do
 140.794 ++  {
 140.795 ++    SizeT limit2 = limit;
 140.796 ++    if (p->checkDicSize == 0)
 140.797 ++    {
 140.798 ++      UInt32 rem = p->prop.dicSize - p->processedPos;
 140.799 ++      if (limit - p->dicPos > rem)
 140.800 ++        limit2 = p->dicPos + rem;
 140.801 ++    }
 140.802 ++    RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit));
 140.803 ++    if (p->processedPos >= p->prop.dicSize)
 140.804 ++      p->checkDicSize = p->prop.dicSize;
 140.805 ++    LzmaDec_WriteRem(p, limit);
 140.806 ++  }
 140.807 ++  while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart);
 140.808 ++
 140.809 ++  if (p->remainLen > kMatchSpecLenStart)
 140.810 ++  {
 140.811 ++    p->remainLen = kMatchSpecLenStart;
 140.812 ++  }
 140.813 ++  return 0;
 140.814 ++}
 140.815 ++
 140.816 ++typedef enum
 140.817 ++{
 140.818 ++  DUMMY_ERROR, /* unexpected end of input stream */
 140.819 ++  DUMMY_LIT,
 140.820 ++  DUMMY_MATCH,
 140.821 ++  DUMMY_REP
 140.822 ++} ELzmaDummy;
 140.823 ++
 140.824 ++static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize)
 140.825 ++{
 140.826 ++  UInt32 range = p->range;
 140.827 ++  UInt32 code = p->code;
 140.828 ++  const Byte *bufLimit = buf + inSize;
 140.829 ++  UIntLzmaProb *probs = p->probs;
 140.830 ++  unsigned state = p->state;
 140.831 ++  ELzmaDummy res;
 140.832 ++
 140.833 ++  {
 140.834 ++    UIntLzmaProb *prob;
 140.835 ++    UInt32 bound;
 140.836 ++    unsigned ttt;
 140.837 ++    unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1);
 140.838 ++
 140.839 ++    prob = probs + IsMatch + (state << kNumPosBitsMax) + posState;
 140.840 ++    IF_BIT_0_CHECK(prob)
 140.841 ++    {
 140.842 ++      UPDATE_0_CHECK
 140.843 ++
 140.844 ++      /* if (bufLimit - buf >= 7) return DUMMY_LIT; */
 140.845 ++
 140.846 ++      prob = probs + Literal;
 140.847 ++      if (p->checkDicSize != 0 || p->processedPos != 0)
 140.848 ++        prob += (LZMA_LIT_SIZE *
 140.849 ++          ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) +
 140.850 ++          (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc))));
 140.851 ++
 140.852 ++      if (state < kNumLitStates)
 140.853 ++      {
 140.854 ++        unsigned symbol = 1;
 140.855 ++        do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100);
 140.856 ++      }
 140.857 ++      else
 140.858 ++      {
 140.859 ++        unsigned matchByte = p->dic[p->dicPos - p->reps[0] +
 140.860 ++            ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)];
 140.861 ++        unsigned offs = 0x100;
 140.862 ++        unsigned symbol = 1;
 140.863 ++        do
 140.864 ++        {
 140.865 ++          unsigned bit;
 140.866 ++          UIntLzmaProb *probLit;
 140.867 ++          matchByte <<= 1;
 140.868 ++          bit = (matchByte & offs);
 140.869 ++          probLit = prob + offs + bit + symbol;
 140.870 ++          GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit)
 140.871 ++        }
 140.872 ++        while (symbol < 0x100);
 140.873 ++      }
 140.874 ++      res = DUMMY_LIT;
 140.875 ++    }
 140.876 ++    else
 140.877 ++    {
 140.878 ++      unsigned len;
 140.879 ++      UPDATE_1_CHECK;
 140.880 ++
 140.881 ++      prob = probs + IsRep + state;
 140.882 ++      IF_BIT_0_CHECK(prob)
 140.883 ++      {
 140.884 ++        UPDATE_0_CHECK;
 140.885 ++        state = 0;
 140.886 ++        prob = probs + LenCoder;
 140.887 ++        res = DUMMY_MATCH;
 140.888 ++      }
 140.889 ++      else
 140.890 ++      {
 140.891 ++        UPDATE_1_CHECK;
 140.892 ++        res = DUMMY_REP;
 140.893 ++        prob = probs + IsRepG0 + state;
 140.894 ++        IF_BIT_0_CHECK(prob)
 140.895 ++        {
 140.896 ++          UPDATE_0_CHECK;
 140.897 ++          prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState;
 140.898 ++          IF_BIT_0_CHECK(prob)
 140.899 ++          {
 140.900 ++            UPDATE_0_CHECK;
 140.901 ++            NORMALIZE_CHECK;
 140.902 ++            return DUMMY_REP;
 140.903 ++          }
 140.904 ++          else
 140.905 ++          {
 140.906 ++            UPDATE_1_CHECK;
 140.907 ++          }
 140.908 ++        }
 140.909 ++        else
 140.910 ++        {
 140.911 ++          UPDATE_1_CHECK;
 140.912 ++          prob = probs + IsRepG1 + state;
 140.913 ++          IF_BIT_0_CHECK(prob)
 140.914 ++          {
 140.915 ++            UPDATE_0_CHECK;
 140.916 ++          }
 140.917 ++          else
 140.918 ++          {
 140.919 ++            UPDATE_1_CHECK;
 140.920 ++            prob = probs + IsRepG2 + state;
 140.921 ++            IF_BIT_0_CHECK(prob)
 140.922 ++            {
 140.923 ++              UPDATE_0_CHECK;
 140.924 ++            }
 140.925 ++            else
 140.926 ++            {
 140.927 ++              UPDATE_1_CHECK;
 140.928 ++            }
 140.929 ++          }
 140.930 ++        }
 140.931 ++        state = kNumStates;
 140.932 ++        prob = probs + RepLenCoder;
 140.933 ++      }
 140.934 ++      {
 140.935 ++        unsigned limit, offset;
 140.936 ++        UIntLzmaProb *probLen = prob + LenChoice;
 140.937 ++        IF_BIT_0_CHECK(probLen)
 140.938 ++        {
 140.939 ++          UPDATE_0_CHECK;
 140.940 ++          probLen = prob + LenLow + (posState << kLenNumLowBits);
 140.941 ++          offset = 0;
 140.942 ++          limit = 1 << kLenNumLowBits;
 140.943 ++        }
 140.944 ++        else
 140.945 ++        {
 140.946 ++          UPDATE_1_CHECK;
 140.947 ++          probLen = prob + LenChoice2;
 140.948 ++          IF_BIT_0_CHECK(probLen)
 140.949 ++          {
 140.950 ++            UPDATE_0_CHECK;
 140.951 ++            probLen = prob + LenMid + (posState << kLenNumMidBits);
 140.952 ++            offset = kLenNumLowSymbols;
 140.953 ++            limit = 1 << kLenNumMidBits;
 140.954 ++          }
 140.955 ++          else
 140.956 ++          {
 140.957 ++            UPDATE_1_CHECK;
 140.958 ++            probLen = prob + LenHigh;
 140.959 ++            offset = kLenNumLowSymbols + kLenNumMidSymbols;
 140.960 ++            limit = 1 << kLenNumHighBits;
 140.961 ++          }
 140.962 ++        }
 140.963 ++        TREE_DECODE_CHECK(probLen, limit, len);
 140.964 ++        len += offset;
 140.965 ++      }
 140.966 ++
 140.967 ++      if (state < 4)
 140.968 ++      {
 140.969 ++        unsigned posSlot;
 140.970 ++        prob = probs + PosSlot +
 140.971 ++            ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) <<
 140.972 ++            kNumPosSlotBits);
 140.973 ++        TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot);
 140.974 ++        if (posSlot >= kStartPosModelIndex)
 140.975 ++        {
 140.976 ++          int numDirectBits = ((posSlot >> 1) - 1);
 140.977 ++
 140.978 ++          /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */
 140.979 ++
 140.980 ++          if (posSlot < kEndPosModelIndex)
 140.981 ++          {
 140.982 ++            prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1;
 140.983 ++          }
 140.984 ++          else
 140.985 ++          {
 140.986 ++            numDirectBits -= kNumAlignBits;
 140.987 ++            do
 140.988 ++            {
 140.989 ++              NORMALIZE_CHECK
 140.990 ++              range >>= 1;
 140.991 ++              code -= range & (((code - range) >> 31) - 1);
 140.992 ++              /* if (code >= range) code -= range; */
 140.993 ++            }
 140.994 ++            while (--numDirectBits != 0);
 140.995 ++            prob = probs + Align;
 140.996 ++            numDirectBits = kNumAlignBits;
 140.997 ++          }
 140.998 ++          {
 140.999 ++            unsigned i = 1;
140.1000 ++            do
140.1001 ++            {
140.1002 ++              GET_BIT_CHECK(prob + i, i);
140.1003 ++            }
140.1004 ++            while (--numDirectBits != 0);
140.1005 ++          }
140.1006 ++        }
140.1007 ++      }
140.1008 ++    }
140.1009 ++  }
140.1010 ++  NORMALIZE_CHECK;
140.1011 ++  return res;
140.1012 ++}
140.1013 ++
140.1014 ++
140.1015 ++static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data)
140.1016 ++{
140.1017 ++  p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]);
140.1018 ++  p->range = 0xFFFFFFFF;
140.1019 ++  p->needFlush = 0;
140.1020 ++}
140.1021 ++
140.1022 ++void LzmaDec_Init(CLzmaDec *p)
140.1023 ++{
140.1024 ++  p->dicFilePos = 0;
140.1025 ++  p->dicPos = 0;
140.1026 ++  p->needFlush = 1;
140.1027 ++  p->remainLen = 0;
140.1028 ++  p->tempBufSize = 0;
140.1029 ++  p->processedPos = 0;
140.1030 ++  p->checkDicSize = 0;
140.1031 ++  p->needInitState = 1;
140.1032 ++  p->needInitState = 1;
140.1033 ++}
140.1034 ++
140.1035 ++static void LzmaDec_InitStateReal(CLzmaDec *p)
140.1036 ++{
140.1037 ++  UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp));
140.1038 ++  UInt32 i;
140.1039 ++  UIntLzmaProb *probs = p->probs;
140.1040 ++  for (i = 0; i < numProbs; i++)
140.1041 ++    probs[i] = kBitModelTotal >> 1;
140.1042 ++  p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1;
140.1043 ++  p->state = 0;
140.1044 ++  p->needInitState = 0;
140.1045 ++}
140.1046 ++
140.1047 ++SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen,
140.1048 ++    ELzmaFinishMode finishMode, ELzmaStatus *status)
140.1049 ++{
140.1050 ++  SizeT inSize = *srcLen;
140.1051 ++  (*srcLen) = 0;
140.1052 ++  LzmaDec_WriteRem(p, dicLimit);
140.1053 ++  
140.1054 ++  *status = LZMA_STATUS_NOT_SPECIFIED;
140.1055 ++
140.1056 ++  while (p->remainLen != kMatchSpecLenStart)
140.1057 ++  {
140.1058 ++      int checkEndMarkNow;
140.1059 ++
140.1060 ++      if (p->needFlush != 0)
140.1061 ++      {
140.1062 ++        for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--)
140.1063 ++          p->tempBuf[p->tempBufSize++] = *src++;
140.1064 ++        if (p->tempBufSize < RC_INIT_SIZE)
140.1065 ++        {
140.1066 ++          *status = LZMA_STATUS_NEEDS_MORE_INPUT;
140.1067 ++          return SZ_OK;
140.1068 ++        }
140.1069 ++        if (p->tempBuf[0] != 0)
140.1070 ++          return SZ_ERROR_DATA;
140.1071 ++
140.1072 ++        LzmaDec_InitRc(p, p->tempBuf);
140.1073 ++        p->tempBufSize = 0;
140.1074 ++      }
140.1075 ++
140.1076 ++      checkEndMarkNow = 0;
140.1077 ++      if (p->dicPos >= dicLimit)
140.1078 ++      {
140.1079 ++        if (p->remainLen == 0 && p->code == 0)
140.1080 ++        {
140.1081 ++          *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK;
140.1082 ++          return SZ_OK;
140.1083 ++        }
140.1084 ++        if (finishMode == LZMA_FINISH_ANY)
140.1085 ++        {
140.1086 ++          *status = LZMA_STATUS_NOT_FINISHED;
140.1087 ++          return SZ_OK;
140.1088 ++        }
140.1089 ++        if (p->remainLen != 0)
140.1090 ++        {
140.1091 ++          *status = LZMA_STATUS_NOT_FINISHED;
140.1092 ++          return SZ_ERROR_DATA;
140.1093 ++        }
140.1094 ++        checkEndMarkNow = 1;
140.1095 ++      }
140.1096 ++
140.1097 ++      if (p->needInitState)
140.1098 ++        LzmaDec_InitStateReal(p);
140.1099 ++  
140.1100 ++      if (p->tempBufSize == 0)
140.1101 ++      {
140.1102 ++        SizeT processed;
140.1103 ++        const Byte *bufLimit;
140.1104 ++        if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
140.1105 ++        {
140.1106 ++          int dummyRes = LzmaDec_TryDummy(p, src, inSize);
140.1107 ++          if (dummyRes == DUMMY_ERROR)
140.1108 ++          {
140.1109 ++            memcpy(p->tempBuf, src, inSize);
140.1110 ++            p->tempBufSize = (unsigned)inSize;
140.1111 ++            (*srcLen) += inSize;
140.1112 ++            *status = LZMA_STATUS_NEEDS_MORE_INPUT;
140.1113 ++            return SZ_OK;
140.1114 ++          }
140.1115 ++          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
140.1116 ++          {
140.1117 ++            *status = LZMA_STATUS_NOT_FINISHED;
140.1118 ++            return SZ_ERROR_DATA;
140.1119 ++          }
140.1120 ++          bufLimit = src;
140.1121 ++        }
140.1122 ++        else
140.1123 ++          bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX;
140.1124 ++        p->buf = src;
140.1125 ++        if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0)
140.1126 ++          return SZ_ERROR_DATA;
140.1127 ++        processed = (SizeT)(p->buf - src);
140.1128 ++        (*srcLen) += processed;
140.1129 ++        src += processed;
140.1130 ++        inSize -= processed;
140.1131 ++      }
140.1132 ++      else
140.1133 ++      {
140.1134 ++        unsigned rem = p->tempBufSize, lookAhead = 0;
140.1135 ++        while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize)
140.1136 ++          p->tempBuf[rem++] = src[lookAhead++];
140.1137 ++        p->tempBufSize = rem;
140.1138 ++        if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow)
140.1139 ++        {
140.1140 ++          int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem);
140.1141 ++          if (dummyRes == DUMMY_ERROR)
140.1142 ++          {
140.1143 ++            (*srcLen) += lookAhead;
140.1144 ++            *status = LZMA_STATUS_NEEDS_MORE_INPUT;
140.1145 ++            return SZ_OK;
140.1146 ++          }
140.1147 ++          if (checkEndMarkNow && dummyRes != DUMMY_MATCH)
140.1148 ++          {
140.1149 ++            *status = LZMA_STATUS_NOT_FINISHED;
140.1150 ++            return SZ_ERROR_DATA;
140.1151 ++          }
140.1152 ++        }
140.1153 ++        p->buf = p->tempBuf;
140.1154 ++        if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0)
140.1155 ++          return SZ_ERROR_DATA;
140.1156 ++        lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf));
140.1157 ++        (*srcLen) += lookAhead;
140.1158 ++        src += lookAhead;
140.1159 ++        inSize -= lookAhead;
140.1160 ++        p->tempBufSize = 0;
140.1161 ++      }
140.1162 ++  }
140.1163 ++  if (p->code == 0)
140.1164 ++    *status = LZMA_STATUS_FINISHED_WITH_MARK;
140.1165 ++  return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA;
140.1166 ++}
140.1167 ++
140.1168 ++/* -------------------------------------------------------------------------- */
140.1169 ++
140.1170 ++#define ReadUnalignedUInt32(p) ((UInt32)((Byte*)(p))[0] | ((UInt32)((Byte*)(p))[1]<<8) | ((UInt32)((Byte*)(p))[2]<<16) | ((UInt32)((Byte*)(p))[3]<<24))
140.1171 ++#define ReadUnalignedUInt64(p) (ReadUnalignedUInt32(p) | ((UInt64)ReadUnalignedUInt32((Byte*)(p)+4)<<32))
140.1172 ++
140.1173 ++CLzmaDec lzmadec;
140.1174 ++
140.1175 ++static unsigned long malloc_top = 0;
140.1176 ++static void *grub_malloc(unsigned long size)
140.1177 ++{
140.1178 ++       if (!malloc_top)
140.1179 ++               malloc_top = RAW_ADDR ((saved_mem_upper << 10) + 0x100000);
140.1180 ++       malloc_top = (malloc_top - size) & ~3;
140.1181 ++       return (void *) malloc_top;
140.1182 ++}
140.1183 ++#define grub_free(x)
140.1184 ++
140.1185 ++int
140.1186 ++dec_lzma_open (void)
140.1187 ++// return 1=success or 0=failure
140.1188 ++{
140.1189 ++    unsigned char header[13];
140.1190 ++    unsigned char d;
140.1191 ++
140.1192 ++    if (no_decompression) return 0;
140.1193 ++
140.1194 ++    // Now it does not support openning more than 1 file at a time. 
140.1195 ++    // Make sure previously allocated memory blocks is freed. 
140.1196 ++    // Don't need this line if grub_close is called for every openned file before grub_open is called for next file.
140.1197 ++    dec_lzma_close();
140.1198 ++
140.1199 ++    filepos = 0;
140.1200 ++    if (grub_read ((char *)header, 13, 0xedde0d90) == 13) 
140.1201 ++    {
140.1202 ++	// check header
140.1203 ++	lzmadec.prop.dicSize = ReadUnalignedUInt32(header+1);
140.1204 ++	if (lzmadec.prop.dicSize < LZMA_DIC_MIN)
140.1205 ++	    lzmadec.prop.dicSize = LZMA_DIC_MIN;
140.1206 ++	d = header[0];
140.1207 ++	if (d < 9*5*5)
140.1208 ++	{
140.1209 ++	    // valid LZMA file
140.1210 ++	    lzmadec.prop.lc = d % 9; d /= 9;
140.1211 ++	    lzmadec.prop.lp = d % 5;
140.1212 ++	    lzmadec.prop.pb = d / 5;
140.1213 ++	    lzmadec.fileu.fmax = ReadUnalignedUInt64(header+5);
140.1214 ++	    lzmadec.fileu.fpos = 0;
140.1215 ++	    lzmadec.dicBufSize = lzmadec.prop.dicSize;
140.1216 ++	    lzmadec.dic = (Byte*) grub_malloc(lzmadec.dicBufSize);
140.1217 ++	    //grub_printf("LZMA allocate memory\n");
140.1218 ++	    if (lzmadec.dic)
140.1219 ++	    {
140.1220 ++		lzmadec.numProbs = LzmaProps_GetNumProbs(&lzmadec.prop);
140.1221 ++		lzmadec.probs = (UIntLzmaProb *) grub_malloc(lzmadec.numProbs * sizeof(UIntLzmaProb));
140.1222 ++		if (lzmadec.probs)
140.1223 ++		{
140.1224 ++		    lzmadec.inpBufSize = 0x8000;
140.1225 ++		    lzmadec.inp = (Byte*) grub_malloc(lzmadec.inpBufSize);
140.1226 ++		    if (lzmadec.inp)
140.1227 ++		    {
140.1228 ++			lzmadec.inpFilePos = 0;
140.1229 ++			lzmadec.inpPos = 0;
140.1230 ++			lzmadec.inpSize = 0;
140.1231 ++			LzmaDec_Init(&lzmadec);
140.1232 ++			decomp_type = 1;
140.1233 ++			compressed_file = 1;
140.1234 ++			lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax;
140.1235 ++			lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos;
140.1236 ++			// success
140.1237 ++			//grub_printf("LZMA open success\n");
140.1238 ++			errnum = 0;
140.1239 ++			return 1;
140.1240 ++		    }
140.1241 ++		    else
140.1242 ++		    {
140.1243 ++			errnum = ERR_NOT_ENOUGH_MEMORY;
140.1244 ++		    }
140.1245 ++		    grub_free(lzmadec.probs); lzmadec.probs = 0;
140.1246 ++		}
140.1247 ++		else
140.1248 ++		{
140.1249 ++		    errnum = ERR_NOT_ENOUGH_MEMORY;
140.1250 ++		}
140.1251 ++		grub_free(lzmadec.dic); lzmadec.dic = 0;
140.1252 ++	    }
140.1253 ++	    else
140.1254 ++	    {
140.1255 ++		errnum = ERR_NOT_ENOUGH_MEMORY;
140.1256 ++	    }
140.1257 ++	}
140.1258 ++	else
140.1259 ++	{
140.1260 ++	    //grub_printf("LZMA allocate memory\n");
140.1261 ++	    errnum = ERR_BAD_GZIP_HEADER;
140.1262 ++	}
140.1263 ++    }
140.1264 ++    else
140.1265 ++    {
140.1266 ++	//grub_printf("LZMA error reading header\n");
140.1267 ++	errnum = ERR_BAD_GZIP_HEADER;
140.1268 ++    }
140.1269 ++    //grub_printf("LZMA open fail\n");
140.1270 ++    filepos = 0;
140.1271 ++    return 0;
140.1272 ++}
140.1273 ++
140.1274 ++void
140.1275 ++dec_lzma_close (void)
140.1276 ++{
140.1277 ++    if (lzmadec.inp  ) { grub_free(lzmadec.inp  ); lzmadec.inp   = 0; }
140.1278 ++    if (lzmadec.dic  ) { grub_free(lzmadec.dic  ); lzmadec.dic   = 0; }
140.1279 ++    if (lzmadec.probs) { grub_free(lzmadec.probs); lzmadec.probs = 0; }
140.1280 ++}
140.1281 ++
140.1282 ++unsigned long
140.1283 ++dec_lzma_read (char *buf, unsigned long len, unsigned long write)
140.1284 ++{
140.1285 ++    UInt64 outTx, outSkip;
140.1286 ++    //grub_printf("LZMA read buf=%ld len=%ld dic=%d inp=%d\n",buf,len,lzmadec.dic,lzmadec.inp);
140.1287 ++
140.1288 ++    compressed_file = 0;
140.1289 ++    lzmadec.fileu.fmax = filemax; filemax = lzmadec.filec.fmax;
140.1290 ++    lzmadec.fileu.fpos = filepos; filepos = lzmadec.filec.fpos;
140.1291 ++    /* Now filepos, filemax is of compressed file 
140.1292 ++     * fileu.fpos, fileu.fmax is of uncompressed data
140.1293 ++     * filec is not used
140.1294 ++     */
140.1295 ++
140.1296 ++    /*
140.1297 ++     * When dicPos>0,
140.1298 ++     *   dic[0 ... dicPos-1] contains 
140.1299 ++     *   uncompressed_data [dicFilePos ... dicFilePos+dicPos-1].
140.1300 ++     * When dicFilePos>0,
140.1301 ++     *   dic[dicPos ... dicBufSize-1] contains 
140.1302 ++     *   uncompressed_data [dicFilePos-dicBufSize+dicFilePos ... dicFilePos-1]
140.1303 ++     */
140.1304 ++    /* do we reset decompression to the beginning of the file? */
140.1305 ++    if (lzmadec.dicFilePos && (lzmadec.fileu.fpos < lzmadec.dicFilePos-lzmadec.dicBufSize+lzmadec.dicFilePos))
140.1306 ++    {
140.1307 ++	LzmaDec_Init(&lzmadec);
140.1308 ++	filepos = 13;
140.1309 ++	lzmadec.inpPos = lzmadec.inpSize = 0;
140.1310 ++    }
140.1311 ++
140.1312 ++    outTx = 0;
140.1313 ++    outSkip = lzmadec.fileu.fpos - lzmadec.dicFilePos;
140.1314 ++    //grub_printf("fileu.fpos=%ld dicFilePos=%ld\n",lzmadec.fileu.fpos,lzmadec.dicFilePos);
140.1315 ++
140.1316 ++    /* Copy uncompressed data from upper part of dic. dic[dicPos]...dic[dicBufSize-1] */
140.1317 ++    if (lzmadec.dicFilePos > lzmadec.fileu.fpos)
140.1318 ++    {
140.1319 ++	UInt32 outTxCur = lzmadec.dicFilePos - lzmadec.fileu.fpos;
140.1320 ++	if (outTxCur > len) outTxCur = len;
140.1321 ++	if (buf)
140.1322 ++	{
140.1323 ++	    grub_memmove(buf, lzmadec.dic+outSkip+lzmadec.dicBufSize, outTxCur); 
140.1324 ++	    buf += outTxCur; 
140.1325 ++	}
140.1326 ++	outSkip = 0;
140.1327 ++	outTx += outTxCur; 
140.1328 ++	lzmadec.fileu.fpos += outTxCur; 
140.1329 ++	len -= outTxCur; 
140.1330 ++    }
140.1331 ++
140.1332 ++    while (len!=0)
140.1333 ++    {
140.1334 ++	SizeT inSizeCur, dicLimit;
140.1335 ++	UInt32 dicPos;
140.1336 ++	ELzmaStatus status;
140.1337 ++	SRes res;
140.1338 ++
140.1339 ++	/* Copy uncompressed data from lower part of dic. dic[0]...dic[dicPos-1] */
140.1340 ++	//grub_printf("Loop len=%ld outSkip=%ld dicPos=%d\n",len,outSkip,lzmadec.dicPos);
140.1341 ++	if (outSkip < lzmadec.dicPos)
140.1342 ++	{
140.1343 ++	    UInt32 outTxCur = lzmadec.dicPos - outSkip; 
140.1344 ++	    //grub_printf("Copy %d byte ",outTxCur);
140.1345 ++	    if (buf)
140.1346 ++	    {
140.1347 ++		grub_memmove(buf, lzmadec.dic+outSkip, outTxCur); 
140.1348 ++		buf += outTxCur; 
140.1349 ++	    }
140.1350 ++	    outSkip = lzmadec.dicPos;
140.1351 ++	    outTx += outTxCur; 
140.1352 ++	    lzmadec.fileu.fpos += outTxCur; 
140.1353 ++	    len -= outTxCur; 
140.1354 ++	    //grub_printf(" remaining len=%ld\n",len);
140.1355 ++	    if (len==0) break;
140.1356 ++	}
140.1357 ++	/* All existing wanted data from dic have been copied. We will add more data to dic. */
140.1358 ++	/* Read more input if there is no unprocessed input left. */
140.1359 ++	if (lzmadec.inpPos == lzmadec.inpSize)
140.1360 ++	{
140.1361 ++	    UInt32 inTxCur = (filemax-filepos<lzmadec.inpBufSize)?filemax-filepos:lzmadec.inpBufSize;
140.1362 ++	    lzmadec.inpFilePos = filepos;
140.1363 ++	    lzmadec.inpPos = 0;
140.1364 ++	    //grub_printf("read inp %d ",inTxCur);
140.1365 ++	    lzmadec.inpSize = grub_read(lzmadec.inp, inTxCur, 0xedde0d90);
140.1366 ++	    //grub_printf("->%d\n",lzmadec.inpSize);
140.1367 ++	}
140.1368 ++	inSizeCur = lzmadec.inpSize - lzmadec.inpPos;
140.1369 ++
140.1370 ++	/* Prepare output dicPos, dicLimit. */
140.1371 ++	if (lzmadec.dicPos == lzmadec.dicBufSize)
140.1372 ++	{
140.1373 ++	    lzmadec.dicPos = 0;
140.1374 ++	    outSkip -= lzmadec.dicBufSize;
140.1375 ++	}
140.1376 ++	dicPos = lzmadec.dicPos;
140.1377 ++	dicLimit = (lzmadec.dicBufSize-dicPos < len)? lzmadec.dicBufSize: dicPos+len;
140.1378 ++
140.1379 ++	/* Do decompression. */
140.1380 ++	//grub_printf("DecodeToDic dicPos=%d limit=%d inPos=%d inSize=%d ",dicPos,dicLimit,lzmadec.inpPos,inSizeCur);
140.1381 ++	status = LZMA_STATUS_NOT_SPECIFIED;
140.1382 ++	res = LzmaDec_DecodeToDic(&lzmadec, dicLimit, lzmadec.inp+lzmadec.inpPos, &inSizeCur, LZMA_FINISH_ANY, &status);
140.1383 ++	//grub_printf("->%d\n",inSizeCur);
140.1384 ++	lzmadec.inpPos += inSizeCur;
140.1385 ++	if (inSizeCur==0 && lzmadec.dicPos==dicPos)
140.1386 ++	{
140.1387 ++	    /* Error */
140.1388 ++	    //grub_printf("No more input and output\n");
140.1389 ++	    break;
140.1390 ++	}
140.1391 ++    }
140.1392 ++    compressed_file = 1;
140.1393 ++    lzmadec.filec.fmax = filemax; filemax = lzmadec.fileu.fmax;
140.1394 ++    lzmadec.filec.fpos = filepos; filepos = lzmadec.fileu.fpos;
140.1395 ++    /* Now filepos, file max is of uncompressed data
140.1396 ++     * filec.fpos, filwc.fmax is of compressed file
140.1397 ++     * fileu is not used
140.1398 ++     */
140.1399 ++
140.1400 ++    //grub_printf("LZMA read end %ld\n",outTx);
140.1401 ++    return outTx;
140.1402 ++}
140.1403 ++
140.1404 ++#endif /* ! NO_DECOMPRESSION */
140.1405 +diff -Naur ../grub4dos-chenall-r63/stage2/decomp.h ./stage2/decomp.h
140.1406 +--- grub4dos-chenall-r63/stage2/decomp.h	1970-01-01 07:00:00.000000000 +0700
140.1407 ++++ grub4dos/stage2/decomp.h	2010-11-28 13:51:54.687217000 +0700
140.1408 +@@ -0,0 +1,36 @@
140.1409 ++/* decomp.h - abstract decompression interface */
140.1410 ++/*
140.1411 ++ *  GRUB  --  GRand Unified Bootloader
140.1412 ++ *  Copyright (C) 1999,2000,2001,2004  Free Software Foundation, Inc.
140.1413 ++ *
140.1414 ++ *  This program is free software; you can redistribute it and/or modify
140.1415 ++ *  it under the terms of the GNU General Public License as published by
140.1416 ++ *  the Free Software Foundation; either version 2 of the License, or
140.1417 ++ *  (at your option) any later version.
140.1418 ++ *
140.1419 ++ *  This program is distributed in the hope that it will be useful,
140.1420 ++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
140.1421 ++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
140.1422 ++ *  GNU General Public License for more details.
140.1423 ++ *
140.1424 ++ *  You should have received a copy of the GNU General Public License
140.1425 ++ *  along with this program; if not, write to the Free Software
140.1426 ++ *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
140.1427 ++ */
140.1428 ++
140.1429 ++#ifndef ASM_FILE
140.1430 ++
140.1431 ++struct decomp_entry
140.1432 ++{
140.1433 ++  char *name;
140.1434 ++  int (*open_func) (void);
140.1435 ++  void (*close_func) (void);
140.1436 ++  unsigned long (*read_func) (char *buf, unsigned long len, unsigned long write);
140.1437 ++};
140.1438 ++
140.1439 ++#define NUM_DECOM 2
140.1440 ++
140.1441 ++extern struct decomp_entry decomp_table[NUM_DECOM];
140.1442 ++extern int decomp_type;
140.1443 ++
140.1444 ++#endif
140.1445 +\ No newline at end of file
140.1446 +diff -Naur ../grub4dos-chenall-r63/stage2/disk_io.c ./stage2/disk_io.c
140.1447 +--- grub4dos-chenall-r63/stage2/disk_io.c	2010-08-12 14:22:47.111207000 +0700
140.1448 ++++ grub4dos/stage2/disk_io.c	2010-11-28 20:26:39.089887300 +0700
140.1449 +@@ -21,6 +21,7 @@
140.1450 + 
140.1451 + #include <shared.h>
140.1452 + #include <filesys.h>
140.1453 ++#include <decomp.h>
140.1454 + #include <iso9660.h>
140.1455 + 
140.1456 + #ifdef SUPPORT_NETBOOT
140.1457 +@@ -1872,7 +1873,16 @@
140.1458 + #ifdef NO_DECOMPRESSION
140.1459 +       return 1;
140.1460 + #else
140.1461 +-      return gunzip_test_header ();
140.1462 ++      if (no_decompression)
140.1463 ++	return 1;
140.1464 ++      int i;
140.1465 ++      i = strlen(open_filename);
140.1466 ++      if (i>=5 && strcmp(open_filename+i-5,".lzma")==0)
140.1467 ++        dec_lzma_open ();
140.1468 ++      else
140.1469 ++        gunzip_test_header ();
140.1470 ++      errnum = 0;
140.1471 ++      return 1;
140.1472 + #endif
140.1473 +     }
140.1474 + 
140.1475 +@@ -1903,7 +1903,7 @@
140.1476 +   {
140.1477 +     if (write == 0x900ddeed)
140.1478 + 	return !(errnum = ERR_WRITE_GZIP_FILE);
140.1479 +-    return gunzip_read (buf, len);
140.1480 ++    return decomp_table[decomp_type].read_func (buf, len, write);
140.1481 +   }
140.1482 + #endif /* NO_DECOMPRESSION */
140.1483 + 
140.1484 +@@ -1978,6 +1982,12 @@
140.1485 + void
140.1486 + grub_close (void)
140.1487 + {
140.1488 ++#ifndef NO_DECOMPRESSION
140.1489 ++  if (compressed_file)
140.1490 ++      decomp_table[decomp_type].close_func ();
140.1491 ++  compressed_file = 0;
140.1492 ++#endif /* NO_DECOMPRESSION */
140.1493 ++
140.1494 + #ifndef NO_BLOCK_FILES
140.1495 +   if (block_file)
140.1496 +     return;
140.1497 +diff -Naur ../grub4dos-chenall-r63/stage2/gunzip.c ./stage2/gunzip.c
140.1498 +--- grub4dos-chenall-r63/stage2/gunzip.c	2010-07-26 19:35:48.440546000 +0700
140.1499 ++++ grub4dos/stage2/gunzip.c	2010-11-28 14:20:56.983870700 +0700
140.1500 +@@ -129,6 +129,8 @@
140.1501 + 
140.1502 + #include "filesys.h"
140.1503 + 
140.1504 ++#include "decomp.h"
140.1505 ++
140.1506 + /* so we can disable decompression  */
140.1507 + #ifdef GRUB_UTIL
140.1508 + int no_decompression = 0;
140.1509 +@@ -137,6 +139,15 @@
140.1510 + /* used to tell if "read" should be redirected to "gunzip_read" */
140.1511 + int compressed_file;
140.1512 + 
140.1513 ++/* identify active decompressor */
140.1514 ++int decomp_type;
140.1515 ++
140.1516 ++struct decomp_entry decomp_table[NUM_DECOM] =
140.1517 ++{
140.1518 ++	{"gz",gunzip_test_header,gunzip_close,gunzip_read},
140.1519 ++	{"lzma",dec_lzma_open,dec_lzma_close,dec_lzma_read}
140.1520 ++};
140.1521 ++
140.1522 + /* internal variables only */
140.1523 + static unsigned long long gzip_data_offset;
140.1524 + static unsigned long long gzip_filepos;
140.1525 +@@ -227,6 +238,7 @@
140.1526 + /* Little-Endian defines for the 2-byte magic number for gzip files */
140.1527 + #define GZIP_HDR_LE      0x8B1F
140.1528 + #define OLD_GZIP_HDR_LE  0x9E1F
140.1529 ++#define LZMA_HDR_LE      0x005D
140.1530 + 
140.1531 + /* Compression methods (see algorithm.doc) */
140.1532 + #define STORED      0
140.1533 +@@ -281,10 +292,18 @@
140.1534 +   if (no_decompression
140.1535 +       || grub_read ((char *)buf, 10, 0xedde0d90) != 10
140.1536 +       || ((*((unsigned short *) buf) != GZIP_HDR_LE)
140.1537 +-	  && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE)))
140.1538 ++	  && (*((unsigned short *) buf) != OLD_GZIP_HDR_LE)
140.1539 ++	  && (*((unsigned short *) buf) != LZMA_HDR_LE)))
140.1540 +     {
140.1541 +       filepos = 0;
140.1542 +       return ! errnum;
140.1543 ++    }
140.1544 ++
140.1545 ++  if (*((unsigned short *) buf) == LZMA_HDR_LE)
140.1546 ++    {
140.1547 ++      filepos = 0;
140.1548 ++      dec_lzma_open();
140.1549 ++      return 1;
140.1550 +     }
140.1551 + 
140.1552 +   /*
140.1553 +@@ -323,6 +334,7 @@
140.1554 + 
140.1555 +   initialize_tables ();
140.1556 + 
140.1557 ++  decomp_type = 0;
140.1558 +   compressed_file = 1;
140.1559 +   gunzip_swap_values ();
140.1560 +   /*
140.1561 +@@ -334,6 +346,11 @@
140.1562 +   return 1;
140.1563 + }
140.1564 + 
140.1565 ++void 
140.1566 ++gunzip_close (void)
140.1567 ++{
140.1568 ++}
140.1569 ++
140.1570 + 
140.1571 + /* Huffman code lookup table entry--this entry is four bytes for machines
140.1572 +    that have 16-bit pointers (e.g. PC's in the small or medium model).
140.1573 +@@ -1190,7 +1226,7 @@
140.1574 + 
140.1575 + 
140.1576 + unsigned long
140.1577 +-gunzip_read (char *buf, unsigned long len)
140.1578 ++gunzip_read (char *buf, unsigned long len, unsigned long write)
140.1579 + {
140.1580 +   unsigned long ret = 0;
140.1581 + 
140.1582 +diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.am ./stage2/Makefile.am
140.1583 +--- grub4dos-chenall-r63/stage2/Makefile.am	2010-08-12 14:22:47.111207000 +0700
140.1584 ++++ grub4dos/stage2/Makefile.am	2010-11-28 16:35:18.724975900 +0700
140.1585 +@@ -16,6 +16,7 @@
140.1586 + # The library for /sbin/grub.
140.1587 + noinst_LIBRARIES = libgrub.a
140.1588 + libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
140.1589 ++	dec_lzma.c \
140.1590 + 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \
140.1591 + 	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
140.1592 + 	fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \
140.1593 +@@ -100,7 +101,7 @@
140.1594 + 
140.1595 + # For stage2 target.
140.1596 + pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
140.1597 +-	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
140.1598 ++	cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \
140.1599 + 	fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
140.1600 + 	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \
140.1601 + 	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c
140.1602 +diff -Naur ../grub4dos-chenall-r63/stage2/Makefile.in ./stage2/Makefile.in
140.1603 +--- grub4dos-chenall-r63/stage2/Makefile.in	2010-08-12 14:22:47.111207000 +0700
140.1604 ++++ grub4dos/stage2/Makefile.in	2010-11-28 16:38:22.871508400 +0700
140.1605 +@@ -104,10 +104,11 @@
140.1606 + am_libgrub_a_OBJECTS = libgrub_a-boot.$(OBJEXT) \
140.1607 + 	libgrub_a-builtins.$(OBJEXT) libgrub_a-char_io.$(OBJEXT) \
140.1608 + 	libgrub_a-cmdline.$(OBJEXT) libgrub_a-common.$(OBJEXT) \
140.1609 +-	libgrub_a-disk_io.$(OBJEXT) libgrub_a-fsys_ext2fs.$(OBJEXT) \
140.1610 +-	libgrub_a-fsys_fat.$(OBJEXT) libgrub_a-fsys_ntfs.$(OBJEXT) \
140.1611 +-	libgrub_a-fsys_ffs.$(OBJEXT) libgrub_a-fsys_iso9660.$(OBJEXT) \
140.1612 +-	libgrub_a-fsys_jfs.$(OBJEXT) libgrub_a-fsys_minix.$(OBJEXT) \
140.1613 ++	libgrub_a-dec_lzma.$(OBJEXT) libgrub_a-disk_io.$(OBJEXT) \
140.1614 ++	libgrub_a-fsys_ext2fs.$(OBJEXT) libgrub_a-fsys_fat.$(OBJEXT) \
140.1615 ++	libgrub_a-fsys_ntfs.$(OBJEXT) libgrub_a-fsys_ffs.$(OBJEXT) \
140.1616 ++	libgrub_a-fsys_iso9660.$(OBJEXT) libgrub_a-fsys_jfs.$(OBJEXT) \
140.1617 ++	libgrub_a-fsys_minix.$(OBJEXT) \
140.1618 + 	libgrub_a-fsys_reiserfs.$(OBJEXT) \
140.1619 + 	libgrub_a-fsys_ufs2.$(OBJEXT) libgrub_a-fsys_vstafs.$(OBJEXT) \
140.1620 + 	libgrub_a-fsys_xfs.$(OBJEXT) libgrub_a-fsys_pxe.$(OBJEXT) \
140.1621 +@@ -131,6 +132,7 @@
140.1622 + 	diskless_exec-char_io.$(OBJEXT) \
140.1623 + 	diskless_exec-cmdline.$(OBJEXT) diskless_exec-common.$(OBJEXT) \
140.1624 + 	diskless_exec-console.$(OBJEXT) \
140.1625 ++	diskless_exec-dec_lzma.$(OBJEXT) \
140.1626 + 	diskless_exec-disk_io.$(OBJEXT) \
140.1627 + 	diskless_exec-fsys_ext2fs.$(OBJEXT) \
140.1628 + 	diskless_exec-fsys_fat.$(OBJEXT) \
140.1629 +@@ -247,6 +249,7 @@
140.1630 + 	pre_stage2_exec-cmdline.$(OBJEXT) \
140.1631 + 	pre_stage2_exec-common.$(OBJEXT) \
140.1632 + 	pre_stage2_exec-console.$(OBJEXT) \
140.1633 ++	pre_stage2_exec-dec_lzma.$(OBJEXT) \
140.1634 + 	pre_stage2_exec-disk_io.$(OBJEXT) \
140.1635 + 	pre_stage2_exec-fsys_ext2fs.$(OBJEXT) \
140.1636 + 	pre_stage2_exec-fsys_fat.$(OBJEXT) \
140.1637 +@@ -512,6 +513,7 @@
140.1638 + # The library for /sbin/grub.
140.1639 + noinst_LIBRARIES = libgrub.a
140.1640 + libgrub_a_SOURCES = boot.c builtins.c char_io.c cmdline.c common.c \
140.1641 ++	dec_lzma.c \
140.1642 + 	disk_io.c fsys_ext2fs.c fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c \
140.1643 + 	fsys_jfs.c fsys_minix.c fsys_reiserfs.c fsys_ufs2.c \
140.1644 + 	fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c md5.c serial.c stage2.c \
140.1645 +@@ -559,7 +563,7 @@
140.1646 + 
140.1647 + # For stage2 target.
140.1648 + pre_stage2_exec_SOURCES = asm.S bios.c boot.c builtins.c char_io.c \
140.1649 +-	cmdline.c common.c console.c disk_io.c fsys_ext2fs.c \
140.1650 ++	cmdline.c common.c console.c dec_lzma.c disk_io.c fsys_ext2fs.c \
140.1651 + 	fsys_fat.c fsys_ntfs.c fsys_ffs.c fsys_iso9660.c fsys_jfs.c fsys_minix.c \
140.1652 + 	fsys_reiserfs.c fsys_ufs2.c fsys_vstafs.c fsys_xfs.c fsys_pxe.c gunzip.c \
140.1653 + 	hercules.c md5.c serial.c smp-imps.c stage2.c terminfo.c tparm.c graphics.c
140.1654 +@@ -878,6 +882,7 @@
140.1655 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-cmdline.Po@am__quote@
140.1656 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-common.Po@am__quote@
140.1657 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-console.Po@am__quote@
140.1658 ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-dec_lzma.Po@am__quote@
140.1659 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-disk_io.Po@am__quote@
140.1660 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_ext2fs.Po@am__quote@
140.1661 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diskless_exec-fsys_fat.Po@am__quote@
140.1662 +@@ -935,6 +940,7 @@
140.1663 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-char_io.Po@am__quote@
140.1664 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-cmdline.Po@am__quote@
140.1665 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-common.Po@am__quote@
140.1666 ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-dec_lzma.Po@am__quote@
140.1667 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-disk_io.Po@am__quote@
140.1668 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_ext2fs.Po@am__quote@
140.1669 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libgrub_a-fsys_fat.Po@am__quote@
140.1670 +@@ -974,6 +980,7 @@
140.1671 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-cmdline.Po@am__quote@
140.1672 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-common.Po@am__quote@
140.1673 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-console.Po@am__quote@
140.1674 ++@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-dec_lzma.Po@am__quote@
140.1675 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-disk_io.Po@am__quote@
140.1676 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_ext2fs.Po@am__quote@
140.1677 + @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pre_stage2_exec-fsys_fat.Po@am__quote@
140.1678 +@@ -1315,6 +1322,20 @@
140.1679 + @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1680 + @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-common.obj `if test -f 'common.c'; then $(CYGPATH_W) 'common.c'; else $(CYGPATH_W) '$(srcdir)/common.c'; fi`
140.1681 + 
140.1682 ++libgrub_a-dec_lzma.o: dec_lzma.c
140.1683 ++@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.o -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \
140.1684 ++@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi
140.1685 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='libgrub_a-dec_lzma.o' libtool=no @AMDEPBACKSLASH@
140.1686 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1687 ++@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c
140.1688 ++
140.1689 ++libgrub_a-dec_lzma.obj: dec_lzma.c
140.1690 ++@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \
140.1691 ++@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo" "$(DEPDIR)/libgrub_a-dec_lzma.Po"; else rm -f "$(DEPDIR)/libgrub_a-dec_lzma.Tpo"; exit 1; fi
140.1692 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='libgrub_a-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@
140.1693 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1694 ++@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -c -o libgrub_a-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`
140.1695 ++
140.1696 + libgrub_a-disk_io.o: disk_io.c
140.1697 + @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libgrub_a_CFLAGS) $(CFLAGS) -MT libgrub_a-disk_io.o -MD -MP -MF "$(DEPDIR)/libgrub_a-disk_io.Tpo" -c -o libgrub_a-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \
140.1698 + @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/libgrub_a-disk_io.Tpo" "$(DEPDIR)/libgrub_a-disk_io.Po"; else rm -f "$(DEPDIR)/libgrub_a-disk_io.Tpo"; exit 1; fi
140.1699 +@@ -1693,6 +1714,20 @@
140.1700 + @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1701 + @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi`
140.1702 + 
140.1703 ++diskless_exec-dec_lzma.o: dec_lzma.c
140.1704 ++@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \
140.1705 ++@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi
140.1706 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='diskless_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@
140.1707 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1708 ++@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c
140.1709 ++
140.1710 ++diskless_exec-dec_lzma.obj: dec_lzma.c
140.1711 ++@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \
140.1712 ++@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo" "$(DEPDIR)/diskless_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/diskless_exec-dec_lzma.Tpo"; exit 1; fi
140.1713 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='diskless_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@
140.1714 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1715 ++@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -c -o diskless_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`
140.1716 ++
140.1717 + diskless_exec-disk_io.o: disk_io.c
140.1718 + @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(diskless_exec_CFLAGS) $(CFLAGS) -MT diskless_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/diskless_exec-disk_io.Tpo" -c -o diskless_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \
140.1719 + @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/diskless_exec-disk_io.Tpo" "$(DEPDIR)/diskless_exec-disk_io.Po"; else rm -f "$(DEPDIR)/diskless_exec-disk_io.Tpo"; exit 1; fi
140.1720 +@@ -2687,6 +2722,20 @@
140.1721 + @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1722 + @am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-console.obj `if test -f 'console.c'; then $(CYGPATH_W) 'console.c'; else $(CYGPATH_W) '$(srcdir)/console.c'; fi`
140.1723 + 
140.1724 ++pre_stage2_exec-dec_lzma.o: dec_lzma.c
140.1725 ++@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c; \
140.1726 ++@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi
140.1727 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.o' libtool=no @AMDEPBACKSLASH@
140.1728 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1729 ++@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.o `test -f 'dec_lzma.c' || echo '$(srcdir)/'`dec_lzma.c
140.1730 ++
140.1731 ++pre_stage2_exec-dec_lzma.obj: dec_lzma.c
140.1732 ++@am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-dec_lzma.obj -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`; \
140.1733 ++@am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo" "$(DEPDIR)/pre_stage2_exec-dec_lzma.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-dec_lzma.Tpo"; exit 1; fi
140.1734 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	source='dec_lzma.c' object='pre_stage2_exec-dec_lzma.obj' libtool=no @AMDEPBACKSLASH@
140.1735 ++@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
140.1736 ++@am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -c -o pre_stage2_exec-dec_lzma.obj `if test -f 'dec_lzma.c'; then $(CYGPATH_W) 'dec_lzma.c'; else $(CYGPATH_W) '$(srcdir)/dec_lzma.c'; fi`
140.1737 ++
140.1738 + pre_stage2_exec-disk_io.o: disk_io.c
140.1739 + @am__fastdepCC_TRUE@	if $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(pre_stage2_exec_CFLAGS) $(CFLAGS) -MT pre_stage2_exec-disk_io.o -MD -MP -MF "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" -c -o pre_stage2_exec-disk_io.o `test -f 'disk_io.c' || echo '$(srcdir)/'`disk_io.c; \
140.1740 + @am__fastdepCC_TRUE@	then mv -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo" "$(DEPDIR)/pre_stage2_exec-disk_io.Po"; else rm -f "$(DEPDIR)/pre_stage2_exec-disk_io.Tpo"; exit 1; fi
140.1741 +diff -Naur ../grub4dos-chenall-r63/stage2/shared.h ./stage2/shared.h
140.1742 +--- grub4dos-chenall-r63/stage2/shared.h	2010-11-17 15:33:51.826683000 +0700
140.1743 ++++ grub4dos/stage2/shared.h	2010-11-27 01:16:46.996893700 +0700
140.1744 +@@ -640,6 +640,7 @@
140.1745 +   ERR_WRITE_GZIP_FILE,
140.1746 +   ERR_FUNC_CALL,
140.1747 + //  ERR_WRITE_TO_NON_MEM_DRIVE,
140.1748 ++  ERR_NOT_ENOUGH_MEMORY,
140.1749 + 
140.1750 +   MAX_ERR_NUM
140.1751 + } grub_error_t;
140.1752 +@@ -1185,7 +1186,11 @@
140.1753 + #ifndef NO_DECOMPRESSION
140.1754 + /* Compression support. */
140.1755 + int gunzip_test_header (void);
140.1756 +-unsigned long gunzip_read (char *buf, unsigned long len);
140.1757 ++void gunzip_close (void);
140.1758 ++unsigned long gunzip_read (char *buf, unsigned long len, unsigned long write);
140.1759 ++int dec_lzma_open (void);
140.1760 ++void dec_lzma_close (void);
140.1761 ++unsigned long dec_lzma_read (char *buf, unsigned long len, unsigned long write);
140.1762 + #endif /* NO_DECOMPRESSION */
140.1763 + 
140.1764 + int rawread (unsigned long drive, unsigned long sector, unsigned long byte_offset, unsigned long byte_len, char *buf, unsigned long write);
   141.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   141.2 +++ b/grub4dos/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   141.3 @@ -0,0 +1,3 @@
   141.4 +-p1|dev_partition.diff
   141.5 +-p1|lzma.diff
   141.6 +-p1|xfs_freeze.diff
   142.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   142.2 +++ b/grub4dos/stuff/patches/xfs_freeze.diff	Thu May 10 21:12:00 2018 +0300
   142.3 @@ -0,0 +1,21 @@
   142.4 +diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in
   142.5 +--- grub-0.97.old/util/grub-install.in	2004-07-24 20:57:31.000000000 +0200
   142.6 ++++ grub-0.97/util/grub-install.in	2009-01-16 22:15:46.000000000 +0100
   142.7 +@@ -422,6 +422,17 @@
   142.8 + test -n "$mkimg" && img_file=`$mkimg`
   142.9 + test -n "$mklog" && log_file=`$mklog`
  142.10 + 
  142.11 ++# GRUB will try to verify that stage2 is accessible using its own
  142.12 ++# filesystem drivers.  Make sure it's committed to disk.
  142.13 ++sync
  142.14 ++
  142.15 ++# On XFS, sync() is not enough.
  142.16 ++if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then
  142.17 ++  xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir}
  142.18 ++  # We don't have set -e.  If xfs_freeze failed, it's worth trying anyway,
  142.19 ++  # maybe we're lucky.
  142.20 ++fi
  142.21 ++
  142.22 + for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
  142.23 +     count=5
  142.24 +     tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
   143.1 --- a/grub4dos/stuff/xfs_freeze.diff	Wed May 09 17:03:28 2018 +0300
   143.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   143.3 @@ -1,21 +0,0 @@
   143.4 -diff -ur grub-0.97.old/util/grub-install.in grub-0.97/util/grub-install.in
   143.5 ---- grub-0.97.old/util/grub-install.in	2004-07-24 20:57:31.000000000 +0200
   143.6 -+++ grub-0.97/util/grub-install.in	2009-01-16 22:15:46.000000000 +0100
   143.7 -@@ -422,6 +422,17 @@
   143.8 - test -n "$mkimg" && img_file=`$mkimg`
   143.9 - test -n "$mklog" && log_file=`$mklog`
  143.10 - 
  143.11 -+# GRUB will try to verify that stage2 is accessible using its own
  143.12 -+# filesystem drivers.  Make sure it's committed to disk.
  143.13 -+sync
  143.14 -+
  143.15 -+# On XFS, sync() is not enough.
  143.16 -+if [ `grub-probe -t fs ${grubdir}` = "xfs" ] ; then
  143.17 -+  xfs_freeze -f ${grubdir} && xfs_freeze -u ${grubdir}
  143.18 -+  # We don't have set -e.  If xfs_freeze failed, it's worth trying anyway,
  143.19 -+  # maybe we're lucky.
  143.20 -+fi
  143.21 -+
  143.22 - for file in ${grubdir}/stage1 ${grubdir}/stage2 ${grubdir}/*stage1_5; do
  143.23 -     count=5
  143.24 -     tmp=`echo $file | sed "s|^${grubdir}|${grub_prefix}|"`
   144.1 --- a/gtk-theme-albatross/receipt	Wed May 09 17:03:28 2018 +0300
   144.2 +++ b/gtk-theme-albatross/receipt	Thu May 10 21:12:00 2018 +0300
   144.3 @@ -12,8 +12,6 @@
   144.4  WGET_URL="https://github.com/shimmerproject/Albatross/archive/v$VERSION.tar.gz"
   144.5  
   144.6  compile_rules() {
   144.7 -	patch -p1 -i $stuff/define-sizes.patch
   144.8 -
   144.9  	T='/usr/share/themes/Albatross'
  144.10  	mkdir -p $install/$T
  144.11  	cp -a \
   145.1 --- a/gtk-theme-albatross/stuff/define-sizes.patch	Wed May 09 17:03:28 2018 +0300
   145.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   145.3 @@ -1,11 +0,0 @@
   145.4 ---- a/gtk-2.0/gtkrc
   145.5 -+++ b/gtk-2.0/gtkrc
   145.6 -@@ -5,7 +5,7 @@
   145.7 -           
   145.8 - gtk-color-scheme = "fg_color:#202020\nbg_color:#EDEDED\nbase_color:#fff\ntext_color:#444\nselected_bg_color:#A9B7C4\nselected_fg_color:#333333\ntooltip_bg_color:#D6DCE4\ntooltip_fg_color:#222222"
   145.9 - 
  145.10 --gtk-icon-sizes = "gtk-button = 16,16"
  145.11 -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  145.12 - 
  145.13 - style "default" {
  145.14 - 	xthickness = 1
   146.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   146.2 +++ b/gtk-theme-albatross/stuff/patches/define-sizes.patch	Thu May 10 21:12:00 2018 +0300
   146.3 @@ -0,0 +1,11 @@
   146.4 +--- a/gtk-2.0/gtkrc
   146.5 ++++ b/gtk-2.0/gtkrc
   146.6 +@@ -5,7 +5,7 @@
   146.7 +           
   146.8 + gtk-color-scheme = "fg_color:#202020\nbg_color:#EDEDED\nbase_color:#fff\ntext_color:#444\nselected_bg_color:#A9B7C4\nselected_fg_color:#333333\ntooltip_bg_color:#D6DCE4\ntooltip_fg_color:#222222"
   146.9 + 
  146.10 +-gtk-icon-sizes = "gtk-button = 16,16"
  146.11 ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  146.12 + 
  146.13 + style "default" {
  146.14 + 	xthickness = 1
   147.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   147.2 +++ b/gtk-theme-albatross/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   147.3 @@ -0,0 +1,1 @@
   147.4 +-p1|define-sizes.patch
   148.1 --- a/gtk-theme-bluebird/receipt	Wed May 09 17:03:28 2018 +0300
   148.2 +++ b/gtk-theme-bluebird/receipt	Thu May 10 21:12:00 2018 +0300
   148.3 @@ -12,7 +12,6 @@
   148.4  WGET_URL="https://github.com/shimmerproject/Bluebird/archive/v$VERSION.tar.gz"
   148.5  
   148.6  compile_rules() {
   148.7 -	patch -p1 -i $stuff/define-sizes.patch
   148.8  	dos2unix $src/gtk-2.0/bars.rc
   148.9  	dos2unix $src/gtk-2.0/gtkrc
  148.10  
   149.1 --- a/gtk-theme-bluebird/stuff/define-sizes.patch	Wed May 09 17:03:28 2018 +0300
   149.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   149.3 @@ -1,11 +0,0 @@
   149.4 ---- a/gtk-2.0/gtkrc
   149.5 -+++ b/gtk-2.0/gtkrc
   149.6 -@@ -17,7 +17,7 @@
   149.7 - include "bars.rc"        # Styles the menubar.
   149.8 - 
   149.9 - ### ICONS ###
  149.10 --gtk-icon-sizes = "gtk-button=16,16" # This makes button icons smaller.
  149.11 -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  149.12 - 
  149.13 - ### MISC ###
  149.14 - gtk-button-images	= 1 # Enables icons in buttons
   150.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   150.2 +++ b/gtk-theme-bluebird/stuff/patches/define-sizes.patch	Thu May 10 21:12:00 2018 +0300
   150.3 @@ -0,0 +1,11 @@
   150.4 +--- a/gtk-2.0/gtkrc
   150.5 ++++ b/gtk-2.0/gtkrc
   150.6 +@@ -17,7 +17,7 @@
   150.7 + include "bars.rc"        # Styles the menubar.
   150.8 + 
   150.9 + ### ICONS ###
  150.10 +-gtk-icon-sizes = "gtk-button=16,16" # This makes button icons smaller.
  150.11 ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  150.12 + 
  150.13 + ### MISC ###
  150.14 + gtk-button-images	= 1 # Enables icons in buttons
   151.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   151.2 +++ b/gtk-theme-bluebird/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   151.3 @@ -0,0 +1,1 @@
   151.4 +-p1|define-sizes.patch
   152.1 --- a/gtk-theme-greybird/receipt	Wed May 09 17:03:28 2018 +0300
   152.2 +++ b/gtk-theme-greybird/receipt	Thu May 10 21:12:00 2018 +0300
   152.3 @@ -12,8 +12,6 @@
   152.4  WGET_URL="https://github.com/shimmerproject/Greybird/archive/v$VERSION.tar.gz"
   152.5  
   152.6  compile_rules() {
   152.7 -	patch -p1 -i $stuff/define-sizes.patch
   152.8 -
   152.9  	T='/usr/share/themes/Greybird'
  152.10  	mkdir -p $install/$T
  152.11  	cp -a \
   153.1 --- a/gtk-theme-greybird/stuff/define-sizes.patch	Wed May 09 17:03:28 2018 +0300
   153.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   153.3 @@ -1,11 +0,0 @@
   153.4 ---- a/gtk-2.0/gtkrc
   153.5 -+++ b/gtk-2.0/gtkrc
   153.6 -@@ -11,7 +11,7 @@
   153.7 - gtk-color-scheme	= "fm_color:#F7F7F7" # Color used in Nautilus and Thunar.
   153.8 - gtk-color-scheme	= "bg_color_dark:#686868\ntext_color_dark:#FFF"
   153.9 - 
  153.10 --gtk-icon-sizes          = "panel-applications-menu=24,24:panel-menu=24,24:panel=16,16:gtk-button=16,16"
  153.11 -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  153.12 - gtk-button-images	= 1					# Disables icons for buttons with text
  153.13 - gtk-toolbar-style	= 0					# Disables text in toolbar
  153.14 - gtk-auto-mnemonics	= 1					# Disables ugly lines under menu items
   154.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   154.2 +++ b/gtk-theme-greybird/stuff/patches/define-sizes.patch	Thu May 10 21:12:00 2018 +0300
   154.3 @@ -0,0 +1,11 @@
   154.4 +--- a/gtk-2.0/gtkrc
   154.5 ++++ b/gtk-2.0/gtkrc
   154.6 +@@ -11,7 +11,7 @@
   154.7 + gtk-color-scheme	= "fm_color:#F7F7F7" # Color used in Nautilus and Thunar.
   154.8 + gtk-color-scheme	= "bg_color_dark:#686868\ntext_color_dark:#FFF"
   154.9 + 
  154.10 +-gtk-icon-sizes          = "panel-applications-menu=24,24:panel-menu=24,24:panel=16,16:gtk-button=16,16"
  154.11 ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  154.12 + gtk-button-images	= 1					# Disables icons for buttons with text
  154.13 + gtk-toolbar-style	= 0					# Disables text in toolbar
  154.14 + gtk-auto-mnemonics	= 1					# Disables ugly lines under menu items
   155.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   155.2 +++ b/gtk-theme-greybird/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   155.3 @@ -0,0 +1,1 @@
   155.4 +-p1|define-sizes.patch
   156.1 --- a/gtk-theme-orion/receipt	Wed May 09 17:03:28 2018 +0300
   156.2 +++ b/gtk-theme-orion/receipt	Thu May 10 21:12:00 2018 +0300
   156.3 @@ -12,8 +12,6 @@
   156.4  WGET_URL="https://github.com/shimmerproject/Orion/archive/v$VERSION.tar.gz"
   156.5  
   156.6  compile_rules() {
   156.7 -	patch -p1 -i $stuff/define-sizes.patch
   156.8 -
   156.9  	T='/usr/share/themes/Orion'
  156.10  	mkdir -p $install/$T
  156.11  	cp -a \
   157.1 --- a/gtk-theme-orion/stuff/define-sizes.patch	Wed May 09 17:03:28 2018 +0300
   157.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   157.3 @@ -1,10 +0,0 @@
   157.4 ---- a/gtk-2.0/gtkrc
   157.5 -+++ b/gtk-2.0/gtkrc
   157.6 -@@ -3,6 +3,7 @@
   157.7 - # License: GPL-3.0+
   157.8 - 
   157.9 - gtk-color-scheme = "base_color:#fff\nfg_color:#555\ntooltip_fg_color:#fff\nselected_bg_color:#569be4\nselected_fg_color:#fff\ntext_color:#333\nbg_color:#eee\ntooltip_bg_color:#000\nlink_color:#569be4"
  157.10 -+gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  157.11 - 
  157.12 - style "default" {
  157.13 - 	xthickness = 1
   158.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   158.2 +++ b/gtk-theme-orion/stuff/patches/define-sizes.patch	Thu May 10 21:12:00 2018 +0300
   158.3 @@ -0,0 +1,10 @@
   158.4 +--- a/gtk-2.0/gtkrc
   158.5 ++++ b/gtk-2.0/gtkrc
   158.6 +@@ -3,6 +3,7 @@
   158.7 + # License: GPL-3.0+
   158.8 + 
   158.9 + gtk-color-scheme = "base_color:#fff\nfg_color:#555\ntooltip_fg_color:#fff\nselected_bg_color:#569be4\nselected_fg_color:#fff\ntext_color:#333\nbg_color:#eee\ntooltip_bg_color:#000\nlink_color:#569be4"
  158.10 ++gtk-icon-sizes = "gtk-large-toolbar=24,24:gtk-small-toolbar=16,16:gtk-button=16,16:gtk-dialog=48,48:panel-menu=16,16:panel=16,16:gtk-menu=16,16:gtk-dnd=48,48"
  158.11 + 
  158.12 + style "default" {
  158.13 + 	xthickness = 1
   159.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   159.2 +++ b/gtk-theme-orion/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   159.3 @@ -0,0 +1,1 @@
   159.4 +-p1|define-sizes.patch
   160.1 --- a/gtkglext/receipt	Wed May 09 17:03:28 2018 +0300
   160.2 +++ b/gtkglext/receipt	Thu May 10 21:12:00 2018 +0300
   160.3 @@ -16,7 +16,6 @@
   160.4  SPLIT="gtkglext-dev"
   160.5  
   160.6  compile_rules() {
   160.7 -	patch -Np1 -i $stuff/gtk2.20.patch
   160.8  	autoconf --force
   160.9  	./configure $CONFIGURE_ARGS &&
  160.10  	fix libtool &&
   161.1 --- a/gtkglext/stuff/gtk2.20.patch	Wed May 09 17:03:28 2018 +0300
   161.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   161.3 @@ -1,77 +0,0 @@
   161.4 -diff -Nur gtkglext-1.2.0.orig/gtk/gtkglwidget.c gtkglext-1.2.0/gtk/gtkglwidget.c
   161.5 ---- gtkglext-1.2.0.orig/gtk/gtkglwidget.c	2004-02-20 11:38:36.000000000 +0200
   161.6 -+++ gtkglext-1.2.0/gtk/gtkglwidget.c	2010-04-20 19:29:42.941917275 +0300
   161.7 -@@ -127,7 +127,7 @@
   161.8 -    * Synchronize OpenGL and window resizing request streams.
   161.9 -    */
  161.10 - 
  161.11 --  if (GTK_WIDGET_REALIZED (widget) && private->is_realized)
  161.12 -+  if (gtk_widget_get_realized (widget) && private->is_realized)
  161.13 -     {
  161.14 -       gldrawable = gdk_window_get_gl_drawable (widget->window);
  161.15 -       gdk_gl_drawable_wait_gdk (gldrawable);
  161.16 -@@ -154,7 +154,7 @@
  161.17 -    * Remove OpenGL-capability from widget->window.
  161.18 -    */
  161.19 - 
  161.20 --  if (GTK_WIDGET_REALIZED (widget))
  161.21 -+  if (gtk_widget_get_realized (widget))
  161.22 -     gdk_window_unset_gl_capability (widget->window);
  161.23 - 
  161.24 -   private->is_realized = FALSE;
  161.25 -@@ -174,7 +174,7 @@
  161.26 -    */
  161.27 - 
  161.28 -   toplevel = gtk_widget_get_toplevel (widget);
  161.29 --  if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel))
  161.30 -+  if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel))
  161.31 -     {
  161.32 -       GTK_GL_NOTE (MISC,
  161.33 -         g_message (" - Install colormap to the top-level window."));
  161.34 -@@ -194,7 +194,7 @@
  161.35 -    * Set a background of "None" on window to avoid AIX X server crash.
  161.36 -    */
  161.37 - 
  161.38 --  if (GTK_WIDGET_REALIZED (widget))
  161.39 -+  if (gtk_widget_get_realized (widget))
  161.40 -     {
  161.41 -       GTK_GL_NOTE (MISC,
  161.42 -         g_message (" - window->bg_pixmap = %p",
  161.43 -@@ -250,8 +250,8 @@
  161.44 -   GTK_GL_NOTE_FUNC ();
  161.45 - 
  161.46 -   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
  161.47 --  g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE);
  161.48 --  g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE);
  161.49 -+  g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE);
  161.50 -+  g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE);
  161.51 -   g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE);
  161.52 - 
  161.53 -   /* 
  161.54 -@@ -432,7 +432,7 @@
  161.55 -   GTK_GL_NOTE_FUNC ();
  161.56 - 
  161.57 -   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  161.58 --  g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  161.59 -+  g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  161.60 - 
  161.61 -   gldrawable = gdk_window_get_gl_drawable (widget->window);
  161.62 -   if (gldrawable == NULL)
  161.63 -@@ -474,7 +474,7 @@
  161.64 -   GLWidgetPrivate *private;
  161.65 - 
  161.66 -   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  161.67 --  g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  161.68 -+  g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  161.69 - 
  161.70 -   private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private);
  161.71 -   if (private == NULL)
  161.72 -@@ -501,7 +501,7 @@
  161.73 - gtk_widget_get_gl_window (GtkWidget *widget)
  161.74 - {
  161.75 -   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  161.76 --  g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  161.77 -+  g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  161.78 - 
  161.79 -   return gdk_window_get_gl_window (widget->window);
  161.80 - }
   162.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   162.2 +++ b/gtkglext/stuff/patches/gtk2.20.patch	Thu May 10 21:12:00 2018 +0300
   162.3 @@ -0,0 +1,77 @@
   162.4 +diff -Nur gtkglext-1.2.0.orig/gtk/gtkglwidget.c gtkglext-1.2.0/gtk/gtkglwidget.c
   162.5 +--- gtkglext-1.2.0.orig/gtk/gtkglwidget.c	2004-02-20 11:38:36.000000000 +0200
   162.6 ++++ gtkglext-1.2.0/gtk/gtkglwidget.c	2010-04-20 19:29:42.941917275 +0300
   162.7 +@@ -127,7 +127,7 @@
   162.8 +    * Synchronize OpenGL and window resizing request streams.
   162.9 +    */
  162.10 + 
  162.11 +-  if (GTK_WIDGET_REALIZED (widget) && private->is_realized)
  162.12 ++  if (gtk_widget_get_realized (widget) && private->is_realized)
  162.13 +     {
  162.14 +       gldrawable = gdk_window_get_gl_drawable (widget->window);
  162.15 +       gdk_gl_drawable_wait_gdk (gldrawable);
  162.16 +@@ -154,7 +154,7 @@
  162.17 +    * Remove OpenGL-capability from widget->window.
  162.18 +    */
  162.19 + 
  162.20 +-  if (GTK_WIDGET_REALIZED (widget))
  162.21 ++  if (gtk_widget_get_realized (widget))
  162.22 +     gdk_window_unset_gl_capability (widget->window);
  162.23 + 
  162.24 +   private->is_realized = FALSE;
  162.25 +@@ -174,7 +174,7 @@
  162.26 +    */
  162.27 + 
  162.28 +   toplevel = gtk_widget_get_toplevel (widget);
  162.29 +-  if (GTK_WIDGET_TOPLEVEL (toplevel) && !GTK_WIDGET_REALIZED (toplevel))
  162.30 ++  if (gtk_widget_is_toplevel (toplevel) && !gtk_widget_get_realized (toplevel))
  162.31 +     {
  162.32 +       GTK_GL_NOTE (MISC,
  162.33 +         g_message (" - Install colormap to the top-level window."));
  162.34 +@@ -194,7 +194,7 @@
  162.35 +    * Set a background of "None" on window to avoid AIX X server crash.
  162.36 +    */
  162.37 + 
  162.38 +-  if (GTK_WIDGET_REALIZED (widget))
  162.39 ++  if (gtk_widget_get_realized (widget))
  162.40 +     {
  162.41 +       GTK_GL_NOTE (MISC,
  162.42 +         g_message (" - window->bg_pixmap = %p",
  162.43 +@@ -250,8 +250,8 @@
  162.44 +   GTK_GL_NOTE_FUNC ();
  162.45 + 
  162.46 +   g_return_val_if_fail (GTK_IS_WIDGET (widget), FALSE);
  162.47 +-  g_return_val_if_fail (!GTK_WIDGET_NO_WINDOW (widget), FALSE);
  162.48 +-  g_return_val_if_fail (!GTK_WIDGET_REALIZED (widget), FALSE);
  162.49 ++  g_return_val_if_fail (gtk_widget_get_has_window (widget), FALSE);
  162.50 ++  g_return_val_if_fail (!gtk_widget_get_realized (widget), FALSE);
  162.51 +   g_return_val_if_fail (GDK_IS_GL_CONFIG (glconfig), FALSE);
  162.52 + 
  162.53 +   /* 
  162.54 +@@ -432,7 +432,7 @@
  162.55 +   GTK_GL_NOTE_FUNC ();
  162.56 + 
  162.57 +   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  162.58 +-  g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  162.59 ++  g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  162.60 + 
  162.61 +   gldrawable = gdk_window_get_gl_drawable (widget->window);
  162.62 +   if (gldrawable == NULL)
  162.63 +@@ -474,7 +474,7 @@
  162.64 +   GLWidgetPrivate *private;
  162.65 + 
  162.66 +   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  162.67 +-  g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  162.68 ++  g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  162.69 + 
  162.70 +   private = g_object_get_qdata (G_OBJECT (widget), quark_gl_private);
  162.71 +   if (private == NULL)
  162.72 +@@ -501,7 +501,7 @@
  162.73 + gtk_widget_get_gl_window (GtkWidget *widget)
  162.74 + {
  162.75 +   g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
  162.76 +-  g_return_val_if_fail (GTK_WIDGET_REALIZED (widget), NULL);
  162.77 ++  g_return_val_if_fail (gtk_widget_get_realized (widget), NULL);
  162.78 + 
  162.79 +   return gdk_window_get_gl_window (widget->window);
  162.80 + }
   163.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   163.2 +++ b/gtkglext/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   163.3 @@ -0,0 +1,1 @@
   163.4 +gtk2.20.patch
   164.1 --- a/gxine/receipt	Wed May 09 17:03:28 2018 +0300
   164.2 +++ b/gxine/receipt	Thu May 10 21:12:00 2018 +0300
   164.3 @@ -20,9 +20,6 @@
   164.4  	sed -i "/<glib\//d" src/*
   164.5  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
   164.6  
   164.7 -	# Fix for lirc
   164.8 -	#patch -p0 < $stuff/gxine-0.5.907-lirc.patch || return 1
   164.9 -
  164.10  	#--with-logo-format=image
  164.11  	./configure \
  164.12  		--with-dbus \
   165.1 --- a/gxine/stuff/gxine-0.5.907-lirc.patch	Wed May 09 17:03:28 2018 +0300
   165.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   165.3 @@ -1,15 +0,0 @@
   165.4 ---- configure.lirc	2012-02-20 20:10:20.000000000 +0100
   165.5 -+++ configure	2012-02-22 14:11:53.873870212 +0100
   165.6 -@@ -18463,10 +18463,10 @@ fi
   165.7 - 
   165.8 -      if test "$found_lirc" = no -a x"$cross_compiling" != xyes; then
   165.9 -         if test x"$LIRC_PREFIX" != "x"; then
  165.10 --           lirc_libprefix="$LIRC_PREFIX/lib"
  165.11 -+           lirc_libprefix="$LIRC_PREFIX/$(libdir)"
  165.12 - 	   LIRC_INCLUDE="-I$LIRC_PREFIX/include"
  165.13 -         fi
  165.14 --        for llirc in $lirc_libprefix /lib /usr/lib /usr/local/lib; do
  165.15 -+        for llirc in $lirc_libprefix $(libdir); do
  165.16 -           as_ac_File=`$as_echo "ac_cv_file_"$llirc/liblirc_client.so"" | $as_tr_sh`
  165.17 - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"$llirc/liblirc_client.so\"" >&5
  165.18 - $as_echo_n "checking for \"$llirc/liblirc_client.so\"... " >&6; }
   166.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   166.2 +++ b/gxine/stuff/patches/gxine-0.5.907-lirc.patch	Thu May 10 21:12:00 2018 +0300
   166.3 @@ -0,0 +1,15 @@
   166.4 +--- configure.lirc	2012-02-20 20:10:20.000000000 +0100
   166.5 ++++ configure	2012-02-22 14:11:53.873870212 +0100
   166.6 +@@ -18463,10 +18463,10 @@ fi
   166.7 + 
   166.8 +      if test "$found_lirc" = no -a x"$cross_compiling" != xyes; then
   166.9 +         if test x"$LIRC_PREFIX" != "x"; then
  166.10 +-           lirc_libprefix="$LIRC_PREFIX/lib"
  166.11 ++           lirc_libprefix="$LIRC_PREFIX/$(libdir)"
  166.12 + 	   LIRC_INCLUDE="-I$LIRC_PREFIX/include"
  166.13 +         fi
  166.14 +-        for llirc in $lirc_libprefix /lib /usr/lib /usr/local/lib; do
  166.15 ++        for llirc in $lirc_libprefix $(libdir); do
  166.16 +           as_ac_File=`$as_echo "ac_cv_file_"$llirc/liblirc_client.so"" | $as_tr_sh`
  166.17 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for \"$llirc/liblirc_client.so\"" >&5
  166.18 + $as_echo_n "checking for \"$llirc/liblirc_client.so\"... " >&6; }
   167.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   167.2 +++ b/gxine/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   167.3 @@ -0,0 +1,2 @@
   167.4 +# Fix for lirc
   167.5 +#-p0|gxine-0.5.907-lirc.patch
   168.1 --- a/hal/receipt	Wed May 09 17:03:28 2018 +0300
   168.2 +++ b/hal/receipt	Thu May 10 21:12:00 2018 +0300
   168.3 @@ -22,8 +22,6 @@
   168.4  		hald/linux/probing/probe-video4linux.c
   168.5  	sed -i 's|glib/gmain|glib|' hald/linux/addons/addon-*.c
   168.6  	zcat /usr/share/misc/pci.ids.gz > /usr/share/misc/pci.ids
   168.7 -	patch -p1 < $stuff/hal-scripts.u || return 1
   168.8 -	#patch -p1 < $stuff/hal-udev.patch || return 1
   168.9  
  168.10  	grep -qs 'define u8' hald/linux/probing/linux_dvd_rw_utils.c ||
  168.11  	sed -i 's|#include <scsi/scsi.h>|#define u8 __u8\n&|' \
   169.1 --- a/hal/stuff/hal-scripts.u	Wed May 09 17:03:28 2018 +0300
   169.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   169.3 @@ -1,21 +0,0 @@
   169.4 ---- hal-0.5.13.ori/tools/linux/hal-system-power-reboot-linux	Sun Aug 10 15:50:10 2008
   169.5 -+++ hal-0.5.13/tools/linux/hal-system-power-reboot-linux	Thu Feb  4 23:41:04 2010
   169.6 -@@ -1,4 +1,6 @@
   169.7 - #!/bin/sh
   169.8 -+# 2010-02-04 erjo@slitaz.org
   169.9 -+# * Use reboot first for Busybox.
  169.10 - 
  169.11 - unsupported() {
  169.12 - 	echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
  169.13 -@@ -7,7 +9,10 @@
  169.14 - }
  169.15 - 
  169.16 - #Try for common tools
  169.17 --if [ -x "/sbin/shutdown" ] ; then
  169.18 -+if [ -x "/sbin/reboot" ] ; then
  169.19 -+	/sbin/reboot
  169.20 -+	exit $?
  169.21 -+elif [ -x "/sbin/shutdown" ] ; then
  169.22 - 	/sbin/shutdown -r now
  169.23 - 	exit $?
  169.24 - elif [ -x "/usr/sbin/shutdown" ] ; then
   170.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   170.2 +++ b/hal/stuff/patches/hal-scripts.u	Thu May 10 21:12:00 2018 +0300
   170.3 @@ -0,0 +1,21 @@
   170.4 +--- hal-0.5.13.ori/tools/linux/hal-system-power-reboot-linux	Sun Aug 10 15:50:10 2008
   170.5 ++++ hal-0.5.13/tools/linux/hal-system-power-reboot-linux	Thu Feb  4 23:41:04 2010
   170.6 +@@ -1,4 +1,6 @@
   170.7 + #!/bin/sh
   170.8 ++# 2010-02-04 erjo@slitaz.org
   170.9 ++# * Use reboot first for Busybox.
  170.10 + 
  170.11 + unsupported() {
  170.12 + 	echo "org.freedesktop.Hal.Device.SystemPowerManagement.NotSupported" >&2
  170.13 +@@ -7,7 +9,10 @@
  170.14 + }
  170.15 + 
  170.16 + #Try for common tools
  170.17 +-if [ -x "/sbin/shutdown" ] ; then
  170.18 ++if [ -x "/sbin/reboot" ] ; then
  170.19 ++	/sbin/reboot
  170.20 ++	exit $?
  170.21 ++elif [ -x "/sbin/shutdown" ] ; then
  170.22 + 	/sbin/shutdown -r now
  170.23 + 	exit $?
  170.24 + elif [ -x "/usr/sbin/shutdown" ] ; then
   171.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   171.2 +++ b/hal/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   171.3 @@ -0,0 +1,2 @@
   171.4 +-p1|hal-scripts.u
   171.5 +#-p1|hal-udev.patch
   172.1 --- a/hardinfo/receipt	Wed May 09 17:03:28 2018 +0300
   172.2 +++ b/hardinfo/receipt	Thu May 10 21:12:00 2018 +0300
   172.3 @@ -16,15 +16,6 @@
   172.4  # Rules to configure and make the package.
   172.5  compile_rules()
   172.6  {
   172.7 -	cd $src
   172.8 -	while read file; do
   172.9 -		[ -f done.$file ] && continue
  172.10 -		patch -p0 < $stuff/$file || return 1
  172.11 -		touch done.$file
  172.12 -	done <<EOT
  172.13 -languages.patch
  172.14 -os.patch
  172.15 -EOT
  172.16  	./configure \
  172.17  		--prefix=/usr \
  172.18  		$CONFIGURE_ARGS &&
   173.1 --- a/hardinfo/stuff/boots.patch	Wed May 09 17:03:28 2018 +0300
   173.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   173.3 @@ -1,74 +0,0 @@
   173.4 ---- arch/linux/common/boots.h	2008-04-26 10:38:31.000000000 +0200
   173.5 -+++ arch/linux/common/boots.h	2008-04-26 11:15:20.000000000 +0200
   173.6 -@@ -16,11 +16,19 @@
   173.7 -  *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
   173.8 -  */
   173.9 - 
  173.10 -+#include <sys/sysinfo.h>
  173.11 -+#include <sys/utsname.h>
  173.12 -+
  173.13 - void
  173.14 - scan_boots_real(void)
  173.15 - {
  173.16 --    FILE *last;
  173.17 --    char buffer[256];
  173.18 -+    FILE *dev;
  173.19 -+    char buffer[2048];
  173.20 -+    struct sysinfo info;
  173.21 -+    struct utsname uname_info;
  173.22 -+    time_t now;
  173.23 -+    char date[40];
  173.24 -+    int i;
  173.25 - 
  173.26 -     scan_os(FALSE);
  173.27 - 
  173.28 -@@ -29,33 +37,20 @@
  173.29 -     else
  173.30 -       return;
  173.31 -     
  173.32 --    last = popen("last", "r");
  173.33 --    if (last) {
  173.34 --      while (fgets(buffer, 256, last)) {
  173.35 --        if (strstr(buffer, "system boot")) {
  173.36 --          gchar **tmp, *buf = buffer;
  173.37 --          
  173.38 --          strend(buffer, '\n');
  173.39 --          
  173.40 --          while (*buf) {
  173.41 --            if (*buf == ' ' && *(buf + 1) == ' ') {
  173.42 --              strcpy(buf, buf + 1);
  173.43 --              
  173.44 --              buf--;
  173.45 --            } else {
  173.46 --              buf++;
  173.47 --            }
  173.48 --          }
  173.49 --
  173.50 --          tmp = g_strsplit(buffer, " ", 5);
  173.51 --          computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s",
  173.52 --                                                computer->os->boots,
  173.53 --                                                tmp[4],
  173.54 --                                                tmp[3]);
  173.55 --          g_strfreev(tmp);
  173.56 --        }
  173.57 --      }
  173.58 --      
  173.59 --      pclose(last);
  173.60 --    }
  173.61 -+    time(&now);
  173.62 -+    sysinfo(&info);
  173.63 -+    uname(&uname_info);
  173.64 -+    now -= info.uptime;
  173.65 -+    strcpy(date,ctime(&now));
  173.66 -+    for (i = 0; date[i] >= ' '; i++);
  173.67 -+    date[i] = 0;
  173.68 -+    computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s",
  173.69 -+		computer->os->boots, date, uname_info.release);
  173.70 -+    dev = fopen("/proc/cmdline", "r");
  173.71 -+    if (!dev)
  173.72 -+	return;
  173.73 -+    if (fgets(buffer, sizeof(buffer), dev)) 
  173.74 -+	computer->os->boots = h_strdup_cprintf("\nBoot options=%s",
  173.75 -+		computer->os->boots, buffer);
  173.76 -+    fclose(dev);
  173.77 - }
   174.1 --- a/hardinfo/stuff/languages.patch	Wed May 09 17:03:28 2018 +0300
   174.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   174.3 @@ -1,20 +0,0 @@
   174.4 ---- arch/common/languages.h	2008-04-26 10:04:42.000000000 +0200
   174.5 -+++ arch/common/languages.h	2008-04-26 10:51:31.000000000 +0200
   174.6 -@@ -21,6 +21,7 @@
   174.7 - {
   174.8 -     FILE *locale;
   174.9 -     gchar buf[512], *retval = NULL;
  174.10 -+    int last = 0;
  174.11 - 
  174.12 -     locale = popen("locale -va", "r");
  174.13 -     if (!locale)
  174.14 -@@ -37,7 +38,8 @@
  174.15 - 	  *date = NULL,
  174.16 - 	  *codeset = NULL;
  174.17 - 
  174.18 --    while (fgets(buf, 512, locale)) {
  174.19 -+    while (fgets(buf, 512, locale) || last++ == 0) {
  174.20 -+	if (last) buf[0] = 0;
  174.21 - 	if (!strncmp(buf, "locale:", 7)) {
  174.22 - 	    sscanf(buf, "locale: %s", name);
  174.23 -	    (void)fgets(buf, 128, locale);
   175.1 --- a/hardinfo/stuff/os.patch	Wed May 09 17:03:28 2018 +0300
   175.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   175.3 @@ -1,23 +0,0 @@
   175.4 ---- computer.h	2008-05-02 13:32:10.000000000 +0200
   175.5 -+++ computer.h	2008-05-02 13:34:31.000000000 +0200
   175.6 -@@ -23,6 +23,7 @@
   175.7 - static struct {
   175.8 -     gchar *file, *codename;
   175.9 - } distro_db[] = {
  175.10 -+    { DB_PREFIX "slitaz-release",	"slitaz" },
  175.11 -     { DB_PREFIX "debian_version",	"deb"  },
  175.12 -     { DB_PREFIX "slackware-version",	"slk"  },
  175.13 -     { DB_PREFIX "mandrake-release",	"mdk"  },
  175.14 ---- arch/linux/common/os.h	2008-05-02 13:43:33.000000000 +0200
  175.15 -+++ arch/linux/common/os.h	2008-05-02 13:44:49.000000000 +0200
  175.16 -@@ -215,6 +215,10 @@
  175.17 - 		    ((buf[0] >= '0' && buf[0] <= '9') || buf[0] != 'D')) {
  175.18 - 		    os->distro = g_strdup_printf
  175.19 - 			("Debian GNU/Linux %s", buf);
  175.20 -+		}
  175.21 -+		else if (!strncmp(distro_db[i].codename, "slitaz", 6)) {
  175.22 -+		    os->distro = g_strdup_printf
  175.23 -+			("Slitaz GNU/Linux %s", buf);
  175.24 - 		} else {
  175.25 - 		    os->distro = g_strdup(buf);
  175.26 - 		}
   176.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   176.2 +++ b/hardinfo/stuff/patches/boots.patch	Thu May 10 21:12:00 2018 +0300
   176.3 @@ -0,0 +1,74 @@
   176.4 +--- arch/linux/common/boots.h	2008-04-26 10:38:31.000000000 +0200
   176.5 ++++ arch/linux/common/boots.h	2008-04-26 11:15:20.000000000 +0200
   176.6 +@@ -16,11 +16,19 @@
   176.7 +  *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
   176.8 +  */
   176.9 + 
  176.10 ++#include <sys/sysinfo.h>
  176.11 ++#include <sys/utsname.h>
  176.12 ++
  176.13 + void
  176.14 + scan_boots_real(void)
  176.15 + {
  176.16 +-    FILE *last;
  176.17 +-    char buffer[256];
  176.18 ++    FILE *dev;
  176.19 ++    char buffer[2048];
  176.20 ++    struct sysinfo info;
  176.21 ++    struct utsname uname_info;
  176.22 ++    time_t now;
  176.23 ++    char date[40];
  176.24 ++    int i;
  176.25 + 
  176.26 +     scan_os(FALSE);
  176.27 + 
  176.28 +@@ -29,33 +37,20 @@
  176.29 +     else
  176.30 +       return;
  176.31 +     
  176.32 +-    last = popen("last", "r");
  176.33 +-    if (last) {
  176.34 +-      while (fgets(buffer, 256, last)) {
  176.35 +-        if (strstr(buffer, "system boot")) {
  176.36 +-          gchar **tmp, *buf = buffer;
  176.37 +-          
  176.38 +-          strend(buffer, '\n');
  176.39 +-          
  176.40 +-          while (*buf) {
  176.41 +-            if (*buf == ' ' && *(buf + 1) == ' ') {
  176.42 +-              strcpy(buf, buf + 1);
  176.43 +-              
  176.44 +-              buf--;
  176.45 +-            } else {
  176.46 +-              buf++;
  176.47 +-            }
  176.48 +-          }
  176.49 +-
  176.50 +-          tmp = g_strsplit(buffer, " ", 5);
  176.51 +-          computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s",
  176.52 +-                                                computer->os->boots,
  176.53 +-                                                tmp[4],
  176.54 +-                                                tmp[3]);
  176.55 +-          g_strfreev(tmp);
  176.56 +-        }
  176.57 +-      }
  176.58 +-      
  176.59 +-      pclose(last);
  176.60 +-    }
  176.61 ++    time(&now);
  176.62 ++    sysinfo(&info);
  176.63 ++    uname(&uname_info);
  176.64 ++    now -= info.uptime;
  176.65 ++    strcpy(date,ctime(&now));
  176.66 ++    for (i = 0; date[i] >= ' '; i++);
  176.67 ++    date[i] = 0;
  176.68 ++    computer->os->boots = h_strdup_cprintf("\n%s=Kernel %s",
  176.69 ++		computer->os->boots, date, uname_info.release);
  176.70 ++    dev = fopen("/proc/cmdline", "r");
  176.71 ++    if (!dev)
  176.72 ++	return;
  176.73 ++    if (fgets(buffer, sizeof(buffer), dev)) 
  176.74 ++	computer->os->boots = h_strdup_cprintf("\nBoot options=%s",
  176.75 ++		computer->os->boots, buffer);
  176.76 ++    fclose(dev);
  176.77 + }
   177.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   177.2 +++ b/hardinfo/stuff/patches/languages.patch	Thu May 10 21:12:00 2018 +0300
   177.3 @@ -0,0 +1,20 @@
   177.4 +--- arch/common/languages.h	2008-04-26 10:04:42.000000000 +0200
   177.5 ++++ arch/common/languages.h	2008-04-26 10:51:31.000000000 +0200
   177.6 +@@ -21,6 +21,7 @@
   177.7 + {
   177.8 +     FILE *locale;
   177.9 +     gchar buf[512], *retval = NULL;
  177.10 ++    int last = 0;
  177.11 + 
  177.12 +     locale = popen("locale -va", "r");
  177.13 +     if (!locale)
  177.14 +@@ -37,7 +38,8 @@
  177.15 + 	  *date = NULL,
  177.16 + 	  *codeset = NULL;
  177.17 + 
  177.18 +-    while (fgets(buf, 512, locale)) {
  177.19 ++    while (fgets(buf, 512, locale) || last++ == 0) {
  177.20 ++	if (last) buf[0] = 0;
  177.21 + 	if (!strncmp(buf, "locale:", 7)) {
  177.22 + 	    sscanf(buf, "locale: %s", name);
  177.23 +	    (void)fgets(buf, 128, locale);
   178.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   178.2 +++ b/hardinfo/stuff/patches/os.patch	Thu May 10 21:12:00 2018 +0300
   178.3 @@ -0,0 +1,23 @@
   178.4 +--- computer.h	2008-05-02 13:32:10.000000000 +0200
   178.5 ++++ computer.h	2008-05-02 13:34:31.000000000 +0200
   178.6 +@@ -23,6 +23,7 @@
   178.7 + static struct {
   178.8 +     gchar *file, *codename;
   178.9 + } distro_db[] = {
  178.10 ++    { DB_PREFIX "slitaz-release",	"slitaz" },
  178.11 +     { DB_PREFIX "debian_version",	"deb"  },
  178.12 +     { DB_PREFIX "slackware-version",	"slk"  },
  178.13 +     { DB_PREFIX "mandrake-release",	"mdk"  },
  178.14 +--- arch/linux/common/os.h	2008-05-02 13:43:33.000000000 +0200
  178.15 ++++ arch/linux/common/os.h	2008-05-02 13:44:49.000000000 +0200
  178.16 +@@ -215,6 +215,10 @@
  178.17 + 		    ((buf[0] >= '0' && buf[0] <= '9') || buf[0] != 'D')) {
  178.18 + 		    os->distro = g_strdup_printf
  178.19 + 			("Debian GNU/Linux %s", buf);
  178.20 ++		}
  178.21 ++		else if (!strncmp(distro_db[i].codename, "slitaz", 6)) {
  178.22 ++		    os->distro = g_strdup_printf
  178.23 ++			("Slitaz GNU/Linux %s", buf);
  178.24 + 		} else {
  178.25 + 		    os->distro = g_strdup(buf);
  178.26 + 		}
   179.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   179.2 +++ b/hardinfo/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   179.3 @@ -0,0 +1,2 @@
   179.4 +-p0|languages.patch
   179.5 +-p0|os.patch
   180.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   180.2 +++ b/hardinfo/stuff/patches/usb.patch	Thu May 10 21:12:00 2018 +0300
   180.3 @@ -0,0 +1,316 @@
   180.4 +--- util.c
   180.5 ++++ util.c
   180.6 +@@ -1048,3 +1048,55 @@
   180.7 + 				h_hash_table_remove_all_true,
   180.8 + 				NULL);
   180.9 + }
  180.10 ++
  180.11 ++gfloat
  180.12 ++h_sysfs_read_float(gchar *endpoint, gchar *entry)
  180.13 ++{
  180.14 ++	gchar *tmp, *buffer;
  180.15 ++	gfloat return_value = 0.0f;
  180.16 ++	
  180.17 ++	tmp = g_build_filename(endpoint, entry, NULL);
  180.18 ++	if (g_file_get_contents(tmp, &buffer, NULL, NULL))
  180.19 ++		return_value = atof(buffer);
  180.20 ++	
  180.21 ++	g_free(tmp);
  180.22 ++	g_free(buffer);
  180.23 ++	
  180.24 ++	return return_value;
  180.25 ++}
  180.26 ++
  180.27 ++gint
  180.28 ++h_sysfs_read_int(gchar *endpoint, gchar *entry)
  180.29 ++{
  180.30 ++	gchar *tmp, *buffer;
  180.31 ++	gint return_value = 0.0f;
  180.32 ++	
  180.33 ++	tmp = g_build_filename(endpoint, entry, NULL);
  180.34 ++	if (g_file_get_contents(tmp, &buffer, NULL, NULL))
  180.35 ++		return_value = atoi(buffer);
  180.36 ++	
  180.37 ++	g_free(tmp);
  180.38 ++	g_free(buffer);
  180.39 ++	
  180.40 ++	return return_value;
  180.41 ++}
  180.42 ++
  180.43 ++gchar *
  180.44 ++h_sysfs_read_string(gchar *endpoint, gchar *entry)
  180.45 ++{
  180.46 ++	gchar *tmp, *return_value;
  180.47 ++	
  180.48 ++	tmp = g_build_filename(endpoint, entry, NULL);
  180.49 ++	if (!g_file_get_contents(tmp, &return_value, NULL, NULL)) {
  180.50 ++		g_free(return_value);
  180.51 ++		
  180.52 ++		return_value = NULL;
  180.53 ++	} else {
  180.54 ++		return_value = g_strstrip(return_value);
  180.55 ++	}
  180.56 ++	
  180.57 ++	g_free(tmp);
  180.58 ++	
  180.59 ++	return return_value;
  180.60 ++}
  180.61 ++
  180.62 +
  180.63 +--- arch/linux/common/usb.h
  180.64 ++++ arch/linux/common/usb.h
  180.65 +@@ -15,7 +15,6 @@
  180.66 +  *    along with this program; if not, write to the Free Software
  180.67 +  *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  180.68 +  */
  180.69 +-
  180.70 + static gboolean
  180.71 + remove_usb_devices(gpointer key, gpointer value, gpointer data)
  180.72 + {
  180.73 +@@ -23,8 +22,113 @@
  180.74 + }
  180.75 + 
  180.76 + static gchar *usb_list = NULL;
  180.77 +-void
  180.78 +-__scan_usb(void)
  180.79 ++
  180.80 ++void __scan_usb_sysfs_add_device(gchar * endpoint, int n)
  180.81 ++{
  180.82 ++    gchar *manufacturer, *product, *mxpwr, *tmp, *strhash;
  180.83 ++    gint bus, classid, vendor, prodid;
  180.84 ++    gchar *version, *speed;
  180.85 ++
  180.86 ++    classid = h_sysfs_read_int(endpoint, "bDeviceClass");
  180.87 ++    vendor = h_sysfs_read_int(endpoint, "idVendor");
  180.88 ++    prodid = h_sysfs_read_int(endpoint, "idProduct");
  180.89 ++    bus = h_sysfs_read_int(endpoint, "busnum");
  180.90 ++    if (!(speed = h_sysfs_read_string(endpoint, "speed"))) {
  180.91 ++	speed = g_strdup("12");
  180.92 ++    }
  180.93 ++
  180.94 ++    if (!(version = h_sysfs_read_string(endpoint, "version"))) {
  180.95 ++	version = g_strdup(" 1.0 ");
  180.96 ++    }
  180.97 ++    
  180.98 ++    if (!(mxpwr = h_sysfs_read_string(endpoint, "bMaxPower"))) {
  180.99 ++    	mxpwr = g_strdup("0 mA");
 180.100 ++    }
 180.101 ++
 180.102 ++    if (!(manufacturer = h_sysfs_read_string(endpoint, "manufacturer"))) {
 180.103 ++    	manufacturer = g_strdup("Unknown");
 180.104 ++    }
 180.105 ++
 180.106 ++    if (!(product = h_sysfs_read_string(endpoint, "product"))) {
 180.107 ++	if (classid == 9) {
 180.108 ++	    product = g_strdup_printf("USB %.2f Hub", version);
 180.109 ++	} else {
 180.110 ++	    product = g_strdup_printf("Unknown USB %.2f Device (class %d)", version, classid);
 180.111 ++	}
 180.112 ++    }
 180.113 ++
 180.114 ++    const gchar *url = vendor_get_url(manufacturer);
 180.115 ++    if (url) {
 180.116 ++	tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url);
 180.117 ++	
 180.118 ++	g_free(manufacturer);
 180.119 ++	manufacturer = tmp;	    
 180.120 ++    }
 180.121 ++
 180.122 ++    tmp = g_strdup_printf("USB%d", n);
 180.123 ++    usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product);
 180.124 ++
 180.125 ++    strhash = g_strdup_printf("[Device Information]\n"
 180.126 ++			      "Product=%s\n"
 180.127 ++			      "Manufacturer=%s\n"
 180.128 ++			      "Speed=%sMbit/s\n"
 180.129 ++			      "Max Current=%s\n"
 180.130 ++			      "[Misc]\n"
 180.131 ++			      "USB Version=%s\n"
 180.132 ++			      "Class=0x%x\n"
 180.133 ++			      "Vendor=0x%x\n"
 180.134 ++			      "Product ID=0x%x\n"
 180.135 ++			      "Bus=%d\n",
 180.136 ++			      product,
 180.137 ++			      manufacturer,
 180.138 ++			      speed,
 180.139 ++			      mxpwr,
 180.140 ++			      version, classid, vendor, prodid, bus);
 180.141 ++
 180.142 ++    g_hash_table_insert(moreinfo, tmp, strhash);
 180.143 ++    
 180.144 ++    g_free(manufacturer);
 180.145 ++    g_free(product);
 180.146 ++    g_free(mxpwr);
 180.147 ++    g_free(speed);
 180.148 ++    g_free(version);
 180.149 ++}
 180.150 ++
 180.151 ++void __scan_usb_sysfs(void)
 180.152 ++{
 180.153 ++    GDir *sysfs;
 180.154 ++    gchar *filename;
 180.155 ++    const gchar *sysfs_path = "/sys/class/usb_endpoint";
 180.156 ++    gint usb_device_number = 0;
 180.157 ++
 180.158 ++    if (!(sysfs = g_dir_open(sysfs_path, 0, NULL))) {
 180.159 ++	return;
 180.160 ++    }
 180.161 ++
 180.162 ++    if (usb_list) {
 180.163 ++	g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL);
 180.164 ++	g_free(usb_list);
 180.165 ++    }
 180.166 ++    usb_list = g_strdup("[USB Devices]\n");
 180.167 ++
 180.168 ++    while ((filename = (gchar *) g_dir_read_name(sysfs))) {
 180.169 ++	gchar *endpoint =
 180.170 ++	    g_build_filename(sysfs_path, filename, "device", NULL);
 180.171 ++	gchar *temp;
 180.172 ++
 180.173 ++	temp = g_build_filename(endpoint, "idVendor", NULL);
 180.174 ++	if (g_file_test(temp, G_FILE_TEST_EXISTS)) {
 180.175 ++	    __scan_usb_sysfs_add_device(endpoint, ++usb_device_number);
 180.176 ++	}
 180.177 ++
 180.178 ++	g_free(temp);
 180.179 ++	g_free(endpoint);
 180.180 ++    }
 180.181 ++
 180.182 ++    g_dir_close(sysfs);
 180.183 ++}
 180.184 ++
 180.185 ++int __scan_usb_procfs(void)
 180.186 + {
 180.187 +     FILE *dev;
 180.188 +     gchar buffer[128];
 180.189 +@@ -36,13 +140,13 @@
 180.190 + 
 180.191 +     dev = fopen("/proc/bus/usb/devices", "r");
 180.192 +     if (!dev)
 180.193 +-	return;
 180.194 ++	return 0;
 180.195 + 
 180.196 +     if (usb_list) {
 180.197 + 	g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL);
 180.198 + 	g_free(usb_list);
 180.199 +     }
 180.200 +-    usb_list = g_strdup("");
 180.201 ++    usb_list = g_strdup("[USB Devices]\n");
 180.202 + 
 180.203 +     while (fgets(buffer, 128, dev)) {
 180.204 + 	tmp = buffer;
 180.205 +@@ -73,52 +177,60 @@
 180.206 + 	    mxpwr = strstr(buffer, "MxPwr=") + 6;
 180.207 + 
 180.208 + 	    tmp = g_strdup_printf("USB%d", ++n);
 180.209 +-	    
 180.210 ++
 180.211 + 	    if (*product == '\0') {
 180.212 +-	        g_free(product);
 180.213 +-	        if (classid == 9) {
 180.214 +-                    product = g_strdup_printf("USB %.2f Hub", ver);
 180.215 +-                } else {
 180.216 +-  	            product = g_strdup_printf("Unknown USB %.2f Device (class %d)",
 180.217 +-                                              ver, classid);
 180.218 +-                }
 180.219 ++		g_free(product);
 180.220 ++		if (classid == 9) {
 180.221 ++		    product = g_strdup_printf("USB %.2f Hub", ver);
 180.222 ++		} else {
 180.223 ++		    product =
 180.224 ++			g_strdup_printf
 180.225 ++			("Unknown USB %.2f Device (class %d)", ver,
 180.226 ++			 classid);
 180.227 ++		}
 180.228 + 	    }
 180.229 +-	    
 180.230 ++
 180.231 + 
 180.232 + 	    if (classid == 9) {	/* hub */
 180.233 +-    	        usb_list = h_strdup_cprintf("[%s#%d]\n",
 180.234 +-		      		           usb_list, product, n);
 180.235 +-            } else { /* everything else */
 180.236 +-    	        usb_list = h_strdup_cprintf("$%s$%s=\n",
 180.237 +-		      		           usb_list, tmp, product);
 180.238 +-
 180.239 +-                const gchar *url = vendor_get_url(manuf);
 180.240 +-                if (url) {
 180.241 +-                    gchar *tmp = g_strdup_printf("%s (%s)", manuf, url);
 180.242 +-                    g_free(manuf);
 180.243 +-                    manuf = tmp;
 180.244 +-                }
 180.245 +-
 180.246 +-                gchar *strhash = g_strdup_printf("[Device Information]\n"
 180.247 +-                                                 "Product=%s\n"
 180.248 +-                                                 "Manufacturer=%s\n"
 180.249 +-                                                 "[Port #%d]\n"
 180.250 +-                                                 "Speed=%.2fMbit/s\n"
 180.251 +-                                                 "Max Current=%s\n"
 180.252 +-                                                 "[Misc]\n"
 180.253 +-                                                 "USB Version=%.2f\n"
 180.254 +-                                                 "Revision=%.2f\n"
 180.255 +-                                                 "Class=0x%x\n"
 180.256 +-                                                 "Vendor=0x%x\n"
 180.257 +-                                                 "Product ID=0x%x\n"
 180.258 +-                                                 "Bus=%d\n" "Level=%d\n",
 180.259 +-                                                 product, manuf,
 180.260 +-                                                 port, speed, mxpwr,
 180.261 +-                                                 ver, rev, classid,
 180.262 +-                                                 vendor, prodid, bus, level);
 180.263 ++		usb_list = h_strdup_cprintf("[%s#%d]\n",
 180.264 ++					    usb_list, product, n);
 180.265 ++	    } else {		/* everything else */
 180.266 ++		usb_list = h_strdup_cprintf("$%s$%s=\n",
 180.267 ++					    usb_list, tmp, product);
 180.268 ++
 180.269 ++		const gchar *url = vendor_get_url(manuf);
 180.270 ++		if (url) {
 180.271 ++		    gchar *tmp =
 180.272 ++			g_strdup_printf("%s (%s)", vendor_get_name(manuf),
 180.273 ++					url);
 180.274 ++		    g_free(manuf);
 180.275 ++		    manuf = tmp;
 180.276 ++		}
 180.277 ++
 180.278 ++		gchar *strhash = g_strdup_printf("[Device Information]\n"
 180.279 ++						 "Product=%s\n",
 180.280 ++						 product);
 180.281 ++		if (manuf && strlen(manuf))
 180.282 ++		    strhash = h_strdup_cprintf("Manufacturer=%s\n",
 180.283 ++					       strhash, manuf);
 180.284 ++
 180.285 ++		strhash = h_strdup_cprintf("[Port #%d]\n"
 180.286 ++					   "Speed=%.2fMbit/s\n"
 180.287 ++					   "Max Current=%s\n"
 180.288 ++					   "[Misc]\n"
 180.289 ++					   "USB Version=%.2f\n"
 180.290 ++					   "Revision=%.2f\n"
 180.291 ++					   "Class=0x%x\n"
 180.292 ++					   "Vendor=0x%x\n"
 180.293 ++					   "Product ID=0x%x\n"
 180.294 ++					   "Bus=%d\n" "Level=%d\n",
 180.295 ++					   strhash,
 180.296 ++					   port, speed, mxpwr,
 180.297 ++					   ver, rev, classid,
 180.298 ++					   vendor, prodid, bus, level);
 180.299 + 
 180.300 +-                g_hash_table_insert(moreinfo, tmp, strhash);
 180.301 +-            }
 180.302 ++		g_hash_table_insert(moreinfo, tmp, strhash);
 180.303 ++	    }
 180.304 + 
 180.305 + 	    g_free(manuf);
 180.306 + 	    g_free(product);
 180.307 +@@ -128,4 +240,12 @@
 180.308 +     }
 180.309 + 
 180.310 +     fclose(dev);
 180.311 ++
 180.312 ++    return n;
 180.313 ++}
 180.314 ++
 180.315 ++void __scan_usb(void)
 180.316 ++{
 180.317 ++    if (!__scan_usb_procfs())
 180.318 ++	__scan_usb_sysfs();
 180.319 + }
   181.1 --- a/hardinfo/stuff/usb.patch	Wed May 09 17:03:28 2018 +0300
   181.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   181.3 @@ -1,316 +0,0 @@
   181.4 ---- util.c
   181.5 -+++ util.c
   181.6 -@@ -1048,3 +1048,55 @@
   181.7 - 				h_hash_table_remove_all_true,
   181.8 - 				NULL);
   181.9 - }
  181.10 -+
  181.11 -+gfloat
  181.12 -+h_sysfs_read_float(gchar *endpoint, gchar *entry)
  181.13 -+{
  181.14 -+	gchar *tmp, *buffer;
  181.15 -+	gfloat return_value = 0.0f;
  181.16 -+	
  181.17 -+	tmp = g_build_filename(endpoint, entry, NULL);
  181.18 -+	if (g_file_get_contents(tmp, &buffer, NULL, NULL))
  181.19 -+		return_value = atof(buffer);
  181.20 -+	
  181.21 -+	g_free(tmp);
  181.22 -+	g_free(buffer);
  181.23 -+	
  181.24 -+	return return_value;
  181.25 -+}
  181.26 -+
  181.27 -+gint
  181.28 -+h_sysfs_read_int(gchar *endpoint, gchar *entry)
  181.29 -+{
  181.30 -+	gchar *tmp, *buffer;
  181.31 -+	gint return_value = 0.0f;
  181.32 -+	
  181.33 -+	tmp = g_build_filename(endpoint, entry, NULL);
  181.34 -+	if (g_file_get_contents(tmp, &buffer, NULL, NULL))
  181.35 -+		return_value = atoi(buffer);
  181.36 -+	
  181.37 -+	g_free(tmp);
  181.38 -+	g_free(buffer);
  181.39 -+	
  181.40 -+	return return_value;
  181.41 -+}
  181.42 -+
  181.43 -+gchar *
  181.44 -+h_sysfs_read_string(gchar *endpoint, gchar *entry)
  181.45 -+{
  181.46 -+	gchar *tmp, *return_value;
  181.47 -+	
  181.48 -+	tmp = g_build_filename(endpoint, entry, NULL);
  181.49 -+	if (!g_file_get_contents(tmp, &return_value, NULL, NULL)) {
  181.50 -+		g_free(return_value);
  181.51 -+		
  181.52 -+		return_value = NULL;
  181.53 -+	} else {
  181.54 -+		return_value = g_strstrip(return_value);
  181.55 -+	}
  181.56 -+	
  181.57 -+	g_free(tmp);
  181.58 -+	
  181.59 -+	return return_value;
  181.60 -+}
  181.61 -+
  181.62 -
  181.63 ---- arch/linux/common/usb.h
  181.64 -+++ arch/linux/common/usb.h
  181.65 -@@ -15,7 +15,6 @@
  181.66 -  *    along with this program; if not, write to the Free Software
  181.67 -  *    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  181.68 -  */
  181.69 --
  181.70 - static gboolean
  181.71 - remove_usb_devices(gpointer key, gpointer value, gpointer data)
  181.72 - {
  181.73 -@@ -23,8 +22,113 @@
  181.74 - }
  181.75 - 
  181.76 - static gchar *usb_list = NULL;
  181.77 --void
  181.78 --__scan_usb(void)
  181.79 -+
  181.80 -+void __scan_usb_sysfs_add_device(gchar * endpoint, int n)
  181.81 -+{
  181.82 -+    gchar *manufacturer, *product, *mxpwr, *tmp, *strhash;
  181.83 -+    gint bus, classid, vendor, prodid;
  181.84 -+    gchar *version, *speed;
  181.85 -+
  181.86 -+    classid = h_sysfs_read_int(endpoint, "bDeviceClass");
  181.87 -+    vendor = h_sysfs_read_int(endpoint, "idVendor");
  181.88 -+    prodid = h_sysfs_read_int(endpoint, "idProduct");
  181.89 -+    bus = h_sysfs_read_int(endpoint, "busnum");
  181.90 -+    if (!(speed = h_sysfs_read_string(endpoint, "speed"))) {
  181.91 -+	speed = g_strdup("12");
  181.92 -+    }
  181.93 -+
  181.94 -+    if (!(version = h_sysfs_read_string(endpoint, "version"))) {
  181.95 -+	version = g_strdup(" 1.0 ");
  181.96 -+    }
  181.97 -+    
  181.98 -+    if (!(mxpwr = h_sysfs_read_string(endpoint, "bMaxPower"))) {
  181.99 -+    	mxpwr = g_strdup("0 mA");
 181.100 -+    }
 181.101 -+
 181.102 -+    if (!(manufacturer = h_sysfs_read_string(endpoint, "manufacturer"))) {
 181.103 -+    	manufacturer = g_strdup("Unknown");
 181.104 -+    }
 181.105 -+
 181.106 -+    if (!(product = h_sysfs_read_string(endpoint, "product"))) {
 181.107 -+	if (classid == 9) {
 181.108 -+	    product = g_strdup_printf("USB %.2f Hub", version);
 181.109 -+	} else {
 181.110 -+	    product = g_strdup_printf("Unknown USB %.2f Device (class %d)", version, classid);
 181.111 -+	}
 181.112 -+    }
 181.113 -+
 181.114 -+    const gchar *url = vendor_get_url(manufacturer);
 181.115 -+    if (url) {
 181.116 -+	tmp = g_strdup_printf("%s (%s)", vendor_get_name(manufacturer), url);
 181.117 -+	
 181.118 -+	g_free(manufacturer);
 181.119 -+	manufacturer = tmp;	    
 181.120 -+    }
 181.121 -+
 181.122 -+    tmp = g_strdup_printf("USB%d", n);
 181.123 -+    usb_list = h_strdup_cprintf("$%s$%s=\n", usb_list, tmp, product);
 181.124 -+
 181.125 -+    strhash = g_strdup_printf("[Device Information]\n"
 181.126 -+			      "Product=%s\n"
 181.127 -+			      "Manufacturer=%s\n"
 181.128 -+			      "Speed=%sMbit/s\n"
 181.129 -+			      "Max Current=%s\n"
 181.130 -+			      "[Misc]\n"
 181.131 -+			      "USB Version=%s\n"
 181.132 -+			      "Class=0x%x\n"
 181.133 -+			      "Vendor=0x%x\n"
 181.134 -+			      "Product ID=0x%x\n"
 181.135 -+			      "Bus=%d\n",
 181.136 -+			      product,
 181.137 -+			      manufacturer,
 181.138 -+			      speed,
 181.139 -+			      mxpwr,
 181.140 -+			      version, classid, vendor, prodid, bus);
 181.141 -+
 181.142 -+    g_hash_table_insert(moreinfo, tmp, strhash);
 181.143 -+    
 181.144 -+    g_free(manufacturer);
 181.145 -+    g_free(product);
 181.146 -+    g_free(mxpwr);
 181.147 -+    g_free(speed);
 181.148 -+    g_free(version);
 181.149 -+}
 181.150 -+
 181.151 -+void __scan_usb_sysfs(void)
 181.152 -+{
 181.153 -+    GDir *sysfs;
 181.154 -+    gchar *filename;
 181.155 -+    const gchar *sysfs_path = "/sys/class/usb_endpoint";
 181.156 -+    gint usb_device_number = 0;
 181.157 -+
 181.158 -+    if (!(sysfs = g_dir_open(sysfs_path, 0, NULL))) {
 181.159 -+	return;
 181.160 -+    }
 181.161 -+
 181.162 -+    if (usb_list) {
 181.163 -+	g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL);
 181.164 -+	g_free(usb_list);
 181.165 -+    }
 181.166 -+    usb_list = g_strdup("[USB Devices]\n");
 181.167 -+
 181.168 -+    while ((filename = (gchar *) g_dir_read_name(sysfs))) {
 181.169 -+	gchar *endpoint =
 181.170 -+	    g_build_filename(sysfs_path, filename, "device", NULL);
 181.171 -+	gchar *temp;
 181.172 -+
 181.173 -+	temp = g_build_filename(endpoint, "idVendor", NULL);
 181.174 -+	if (g_file_test(temp, G_FILE_TEST_EXISTS)) {
 181.175 -+	    __scan_usb_sysfs_add_device(endpoint, ++usb_device_number);
 181.176 -+	}
 181.177 -+
 181.178 -+	g_free(temp);
 181.179 -+	g_free(endpoint);
 181.180 -+    }
 181.181 -+
 181.182 -+    g_dir_close(sysfs);
 181.183 -+}
 181.184 -+
 181.185 -+int __scan_usb_procfs(void)
 181.186 - {
 181.187 -     FILE *dev;
 181.188 -     gchar buffer[128];
 181.189 -@@ -36,13 +140,13 @@
 181.190 - 
 181.191 -     dev = fopen("/proc/bus/usb/devices", "r");
 181.192 -     if (!dev)
 181.193 --	return;
 181.194 -+	return 0;
 181.195 - 
 181.196 -     if (usb_list) {
 181.197 - 	g_hash_table_foreach_remove(moreinfo, remove_usb_devices, NULL);
 181.198 - 	g_free(usb_list);
 181.199 -     }
 181.200 --    usb_list = g_strdup("");
 181.201 -+    usb_list = g_strdup("[USB Devices]\n");
 181.202 - 
 181.203 -     while (fgets(buffer, 128, dev)) {
 181.204 - 	tmp = buffer;
 181.205 -@@ -73,52 +177,60 @@
 181.206 - 	    mxpwr = strstr(buffer, "MxPwr=") + 6;
 181.207 - 
 181.208 - 	    tmp = g_strdup_printf("USB%d", ++n);
 181.209 --	    
 181.210 -+
 181.211 - 	    if (*product == '\0') {
 181.212 --	        g_free(product);
 181.213 --	        if (classid == 9) {
 181.214 --                    product = g_strdup_printf("USB %.2f Hub", ver);
 181.215 --                } else {
 181.216 --  	            product = g_strdup_printf("Unknown USB %.2f Device (class %d)",
 181.217 --                                              ver, classid);
 181.218 --                }
 181.219 -+		g_free(product);
 181.220 -+		if (classid == 9) {
 181.221 -+		    product = g_strdup_printf("USB %.2f Hub", ver);
 181.222 -+		} else {
 181.223 -+		    product =
 181.224 -+			g_strdup_printf
 181.225 -+			("Unknown USB %.2f Device (class %d)", ver,
 181.226 -+			 classid);
 181.227 -+		}
 181.228 - 	    }
 181.229 --	    
 181.230 -+
 181.231 - 
 181.232 - 	    if (classid == 9) {	/* hub */
 181.233 --    	        usb_list = h_strdup_cprintf("[%s#%d]\n",
 181.234 --		      		           usb_list, product, n);
 181.235 --            } else { /* everything else */
 181.236 --    	        usb_list = h_strdup_cprintf("$%s$%s=\n",
 181.237 --		      		           usb_list, tmp, product);
 181.238 --
 181.239 --                const gchar *url = vendor_get_url(manuf);
 181.240 --                if (url) {
 181.241 --                    gchar *tmp = g_strdup_printf("%s (%s)", manuf, url);
 181.242 --                    g_free(manuf);
 181.243 --                    manuf = tmp;
 181.244 --                }
 181.245 --
 181.246 --                gchar *strhash = g_strdup_printf("[Device Information]\n"
 181.247 --                                                 "Product=%s\n"
 181.248 --                                                 "Manufacturer=%s\n"
 181.249 --                                                 "[Port #%d]\n"
 181.250 --                                                 "Speed=%.2fMbit/s\n"
 181.251 --                                                 "Max Current=%s\n"
 181.252 --                                                 "[Misc]\n"
 181.253 --                                                 "USB Version=%.2f\n"
 181.254 --                                                 "Revision=%.2f\n"
 181.255 --                                                 "Class=0x%x\n"
 181.256 --                                                 "Vendor=0x%x\n"
 181.257 --                                                 "Product ID=0x%x\n"
 181.258 --                                                 "Bus=%d\n" "Level=%d\n",
 181.259 --                                                 product, manuf,
 181.260 --                                                 port, speed, mxpwr,
 181.261 --                                                 ver, rev, classid,
 181.262 --                                                 vendor, prodid, bus, level);
 181.263 -+		usb_list = h_strdup_cprintf("[%s#%d]\n",
 181.264 -+					    usb_list, product, n);
 181.265 -+	    } else {		/* everything else */
 181.266 -+		usb_list = h_strdup_cprintf("$%s$%s=\n",
 181.267 -+					    usb_list, tmp, product);
 181.268 -+
 181.269 -+		const gchar *url = vendor_get_url(manuf);
 181.270 -+		if (url) {
 181.271 -+		    gchar *tmp =
 181.272 -+			g_strdup_printf("%s (%s)", vendor_get_name(manuf),
 181.273 -+					url);
 181.274 -+		    g_free(manuf);
 181.275 -+		    manuf = tmp;
 181.276 -+		}
 181.277 -+
 181.278 -+		gchar *strhash = g_strdup_printf("[Device Information]\n"
 181.279 -+						 "Product=%s\n",
 181.280 -+						 product);
 181.281 -+		if (manuf && strlen(manuf))
 181.282 -+		    strhash = h_strdup_cprintf("Manufacturer=%s\n",
 181.283 -+					       strhash, manuf);
 181.284 -+
 181.285 -+		strhash = h_strdup_cprintf("[Port #%d]\n"
 181.286 -+					   "Speed=%.2fMbit/s\n"
 181.287 -+					   "Max Current=%s\n"
 181.288 -+					   "[Misc]\n"
 181.289 -+					   "USB Version=%.2f\n"
 181.290 -+					   "Revision=%.2f\n"
 181.291 -+					   "Class=0x%x\n"
 181.292 -+					   "Vendor=0x%x\n"
 181.293 -+					   "Product ID=0x%x\n"
 181.294 -+					   "Bus=%d\n" "Level=%d\n",
 181.295 -+					   strhash,
 181.296 -+					   port, speed, mxpwr,
 181.297 -+					   ver, rev, classid,
 181.298 -+					   vendor, prodid, bus, level);
 181.299 - 
 181.300 --                g_hash_table_insert(moreinfo, tmp, strhash);
 181.301 --            }
 181.302 -+		g_hash_table_insert(moreinfo, tmp, strhash);
 181.303 -+	    }
 181.304 - 
 181.305 - 	    g_free(manuf);
 181.306 - 	    g_free(product);
 181.307 -@@ -128,4 +240,12 @@
 181.308 -     }
 181.309 - 
 181.310 -     fclose(dev);
 181.311 -+
 181.312 -+    return n;
 181.313 -+}
 181.314 -+
 181.315 -+void __scan_usb(void)
 181.316 -+{
 181.317 -+    if (!__scan_usb_procfs())
 181.318 -+	__scan_usb_sysfs();
 181.319 - }
   182.1 --- a/hplip/receipt	Wed May 09 17:03:28 2018 +0300
   182.2 +++ b/hplip/receipt	Thu May 10 21:12:00 2018 +0300
   182.3 @@ -20,9 +20,6 @@
   182.4  BUGS="Unable to delete hplip.desktop from $fs.  Using hack in post_install."
   182.5  
   182.6  compile_rules() {
   182.7 -	# fix build with cups 1.6 - FC hplip-ipp-accessors.patch
   182.8 -	patch -Np1 -i $stuff/cups-1.6-buildfix.diff
   182.9 -
  182.10  	./configure  \
  182.11  		--disable-doc-build \
  182.12  		--enable-qt4 \
   183.1 --- a/hplip/stuff/cups-1.6-buildfix.diff	Wed May 09 17:03:28 2018 +0300
   183.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   183.3 @@ -1,392 +0,0 @@
   183.4 -diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c
   183.5 ---- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors	2012-06-18 12:41:19.000000000 +0200
   183.6 -+++ hplip-3.12.6/prnt/cupsext/cupsext.c	2012-07-19 17:11:47.606524137 +0200
   183.7 -@@ -87,6 +87,46 @@ typedef int Py_ssize_t;
   183.8 - #define PY_SSIZE_T_MIN INT_MIN
   183.9 - #endif
  183.10 -
  183.11 -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
  183.12 -+#define HAVE_CUPS_1_6 1
  183.13 -+#endif
  183.14 -+
  183.15 -+#ifndef HAVE_CUPS_1_6
  183.16 -+#define ippGetCount(attr)     attr->num_values
  183.17 -+#define ippGetGroupTag(attr)  attr->group_tag
  183.18 -+#define ippGetValueTag(attr)  attr->value_tag
  183.19 -+#define ippGetName(attr)      attr->name
  183.20 -+#define ippGetBoolean(attr, element) attr->values[element].boolean
  183.21 -+#define ippGetInteger(attr, element) attr->values[element].integer
  183.22 -+#define ippGetStatusCode(ipp) ipp->request.status.status_code
  183.23 -+#define ippGetString(attr, element, language) attr->values[element].string.text
  183.24 -+
  183.25 -+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
  183.26 -+{
  183.27 -+    if (!ipp)
  183.28 -+        return (NULL);
  183.29 -+    return (ipp->current = ipp->attrs);
  183.30 -+}
  183.31 -+
  183.32 -+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
  183.33 -+{
  183.34 -+    if (!ipp || !ipp->current)
  183.35 -+        return (NULL);
  183.36 -+    return (ipp->current = ipp->current->next);
  183.37 -+}
  183.38 -+
  183.39 -+static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
  183.40 -+{
  183.41 -+    ipp->request.op.operation_id = op;
  183.42 -+    return (1);
  183.43 -+}
  183.44 -+
  183.45 -+static int ippSetRequestId( ipp_t *ipp, int request_id )
  183.46 -+{
  183.47 -+    ipp->request.any.request_id = request_id;
  183.48 -+    return (1);
  183.49 -+}
  183.50 -+#endif
  183.51 -
  183.52 - int g_num_options = 0;
  183.53 - cups_option_t * g_options;
  183.54 -@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self,
  183.55 -     request = ippNew();
  183.56 -     language = cupsLangDefault();
  183.57 -
  183.58 --    request->request.op.operation_id = CUPS_GET_PRINTERS;
  183.59 --    request->request.any.request_id = 1;
  183.60 -+    ippSetOperation( request, CUPS_GET_PRINTERS );
  183.61 -+    ippSetRequestId ( request, 1);
  183.62 -
  183.63 -     ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
  183.64 -                   "attributes-charset", NULL, cupsLangEncoding( language ) );
  183.65 -@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self,
  183.66 -         ipp_pstate_t state;
  183.67 -         int i = 0;
  183.68 -
  183.69 --        for ( attr = response->attrs; attr != NULL; attr = attr->next )
  183.70 -+        for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) )
  183.71 -         {
  183.72 --            while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER )
  183.73 --                attr = attr->next;
  183.74 -+            while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER )
  183.75 -+                attr = ippNextAttribute( response );
  183.76 -
  183.77 -             if ( attr == NULL )
  183.78 -                 break;
  183.79 -@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self,
  183.80 -             state = IPP_PRINTER_IDLE;
  183.81 -             accepting = 0;
  183.82 -
  183.83 --            while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER )
  183.84 -+            while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER )
  183.85 -             {
  183.86 --                if ( strcmp( attr->name, "printer-name" ) == 0 &&
  183.87 --                        attr->value_tag == IPP_TAG_NAME )
  183.88 --                    name = attr->values[ 0 ].string.text;
  183.89 --
  183.90 --                else if ( strcmp( attr->name, "device-uri" ) == 0 &&
  183.91 --                        attr->value_tag == IPP_TAG_URI )
  183.92 --                    device_uri = attr->values[ 0 ].string.text;
  183.93 --
  183.94 --                else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 &&
  183.95 --                        attr->value_tag == IPP_TAG_URI )
  183.96 --                    printer_uri = attr->values[ 0 ].string.text;
  183.97 --
  183.98 --                else if ( strcmp( attr->name, "printer-info" ) == 0 &&
  183.99 --                        attr->value_tag == IPP_TAG_TEXT )
 183.100 --                    info = attr->values[ 0 ].string.text;
 183.101 --
 183.102 --                else if ( strcmp( attr->name, "printer-location" ) == 0 &&
 183.103 --                        attr->value_tag == IPP_TAG_TEXT )
 183.104 --                    location = attr->values[ 0 ].string.text;
 183.105 --
 183.106 --                else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 &&
 183.107 --                        attr->value_tag == IPP_TAG_TEXT )
 183.108 --                    make_model = attr->values[ 0 ].string.text;
 183.109 --
 183.110 --                else if ( strcmp( attr->name, "printer-state" ) == 0 &&
 183.111 --                        attr->value_tag == IPP_TAG_ENUM )
 183.112 --                    state = ( ipp_pstate_t ) attr->values[ 0 ].integer;
 183.113 --
 183.114 --                else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
 183.115 --                        attr->value_tag == IPP_TAG_BOOLEAN)
 183.116 --                    accepting = attr->values[ 0 ].boolean;
 183.117 -+                if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 &&
 183.118 -+                        ippGetValueTag( attr ) == IPP_TAG_NAME )
 183.119 -+                    name = ippGetString( attr, 0, NULL );
 183.120 -+
 183.121 -+                else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 &&
 183.122 -+                        ippGetValueTag( attr ) == IPP_TAG_URI )
 183.123 -+                    device_uri = ippGetString( attr, 0, NULL );
 183.124 -+
 183.125 -+                else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 &&
 183.126 -+                        ippGetValueTag( attr ) == IPP_TAG_URI )
 183.127 -+                    printer_uri = ippGetString( attr, 0, NULL );
 183.128 -+
 183.129 -+                else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 &&
 183.130 -+                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
 183.131 -+                    info = ippGetString( attr, 0, NULL );
 183.132 -+
 183.133 -+                else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 &&
 183.134 -+                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
 183.135 -+                    location = ippGetString( attr, 0, NULL );
 183.136 -+
 183.137 -+                else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 &&
 183.138 -+                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
 183.139 -+                    make_model = ippGetString( attr, 0, NULL );
 183.140 -+
 183.141 -+                else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 &&
 183.142 -+                        ippGetValueTag( attr ) == IPP_TAG_ENUM )
 183.143 -+                    state = ( ipp_pstate_t ) ippGetInteger( attr, 0 );
 183.144 -+
 183.145 -+                else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") &&
 183.146 -+                        ippGetValueTag( attr ) == IPP_TAG_BOOLEAN)
 183.147 -+                    accepting = ippGetBoolean( attr, 0 );
 183.148 -
 183.149 --                attr = attr->next;
 183.150 -+                attr = ippNextAttribute( response );
 183.151 -             }
 183.152 -
 183.153 -             if ( device_uri == NULL )
 183.154 -@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self,
 183.155 -     request = ippNew();
 183.156 -     language = cupsLangDefault();
 183.157 -
 183.158 --    request->request.op.operation_id = CUPS_ADD_PRINTER;
 183.159 --    request->request.any.request_id = 1;
 183.160 -+    ippSetOperation( request, CUPS_ADD_PRINTER );
 183.161 -+    ippSetRequestId ( request, 1 );
 183.162 -
 183.163 -     ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
 183.164 -                   "attributes-charset", NULL, cupsLangEncoding( language ) );
 183.165 -@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self,
 183.166 -     }
 183.167 -     else
 183.168 -     {
 183.169 --        status = response->request.status.status_code;
 183.170 -+        status = ippGetStatusCode( response );
 183.171 -         //ippDelete( response );
 183.172 -         r = 1;
 183.173 -     }
 183.174 -@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self,
 183.175 -        */
 183.176 -     request = ippNew();
 183.177 -
 183.178 --    request->request.op.operation_id = CUPS_DELETE_PRINTER;
 183.179 --    request->request.op.request_id = 1;
 183.180 -+    ippSetOperation( request, CUPS_DELETE_PRINTER );
 183.181 -+    ippSetRequestId ( request, 1 );
 183.182 -
 183.183 -     language = cupsLangDefault();
 183.184 -
 183.185 -@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self,
 183.186 -      */
 183.187 -     response = cupsDoRequest( http, request, "/admin/" );
 183.188 -
 183.189 --    if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
 183.190 -+    if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
 183.191 -     {
 183.192 -         r = 1;
 183.193 -     }
 183.194 -@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject *
 183.195 -
 183.196 -     request = ippNew();
 183.197 -
 183.198 --    request->request.op.operation_id = CUPS_SET_DEFAULT;
 183.199 --    request->request.op.request_id = 1;
 183.200 -+    ippSetOperation( request, CUPS_SET_DEFAULT );
 183.201 -+    ippSetRequestId ( request, 1 );
 183.202 -
 183.203 -     language = cupsLangDefault();
 183.204 -
 183.205 -@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject *
 183.206 -
 183.207 -     response = cupsDoRequest( http, request, "/admin/" );
 183.208 -
 183.209 --    if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
 183.210 -+    if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
 183.211 -     {
 183.212 -         r = 1;
 183.213 -     }
 183.214 -@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se
 183.215 -
 183.216 -     request = ippNew();
 183.217 -
 183.218 --    request->request.op.operation_id = op;
 183.219 --    request->request.op.request_id = 1;
 183.220 -+    ippSetOperation( request, op );
 183.221 -+    ippSetRequestId ( request, 1 );
 183.222 -
 183.223 -     language = cupsLangDefault();
 183.224 -
 183.225 -@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se
 183.226 -
 183.227 -     response = cupsDoRequest(http, request, "/admin/");
 183.228 -
 183.229 --    if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT))
 183.230 -+    if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT))
 183.231 -     {
 183.232 -         r = 1;
 183.233 -     }
 183.234 -@@ -837,7 +877,7 @@ abort:
 183.235 -     if ( response != NULL )
 183.236 -         ippDelete( response );
 183.237 -
 183.238 --    return Py_BuildValue( "i", r );;
 183.239 -+    return Py_BuildValue( "i", r );
 183.240 - }
 183.241 -
 183.242 -
 183.243 -@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self,
 183.244 -
 183.245 -     request = ippNew();
 183.246 -
 183.247 --    request->request.op.operation_id = CUPS_GET_PPDS;
 183.248 --    request->request.op.request_id   = 1;
 183.249 -+    ippSetOperation( request, CUPS_GET_PPDS );
 183.250 -+    ippSetRequestId ( request, 1 );
 183.251 -
 183.252 -     language = cupsLangDefault();
 183.253 -
 183.254 -@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self,
 183.255 -     if ((response = cupsDoRequest(http, request, "/")) != NULL)
 183.256 -     {
 183.257 -
 183.258 --        for (attr = response->attrs; attr; attr = attr->next)
 183.259 -+        for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response ))
 183.260 -         {
 183.261 -             PyObject *dict;
 183.262 -             char *ppdname = NULL;
 183.263 -
 183.264 --            while (attr && attr->group_tag != IPP_TAG_PRINTER)
 183.265 --                attr = attr->next;
 183.266 -+            while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
 183.267 -+                attr = ippNextAttribute( response );
 183.268 -
 183.269 -             if (!attr)
 183.270 -                 break;
 183.271 -
 183.272 -             dict = PyDict_New ();
 183.273 -
 183.274 --            for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
 183.275 -+            for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response ))
 183.276 -             {
 183.277 -                 PyObject *val = NULL;
 183.278 -
 183.279 --                if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME)
 183.280 -+                if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME)
 183.281 -                 {
 183.282 --                    ppdname = attr->values[0].string.text;
 183.283 -+                    ppdname = ippGetString( attr, 0, NULL );
 183.284 -
 183.285 -                     //sprintf( buf, "print '%s'", ppdname);
 183.286 -                     //PyRun_SimpleString( buf );
 183.287 -                 }
 183.288 -
 183.289 --                else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD)
 183.290 --                //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) ||
 183.291 --                //    (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) ||
 183.292 --                //    (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) ||
 183.293 --                //    (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT))
 183.294 -+                else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD)
 183.295 -+                //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) ||
 183.296 -+                //    (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
 183.297 -+                //    (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
 183.298 -+                //    (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT))
 183.299 -                 {
 183.300 --                    val = PyObj_from_UTF8(attr->values[0].string.text);
 183.301 -+                    val = PyObj_from_UTF8(ippGetString( attr, 0, NULL ));
 183.302 -                 }
 183.303 -
 183.304 -                 if (val)
 183.305 -                 {
 183.306 --                    PyDict_SetItemString (dict, attr->name, val);
 183.307 -+                    PyDict_SetItemString (dict, ippGetName( attr ), val);
 183.308 -                     Py_DECREF (val);
 183.309 -                 }
 183.310 -             }
 183.311 -diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c
 183.312 ---- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors	2012-06-18 12:42:51.000000000 +0200
 183.313 -+++ hplip-3.12.6/scan/sane/hpaio.c	2012-07-19 17:12:34.557848760 +0200
 183.314 -@@ -47,6 +47,43 @@
 183.315 - #define DEBUG_DECLARE_ONLY
 183.316 - #include "sanei_debug.h"
 183.317 -
 183.318 -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
 183.319 -+#define HAVE_CUPS_1_6 1
 183.320 -+#endif
 183.321 -+
 183.322 -+#ifndef HAVE_CUPS_1_6
 183.323 -+#define ippGetGroupTag(attr)  attr->group_tag
 183.324 -+#define ippGetValueTag(attr)  attr->value_tag
 183.325 -+#define ippGetName(attr)      attr->name
 183.326 -+#define ippGetString(attr, element, language) attr->values[element].string.text
 183.327 -+
 183.328 -+static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
 183.329 -+{
 183.330 -+    if (!ipp)
 183.331 -+        return (NULL);
 183.332 -+    return (ipp->current = ipp->attrs);
 183.333 -+}
 183.334 -+
 183.335 -+static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
 183.336 -+{
 183.337 -+    if (!ipp || !ipp->current)
 183.338 -+        return (NULL);
 183.339 -+    return (ipp->current = ipp->current->next);
 183.340 -+}
 183.341 -+
 183.342 -+static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
 183.343 -+{
 183.344 -+    ipp->request.op.operation_id = op;
 183.345 -+    return (1);
 183.346 -+}
 183.347 -+
 183.348 -+static int ippSetRequestId( ipp_t *ipp, int request_id )
 183.349 -+{
 183.350 -+    ipp->request.any.request_id = request_id;
 183.351 -+    return (1);
 183.352 -+}
 183.353 -+#endif
 183.354 -+
 183.355 - static SANE_Device **DeviceList = NULL;
 183.356 -
 183.357 - static int AddDeviceList(char *uri, char *model, SANE_Device ***pd)
 183.358 -@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print
 183.359 -    /* Assemble the IPP request */
 183.360 -    request = ippNew();
 183.361 -
 183.362 --   request->request.op.operation_id = CUPS_GET_PRINTERS;
 183.363 --   request->request.any.request_id  = 1;
 183.364 -+   ippSetOperation( request, CUPS_GET_PRINTERS );
 183.365 -+   ippSetRequestId( request, 1 );
 183.366 -
 183.367 -    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
 183.368 -    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
 183.369 -@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print
 183.370 -    if ((response = cupsDoRequest(http, request, "/")) == NULL)
 183.371 -       goto bugout;
 183.372 -
 183.373 --   for (attr = response->attrs; attr != NULL; attr = attr->next)
 183.374 -+   for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
 183.375 -    {
 183.376 -       /* Skip leading attributes until we hit a printer. */
 183.377 --      while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
 183.378 --         attr = attr->next;
 183.379 -+      while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
 183.380 -+         attr = ippNextAttribute( response );
 183.381 -
 183.382 -       if (attr == NULL)
 183.383 -          break;
 183.384 -
 183.385 --      while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
 183.386 -+      while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
 183.387 -       {
 183.388 --         if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0)
 183.389 -+         if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
 183.390 -             cnt++;
 183.391 --         attr = attr->next;
 183.392 -+         attr = ippNextAttribute( response );
 183.393 -       }
 183.394 -
 183.395 -       if (attr == NULL)
   184.1 --- a/hplip/stuff/hplip-3.9.4b-glibc210.u	Wed May 09 17:03:28 2018 +0300
   184.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   184.3 @@ -1,22 +0,0 @@
   184.4 ---- prnt/hpijs/registry.cpp.orig	2009-04-29 22:41:07.000000000 +0200
   184.5 -+++ prnt/hpijs/registry.cpp	2009-06-02 14:17:09.000000000 +0200
   184.6 -@@ -292,7 +292,7 @@ DRIVER_ERROR DeviceRegistry::SelectDevic
   184.7 -             device = eDJ3320;
   184.8 -             match = TRUE;
   184.9 -         }
  184.10 --		char	*cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:");
  184.11 -+		const char	*cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:");
  184.12 - 		if (!cmdStr)
  184.13 - 		{
  184.14 - 			cmdStr = strstr ((const char *) DevIDBuffer+2, "COMMAND SET:");
  184.15 ---- prnt/hpijs/dj3320.cpp.orig	2009-04-29 22:41:07.000000000 +0200
  184.16 -+++ prnt/hpijs/dj3320.cpp	2009-06-02 14:32:21.000000000 +0200
  184.17 -@@ -429,7 +429,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE
  184.18 -             pLDLEncap->bNewStatus = FALSE;
  184.19 - 
  184.20 -             // First 10 bytes of m_pbyReadBuff are packet header.  Status query from printer has $S:
  184.21 --            if ((pcStr = strstr((const char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL)
  184.22 -+            if ((pcStr = strstr((char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL)
  184.23 -             {
  184.24 -                 m_dsCurrentStatus = DISPLAY_COMM_PROBLEM;
  184.25 -                 return DISPLAY_COMM_PROBLEM;
   185.1 --- a/hplip/stuff/hplip-cups-1.5.0-compatibility.patch	Wed May 09 17:03:28 2018 +0300
   185.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   185.3 @@ -1,9 +0,0 @@
   185.4 ---- hplip-3.11.7~/prnt/hpps/hppsfilter.c	2011-07-24 18:58:05.000000000 +0000
   185.5 -+++ hplip-3.11.7/prnt/hpps/hppsfilter.c	2011-08-09 20:51:54.150214165 +0000
   185.6 -@@ -38,6 +38,7 @@
   185.7 - #include <unistd.h>
   185.8 - #include <fcntl.h>
   185.9 - #include <cups/cups.h>
  185.10 -+#include <cups/ppd.h>
  185.11 - #include <sys/types.h>
  185.12 - #include <sys/stat.h>
   186.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   186.2 +++ b/hplip/stuff/patches/cups-1.6-buildfix.diff	Thu May 10 21:12:00 2018 +0300
   186.3 @@ -0,0 +1,392 @@
   186.4 +diff -up hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors hplip-3.12.6/prnt/cupsext/cupsext.c
   186.5 +--- hplip-3.12.6/prnt/cupsext/cupsext.c.ipp_accessors	2012-06-18 12:41:19.000000000 +0200
   186.6 ++++ hplip-3.12.6/prnt/cupsext/cupsext.c	2012-07-19 17:11:47.606524137 +0200
   186.7 +@@ -87,6 +87,46 @@ typedef int Py_ssize_t;
   186.8 + #define PY_SSIZE_T_MIN INT_MIN
   186.9 + #endif
  186.10 +
  186.11 ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
  186.12 ++#define HAVE_CUPS_1_6 1
  186.13 ++#endif
  186.14 ++
  186.15 ++#ifndef HAVE_CUPS_1_6
  186.16 ++#define ippGetCount(attr)     attr->num_values
  186.17 ++#define ippGetGroupTag(attr)  attr->group_tag
  186.18 ++#define ippGetValueTag(attr)  attr->value_tag
  186.19 ++#define ippGetName(attr)      attr->name
  186.20 ++#define ippGetBoolean(attr, element) attr->values[element].boolean
  186.21 ++#define ippGetInteger(attr, element) attr->values[element].integer
  186.22 ++#define ippGetStatusCode(ipp) ipp->request.status.status_code
  186.23 ++#define ippGetString(attr, element, language) attr->values[element].string.text
  186.24 ++
  186.25 ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
  186.26 ++{
  186.27 ++    if (!ipp)
  186.28 ++        return (NULL);
  186.29 ++    return (ipp->current = ipp->attrs);
  186.30 ++}
  186.31 ++
  186.32 ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
  186.33 ++{
  186.34 ++    if (!ipp || !ipp->current)
  186.35 ++        return (NULL);
  186.36 ++    return (ipp->current = ipp->current->next);
  186.37 ++}
  186.38 ++
  186.39 ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
  186.40 ++{
  186.41 ++    ipp->request.op.operation_id = op;
  186.42 ++    return (1);
  186.43 ++}
  186.44 ++
  186.45 ++static int ippSetRequestId( ipp_t *ipp, int request_id )
  186.46 ++{
  186.47 ++    ipp->request.any.request_id = request_id;
  186.48 ++    return (1);
  186.49 ++}
  186.50 ++#endif
  186.51 +
  186.52 + int g_num_options = 0;
  186.53 + cups_option_t * g_options;
  186.54 +@@ -333,8 +373,8 @@ PyObject * getPrinters( PyObject * self,
  186.55 +     request = ippNew();
  186.56 +     language = cupsLangDefault();
  186.57 +
  186.58 +-    request->request.op.operation_id = CUPS_GET_PRINTERS;
  186.59 +-    request->request.any.request_id = 1;
  186.60 ++    ippSetOperation( request, CUPS_GET_PRINTERS );
  186.61 ++    ippSetRequestId ( request, 1);
  186.62 +
  186.63 +     ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
  186.64 +                   "attributes-charset", NULL, cupsLangEncoding( language ) );
  186.65 +@@ -378,10 +418,10 @@ PyObject * getPrinters( PyObject * self,
  186.66 +         ipp_pstate_t state;
  186.67 +         int i = 0;
  186.68 +
  186.69 +-        for ( attr = response->attrs; attr != NULL; attr = attr->next )
  186.70 ++        for ( attr = ippFirstAttribute( response ); attr != NULL; attr = ippNextAttribute( response ) )
  186.71 +         {
  186.72 +-            while ( attr != NULL && attr->group_tag != IPP_TAG_PRINTER )
  186.73 +-                attr = attr->next;
  186.74 ++            while ( attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER )
  186.75 ++                attr = ippNextAttribute( response );
  186.76 +
  186.77 +             if ( attr == NULL )
  186.78 +                 break;
  186.79 +@@ -390,41 +430,41 @@ PyObject * getPrinters( PyObject * self,
  186.80 +             state = IPP_PRINTER_IDLE;
  186.81 +             accepting = 0;
  186.82 +
  186.83 +-            while ( attr != NULL && attr->group_tag == IPP_TAG_PRINTER )
  186.84 ++            while ( attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER )
  186.85 +             {
  186.86 +-                if ( strcmp( attr->name, "printer-name" ) == 0 &&
  186.87 +-                        attr->value_tag == IPP_TAG_NAME )
  186.88 +-                    name = attr->values[ 0 ].string.text;
  186.89 +-
  186.90 +-                else if ( strcmp( attr->name, "device-uri" ) == 0 &&
  186.91 +-                        attr->value_tag == IPP_TAG_URI )
  186.92 +-                    device_uri = attr->values[ 0 ].string.text;
  186.93 +-
  186.94 +-                else if ( strcmp( attr->name, "printer-uri-supported" ) == 0 &&
  186.95 +-                        attr->value_tag == IPP_TAG_URI )
  186.96 +-                    printer_uri = attr->values[ 0 ].string.text;
  186.97 +-
  186.98 +-                else if ( strcmp( attr->name, "printer-info" ) == 0 &&
  186.99 +-                        attr->value_tag == IPP_TAG_TEXT )
 186.100 +-                    info = attr->values[ 0 ].string.text;
 186.101 +-
 186.102 +-                else if ( strcmp( attr->name, "printer-location" ) == 0 &&
 186.103 +-                        attr->value_tag == IPP_TAG_TEXT )
 186.104 +-                    location = attr->values[ 0 ].string.text;
 186.105 +-
 186.106 +-                else if ( strcmp( attr->name, "printer-make-and-model" ) == 0 &&
 186.107 +-                        attr->value_tag == IPP_TAG_TEXT )
 186.108 +-                    make_model = attr->values[ 0 ].string.text;
 186.109 +-
 186.110 +-                else if ( strcmp( attr->name, "printer-state" ) == 0 &&
 186.111 +-                        attr->value_tag == IPP_TAG_ENUM )
 186.112 +-                    state = ( ipp_pstate_t ) attr->values[ 0 ].integer;
 186.113 +-
 186.114 +-                else if (!strcmp(attr->name, "printer-is-accepting-jobs") &&
 186.115 +-                        attr->value_tag == IPP_TAG_BOOLEAN)
 186.116 +-                    accepting = attr->values[ 0 ].boolean;
 186.117 ++                if ( strcmp( ippGetName( attr ), "printer-name" ) == 0 &&
 186.118 ++                        ippGetValueTag( attr ) == IPP_TAG_NAME )
 186.119 ++                    name = ippGetString( attr, 0, NULL );
 186.120 ++
 186.121 ++                else if ( strcmp( ippGetName( attr ), "device-uri" ) == 0 &&
 186.122 ++                        ippGetValueTag( attr ) == IPP_TAG_URI )
 186.123 ++                    device_uri = ippGetString( attr, 0, NULL );
 186.124 ++
 186.125 ++                else if ( strcmp( ippGetName( attr ), "printer-uri-supported" ) == 0 &&
 186.126 ++                        ippGetValueTag( attr ) == IPP_TAG_URI )
 186.127 ++                    printer_uri = ippGetString( attr, 0, NULL );
 186.128 ++
 186.129 ++                else if ( strcmp( ippGetName( attr ), "printer-info" ) == 0 &&
 186.130 ++                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
 186.131 ++                    info = ippGetString( attr, 0, NULL );
 186.132 ++
 186.133 ++                else if ( strcmp( ippGetName( attr ), "printer-location" ) == 0 &&
 186.134 ++                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
 186.135 ++                    location = ippGetString( attr, 0, NULL );
 186.136 ++
 186.137 ++                else if ( strcmp( ippGetName( attr ), "printer-make-and-model" ) == 0 &&
 186.138 ++                        ippGetValueTag( attr ) == IPP_TAG_TEXT )
 186.139 ++                    make_model = ippGetString( attr, 0, NULL );
 186.140 ++
 186.141 ++                else if ( strcmp( ippGetName( attr ), "printer-state" ) == 0 &&
 186.142 ++                        ippGetValueTag( attr ) == IPP_TAG_ENUM )
 186.143 ++                    state = ( ipp_pstate_t ) ippGetInteger( attr, 0 );
 186.144 ++
 186.145 ++                else if (!strcmp(ippGetName( attr ), "printer-is-accepting-jobs") &&
 186.146 ++                        ippGetValueTag( attr ) == IPP_TAG_BOOLEAN)
 186.147 ++                    accepting = ippGetBoolean( attr, 0 );
 186.148 +
 186.149 +-                attr = attr->next;
 186.150 ++                attr = ippNextAttribute( response );
 186.151 +             }
 186.152 +
 186.153 +             if ( device_uri == NULL )
 186.154 +@@ -522,8 +562,8 @@ PyObject * addPrinter( PyObject * self,
 186.155 +     request = ippNew();
 186.156 +     language = cupsLangDefault();
 186.157 +
 186.158 +-    request->request.op.operation_id = CUPS_ADD_PRINTER;
 186.159 +-    request->request.any.request_id = 1;
 186.160 ++    ippSetOperation( request, CUPS_ADD_PRINTER );
 186.161 ++    ippSetRequestId ( request, 1 );
 186.162 +
 186.163 +     ippAddString( request, IPP_TAG_OPERATION, IPP_TAG_CHARSET,
 186.164 +                   "attributes-charset", NULL, cupsLangEncoding( language ) );
 186.165 +@@ -568,7 +608,7 @@ PyObject * addPrinter( PyObject * self,
 186.166 +     }
 186.167 +     else
 186.168 +     {
 186.169 +-        status = response->request.status.status_code;
 186.170 ++        status = ippGetStatusCode( response );
 186.171 +         //ippDelete( response );
 186.172 +         r = 1;
 186.173 +     }
 186.174 +@@ -631,8 +671,8 @@ PyObject * delPrinter( PyObject * self,
 186.175 +        */
 186.176 +     request = ippNew();
 186.177 +
 186.178 +-    request->request.op.operation_id = CUPS_DELETE_PRINTER;
 186.179 +-    request->request.op.request_id = 1;
 186.180 ++    ippSetOperation( request, CUPS_DELETE_PRINTER );
 186.181 ++    ippSetRequestId ( request, 1 );
 186.182 +
 186.183 +     language = cupsLangDefault();
 186.184 +
 186.185 +@@ -650,7 +690,7 @@ PyObject * delPrinter( PyObject * self,
 186.186 +      */
 186.187 +     response = cupsDoRequest( http, request, "/admin/" );
 186.188 +
 186.189 +-    if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
 186.190 ++    if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
 186.191 +     {
 186.192 +         r = 1;
 186.193 +     }
 186.194 +@@ -721,8 +761,8 @@ PyObject * setDefaultPrinter( PyObject *
 186.195 +
 186.196 +     request = ippNew();
 186.197 +
 186.198 +-    request->request.op.operation_id = CUPS_SET_DEFAULT;
 186.199 +-    request->request.op.request_id = 1;
 186.200 ++    ippSetOperation( request, CUPS_SET_DEFAULT );
 186.201 ++    ippSetRequestId ( request, 1 );
 186.202 +
 186.203 +     language = cupsLangDefault();
 186.204 +
 186.205 +@@ -743,7 +783,7 @@ PyObject * setDefaultPrinter( PyObject *
 186.206 +
 186.207 +     response = cupsDoRequest( http, request, "/admin/" );
 186.208 +
 186.209 +-    if ( ( response != NULL ) && ( response->request.status.status_code <= IPP_OK_CONFLICT ) )
 186.210 ++    if ( ( response != NULL ) && ( ippGetStatusCode( response ) <= IPP_OK_CONFLICT ) )
 186.211 +     {
 186.212 +         r = 1;
 186.213 +     }
 186.214 +@@ -797,8 +837,8 @@ PyObject * controlPrinter( PyObject * se
 186.215 +
 186.216 +     request = ippNew();
 186.217 +
 186.218 +-    request->request.op.operation_id = op;
 186.219 +-    request->request.op.request_id = 1;
 186.220 ++    ippSetOperation( request, op );
 186.221 ++    ippSetRequestId ( request, 1 );
 186.222 +
 186.223 +     language = cupsLangDefault();
 186.224 +
 186.225 +@@ -822,7 +862,7 @@ PyObject * controlPrinter( PyObject * se
 186.226 +
 186.227 +     response = cupsDoRequest(http, request, "/admin/");
 186.228 +
 186.229 +-    if (( response != NULL ) && (response->request.status.status_code <= IPP_OK_CONFLICT))
 186.230 ++    if (( response != NULL ) && (ippGetStatusCode( response ) <= IPP_OK_CONFLICT))
 186.231 +     {
 186.232 +         r = 1;
 186.233 +     }
 186.234 +@@ -837,7 +877,7 @@ abort:
 186.235 +     if ( response != NULL )
 186.236 +         ippDelete( response );
 186.237 +
 186.238 +-    return Py_BuildValue( "i", r );;
 186.239 ++    return Py_BuildValue( "i", r );
 186.240 + }
 186.241 +
 186.242 +
 186.243 +@@ -1116,8 +1156,8 @@ PyObject * getPPDList( PyObject * self,
 186.244 +
 186.245 +     request = ippNew();
 186.246 +
 186.247 +-    request->request.op.operation_id = CUPS_GET_PPDS;
 186.248 +-    request->request.op.request_id   = 1;
 186.249 ++    ippSetOperation( request, CUPS_GET_PPDS );
 186.250 ++    ippSetRequestId ( request, 1 );
 186.251 +
 186.252 +     language = cupsLangDefault();
 186.253 +
 186.254 +@@ -1143,43 +1183,43 @@ PyObject * getPPDList( PyObject * self,
 186.255 +     if ((response = cupsDoRequest(http, request, "/")) != NULL)
 186.256 +     {
 186.257 +
 186.258 +-        for (attr = response->attrs; attr; attr = attr->next)
 186.259 ++        for (attr = ippFirstAttribute( response ); attr; attr = ippNextAttribute( response ))
 186.260 +         {
 186.261 +             PyObject *dict;
 186.262 +             char *ppdname = NULL;
 186.263 +
 186.264 +-            while (attr && attr->group_tag != IPP_TAG_PRINTER)
 186.265 +-                attr = attr->next;
 186.266 ++            while (attr && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
 186.267 ++                attr = ippNextAttribute( response );
 186.268 +
 186.269 +             if (!attr)
 186.270 +                 break;
 186.271 +
 186.272 +             dict = PyDict_New ();
 186.273 +
 186.274 +-            for (; attr && attr->group_tag == IPP_TAG_PRINTER; attr = attr->next)
 186.275 ++            for (; attr && ippGetGroupTag( attr ) == IPP_TAG_PRINTER; attr = ippNextAttribute( response ))
 186.276 +             {
 186.277 +                 PyObject *val = NULL;
 186.278 +
 186.279 +-                if (!strcmp (attr->name, "ppd-name") && attr->value_tag == IPP_TAG_NAME)
 186.280 ++                if (!strcmp (ippGetName( attr ), "ppd-name") && ippGetValueTag( attr ) == IPP_TAG_NAME)
 186.281 +                 {
 186.282 +-                    ppdname = attr->values[0].string.text;
 186.283 ++                    ppdname = ippGetString( attr, 0, NULL );
 186.284 +
 186.285 +                     //sprintf( buf, "print '%s'", ppdname);
 186.286 +                     //PyRun_SimpleString( buf );
 186.287 +                 }
 186.288 +
 186.289 +-                else if (attr->value_tag == IPP_TAG_TEXT || attr->value_tag == IPP_TAG_NAME || attr->value_tag == IPP_TAG_KEYWORD)
 186.290 +-                //else if ((!strcmp (attr->name, "ppd-natural-language") && attr->value_tag == IPP_TAG_LANGUAGE) ||
 186.291 +-                //    (!strcmp (attr->name, "ppd-make-and-model") && attr->value_tag == IPP_TAG_TEXT) ||
 186.292 +-                //    (!strcmp (attr->name, "ppd-make") && attr->value_tag == IPP_TAG_TEXT) ||
 186.293 +-                //    (!strcmp (attr->name, "ppd-device-id") && attr->value_tag == IPP_TAG_TEXT))
 186.294 ++                else if (ippGetValueTag( attr ) == IPP_TAG_TEXT || ippGetValueTag( attr ) == IPP_TAG_NAME || ippGetValueTag( attr ) == IPP_TAG_KEYWORD)
 186.295 ++                //else if ((!strcmp (ippGetName( attr ), "ppd-natural-language") && ippGetValueTag( attr ) == IPP_TAG_LANGUAGE) ||
 186.296 ++                //    (!strcmp (ippGetName( attr ), "ppd-make-and-model") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
 186.297 ++                //    (!strcmp (ippGetName( attr ), "ppd-make") && ippGetValueTag( attr ) == IPP_TAG_TEXT) ||
 186.298 ++                //    (!strcmp (ippGetName( attr ), "ppd-device-id") && ippGetValueTag( attr ) == IPP_TAG_TEXT))
 186.299 +                 {
 186.300 +-                    val = PyObj_from_UTF8(attr->values[0].string.text);
 186.301 ++                    val = PyObj_from_UTF8(ippGetString( attr, 0, NULL ));
 186.302 +                 }
 186.303 +
 186.304 +                 if (val)
 186.305 +                 {
 186.306 +-                    PyDict_SetItemString (dict, attr->name, val);
 186.307 ++                    PyDict_SetItemString (dict, ippGetName( attr ), val);
 186.308 +                     Py_DECREF (val);
 186.309 +                 }
 186.310 +             }
 186.311 +diff -up hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors hplip-3.12.6/scan/sane/hpaio.c
 186.312 +--- hplip-3.12.6/scan/sane/hpaio.c.ipp_accessors	2012-06-18 12:42:51.000000000 +0200
 186.313 ++++ hplip-3.12.6/scan/sane/hpaio.c	2012-07-19 17:12:34.557848760 +0200
 186.314 +@@ -47,6 +47,43 @@
 186.315 + #define DEBUG_DECLARE_ONLY
 186.316 + #include "sanei_debug.h"
 186.317 +
 186.318 ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
 186.319 ++#define HAVE_CUPS_1_6 1
 186.320 ++#endif
 186.321 ++
 186.322 ++#ifndef HAVE_CUPS_1_6
 186.323 ++#define ippGetGroupTag(attr)  attr->group_tag
 186.324 ++#define ippGetValueTag(attr)  attr->value_tag
 186.325 ++#define ippGetName(attr)      attr->name
 186.326 ++#define ippGetString(attr, element, language) attr->values[element].string.text
 186.327 ++
 186.328 ++static ipp_attribute_t * ippFirstAttribute( ipp_t *ipp )
 186.329 ++{
 186.330 ++    if (!ipp)
 186.331 ++        return (NULL);
 186.332 ++    return (ipp->current = ipp->attrs);
 186.333 ++}
 186.334 ++
 186.335 ++static ipp_attribute_t * ippNextAttribute( ipp_t *ipp )
 186.336 ++{
 186.337 ++    if (!ipp || !ipp->current)
 186.338 ++        return (NULL);
 186.339 ++    return (ipp->current = ipp->current->next);
 186.340 ++}
 186.341 ++
 186.342 ++static int ippSetOperation( ipp_t *ipp, ipp_op_t op )
 186.343 ++{
 186.344 ++    ipp->request.op.operation_id = op;
 186.345 ++    return (1);
 186.346 ++}
 186.347 ++
 186.348 ++static int ippSetRequestId( ipp_t *ipp, int request_id )
 186.349 ++{
 186.350 ++    ipp->request.any.request_id = request_id;
 186.351 ++    return (1);
 186.352 ++}
 186.353 ++#endif
 186.354 ++
 186.355 + static SANE_Device **DeviceList = NULL;
 186.356 +
 186.357 + static int AddDeviceList(char *uri, char *model, SANE_Device ***pd)
 186.358 +@@ -186,8 +223,8 @@ static int GetCupsPrinters(char ***print
 186.359 +    /* Assemble the IPP request */
 186.360 +    request = ippNew();
 186.361 +
 186.362 +-   request->request.op.operation_id = CUPS_GET_PRINTERS;
 186.363 +-   request->request.any.request_id  = 1;
 186.364 ++   ippSetOperation( request, CUPS_GET_PRINTERS );
 186.365 ++   ippSetRequestId( request, 1 );
 186.366 +
 186.367 +    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
 186.368 +    ippAddString(request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, "en");
 186.369 +@@ -197,20 +234,20 @@ static int GetCupsPrinters(char ***print
 186.370 +    if ((response = cupsDoRequest(http, request, "/")) == NULL)
 186.371 +       goto bugout;
 186.372 +
 186.373 +-   for (attr = response->attrs; attr != NULL; attr = attr->next)
 186.374 ++   for (attr = ippFirstAttribute ( response ); attr != NULL; attr = ippNextAttribute( response ))
 186.375 +    {
 186.376 +       /* Skip leading attributes until we hit a printer. */
 186.377 +-      while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
 186.378 +-         attr = attr->next;
 186.379 ++      while (attr != NULL && ippGetGroupTag( attr ) != IPP_TAG_PRINTER)
 186.380 ++         attr = ippNextAttribute( response );
 186.381 +
 186.382 +       if (attr == NULL)
 186.383 +          break;
 186.384 +
 186.385 +-      while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
 186.386 ++      while (attr != NULL && ippGetGroupTag( attr ) == IPP_TAG_PRINTER)
 186.387 +       {
 186.388 +-         if (strcmp(attr->name, "device-uri") == 0 && attr->value_tag == IPP_TAG_URI && AddCupsList(attr->values[0].string.text, printer) == 0)
 186.389 ++         if (strcmp(ippGetName( attr ), "device-uri") == 0 && ippGetValueTag( attr ) == IPP_TAG_URI && AddCupsList(ippGetString( attr, 0, NULL ), printer) == 0)
 186.390 +             cnt++;
 186.391 +-         attr = attr->next;
 186.392 ++         attr = ippNextAttribute( response );
 186.393 +       }
 186.394 +
 186.395 +       if (attr == NULL)
   187.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   187.2 +++ b/hplip/stuff/patches/hplip-3.9.4b-glibc210.u	Thu May 10 21:12:00 2018 +0300
   187.3 @@ -0,0 +1,22 @@
   187.4 +--- prnt/hpijs/registry.cpp.orig	2009-04-29 22:41:07.000000000 +0200
   187.5 ++++ prnt/hpijs/registry.cpp	2009-06-02 14:17:09.000000000 +0200
   187.6 +@@ -292,7 +292,7 @@ DRIVER_ERROR DeviceRegistry::SelectDevic
   187.7 +             device = eDJ3320;
   187.8 +             match = TRUE;
   187.9 +         }
  187.10 +-		char	*cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:");
  187.11 ++		const char	*cmdStr = strstr ((const char *) DevIDBuffer+2, "CMD:");
  187.12 + 		if (!cmdStr)
  187.13 + 		{
  187.14 + 			cmdStr = strstr ((const char *) DevIDBuffer+2, "COMMAND SET:");
  187.15 +--- prnt/hpijs/dj3320.cpp.orig	2009-04-29 22:41:07.000000000 +0200
  187.16 ++++ prnt/hpijs/dj3320.cpp	2009-06-02 14:32:21.000000000 +0200
  187.17 +@@ -429,7 +429,7 @@ DISPLAY_STATUS DJ3320::ParseError (BYTE
  187.18 +             pLDLEncap->bNewStatus = FALSE;
  187.19 + 
  187.20 +             // First 10 bytes of m_pbyReadBuff are packet header.  Status query from printer has $S:
  187.21 +-            if ((pcStr = strstr((const char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL)
  187.22 ++            if ((pcStr = strstr((char*)pLDLEncap->byStatusBuff + 10, "$S:")) == NULL)
  187.23 +             {
  187.24 +                 m_dsCurrentStatus = DISPLAY_COMM_PROBLEM;
  187.25 +                 return DISPLAY_COMM_PROBLEM;
   188.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   188.2 +++ b/hplip/stuff/patches/hplip-cups-1.5.0-compatibility.patch	Thu May 10 21:12:00 2018 +0300
   188.3 @@ -0,0 +1,9 @@
   188.4 +--- hplip-3.11.7~/prnt/hpps/hppsfilter.c	2011-07-24 18:58:05.000000000 +0000
   188.5 ++++ hplip-3.11.7/prnt/hpps/hppsfilter.c	2011-08-09 20:51:54.150214165 +0000
   188.6 +@@ -38,6 +38,7 @@
   188.7 + #include <unistd.h>
   188.8 + #include <fcntl.h>
   188.9 + #include <cups/cups.h>
  188.10 ++#include <cups/ppd.h>
  188.11 + #include <sys/types.h>
  188.12 + #include <sys/stat.h>
   189.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   189.2 +++ b/hplip/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   189.3 @@ -0,0 +1,2 @@
   189.4 +# fix build with cups 1.6 - FC hplip-ipp-accessors.patch
   189.5 +cups-1.6-buildfix.diff
   190.1 --- a/html2text/receipt	Wed May 09 17:03:28 2018 +0300
   190.2 +++ b/html2text/receipt	Thu May 10 21:12:00 2018 +0300
   190.3 @@ -16,9 +16,6 @@
   190.4  # Rules to configure and make the package.
   190.5  compile_rules()
   190.6  {
   190.7 -	# http://www.mbayer.de/html2text/downloads/patch-utf8-html2text-1.3.2a.diff
   190.8 -	patch -p1 -i $stuff/patch-utf8-html2text-1.3.2a.diff
   190.9 -
  190.10  	./configure $CONFIGURE_ARGS
  190.11  	sed -i 's|/usr/local/bin|/usr/bin|; s|/usr/local/man|/usr/share/man|;
  190.12  		s|$(BINDIR)|$(DESTDIR)&|; s|$(MANDIR)|$(DESTDIR)&|; s|$(DOCDIR)|$(DESTDIR)&|' \
   191.1 --- a/html2text/stuff/patch-utf8-html2text-1.3.2a.diff	Wed May 09 17:03:28 2018 +0300
   191.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   191.3 @@ -1,706 +0,0 @@
   191.4 -diff -r -u -bB html2text-1.3.2a/Area.C html2text-1.3.2a-patched/Area.C
   191.5 ---- html2text-1.3.2a/Area.C	2003-11-23 12:05:29.000000000 +0100
   191.6 -+++ html2text-1.3.2a-patched/Area.C	2005-05-13 22:19:59.862137688 +0200
   191.7 -@@ -36,10 +36,13 @@
   191.8 - #include <iostream>
   191.9 - 
  191.10 - #include "Area.h"
  191.11 -+#include "html.h"
  191.12 - #include "string.h"
  191.13 - 
  191.14 - #define LATIN1_nbsp 160
  191.15 - 
  191.16 -+extern int use_encoding;
  191.17 -+
  191.18 - /* ------------------------------------------------------------------------- */
  191.19 - 
  191.20 - #define malloc_array(type, size)\
  191.21 -@@ -81,6 +84,27 @@
  191.22 - 
  191.23 - /* ------------------------------------------------------------------------- */
  191.24 - 
  191.25 -+/*           utf_length() and utf_width()       
  191.26 -+ *
  191.27 -+ *     Very simplified algorithm of calculating length of UTF-8
  191.28 -+ *   string. No check for errors. Counting only ASCII bytes and
  191.29 -+ *   leading bytes of UTF-8 multibyte sequences. All bytes like
  191.30 -+ *   10xxxxxx are dropped. If USE_UTF8 is false then returns
  191.31 -+ *   usual length.               --YS
  191.32 -+ */
  191.33 -+
  191.34 -+unsigned int
  191.35 -+Line::utf_length(size_type f, size_type t) const
  191.36 -+{
  191.37 -+  size_type m = (t < length_ ? t : length_);
  191.38 -+  size_type r = m - f;
  191.39 -+  if(USE_UTF8) {
  191.40 -+      for (int i = f; i < m; i++)
  191.41 -+        if((cells_[i].character & 0xc0) == 0x80) r--;
  191.42 -+  }
  191.43 -+  return r;
  191.44 -+}
  191.45 -+
  191.46 - void
  191.47 - Line::resize(size_type l)
  191.48 - {
  191.49 -@@ -236,6 +260,23 @@
  191.50 -   return *this;
  191.51 - }
  191.52 - 
  191.53 -+unsigned int
  191.54 -+Area::utf_width()
  191.55 -+{
  191.56 -+  size_type r = width_;
  191.57 -+  if(USE_UTF8) { r = 0;
  191.58 -+    for (size_type yy = 0; yy < height_; yy++) {
  191.59 -+      size_type r1 = 0;
  191.60 -+      for (int i = width_ - 1; i >= 0; i--) {
  191.61 -+        if(!r1 && isspace(cells_[yy][i].character)) continue;
  191.62 -+        if((cells_[yy][i].character & 0xc0) != 0x80) r1++;
  191.63 -+      }
  191.64 -+      if(r < r1) r = r1;
  191.65 -+    }
  191.66 -+  }
  191.67 -+  return r;
  191.68 -+}
  191.69 -+
  191.70 - void
  191.71 - Area::resize(size_type w, size_type h)
  191.72 - {
  191.73 -@@ -439,7 +480,7 @@
  191.74 -       char c = p->character;
  191.75 -       char a = p->attribute;
  191.76 - 
  191.77 --      if (c == (char) LATIN1_nbsp) c = ' ';
  191.78 -+      if (c == (char) LATIN1_nbsp && !USE_UTF8) c = ' ';
  191.79 - 
  191.80 -       if (a == Cell::NONE) {
  191.81 -         os << c;
  191.82 -Nur in html2text-1.3.2a-patched/: Area.C.orig.
  191.83 -diff -r -u -bB html2text-1.3.2a/Area.h html2text-1.3.2a-patched/Area.h
  191.84 ---- html2text-1.3.2a/Area.h	2003-11-23 12:05:29.000000000 +0100
  191.85 -+++ html2text-1.3.2a-patched/Area.h	2005-05-13 22:19:59.863137536 +0200
  191.86 -@@ -81,6 +81,8 @@
  191.87 -   Cell       &operator[](size_type x)       { return cells_[x]; }
  191.88 -   const Cell *cells() const { return cells_; }
  191.89 - 
  191.90 -+  unsigned int utf_length(size_type f, size_type t) const;
  191.91 -+
  191.92 -   void resize(size_type l);
  191.93 -   void enlarge(size_type l) { if (l > length_) resize(l); }
  191.94 - 
  191.95 -@@ -134,6 +136,8 @@
  191.96 -   Cell       *operator[](size_type y)       { return cells_[y]; }
  191.97 -   const Area &operator>>=(size_type rs);
  191.98 - 
  191.99 -+  unsigned int utf_width();
 191.100 -+
 191.101 -   void resize(size_type w, size_type h);
 191.102 -   void enlarge(size_type w, size_type h);
 191.103 - 
 191.104 -Nur in html2text-1.3.2a-patched/: Area.h.orig.
 191.105 -diff -r -u -bB html2text-1.3.2a/format.C html2text-1.3.2a-patched/format.C
 191.106 ---- html2text-1.3.2a/format.C	2003-11-23 12:05:29.000000000 +0100
 191.107 -+++ html2text-1.3.2a-patched/format.C	2005-05-13 22:19:59.865137232 +0200
 191.108 -@@ -1210,6 +1210,7 @@
 191.109 -     }
 191.110 - 
 191.111 -     Line::size_type to = from + 1;
 191.112 -+    int to_from;
 191.113 - 
 191.114 -     Line::size_type lbp = (Line::size_type) -1; // "Last break position".
 191.115 - 
 191.116 -@@ -1238,18 +1239,20 @@
 191.117 -         to++;
 191.118 -       }
 191.119 - 
 191.120 --      if (to - from > w && lbp != (Area::size_type) -1) { to = lbp; break; }
 191.121 -+      if (line.utf_length(from,to) > w && lbp != (Area::size_type) -1) 
 191.122 -+                    { to = lbp; break; }
 191.123 -     }
 191.124 - 
 191.125 -+    to_from = line.utf_length(from,to);
 191.126 -     /*
 191.127 -      * Copy the "from...to" range from the "line" to the bottom of the "res"
 191.128 -      * Area.
 191.129 -      */
 191.130 -     Area::size_type x = 0;
 191.131 -     Area::size_type len = to - from;
 191.132 --    if (halign == Area::LEFT || len >= w) { ;                   } else
 191.133 --    if (halign == Area::CENTER)           { x += (w - len) / 2; } else
 191.134 --    if (halign == Area::RIGHT)            { x += w - len;       }
 191.135 -+    if (halign == Area::LEFT || to_from >= w) { ;                   } else
 191.136 -+    if (halign == Area::CENTER)           { x += (w - to_from) / 2; } else
 191.137 -+    if (halign == Area::RIGHT)            { x += w - to_from;       }
 191.138 -     res->insert(line.cells() + from, len, x, res->height());
 191.139 - 
 191.140 -     /*
 191.141 -Nur in html2text-1.3.2a-patched/: format.C.orig.
 191.142 -diff -r -u -bB html2text-1.3.2a/html2text.C html2text-1.3.2a-patched/html2text.C
 191.143 ---- html2text-1.3.2a/html2text.C	2003-11-23 12:05:29.000000000 +0100
 191.144 -+++ html2text-1.3.2a-patched/html2text.C	2005-05-13 22:19:59.868136776 +0200
 191.145 -@@ -148,9 +148,10 @@
 191.146 -   -o <file>      Redirect output into <file>\n\
 191.147 -   -nobs          Do not use backspaces for boldface and underlining\n\
 191.148 -   -ascii         Use plain ASCII for output instead of ISO-8859-1\n\
 191.149 -+  -utf8          Assume both terminal and input stream are in UTF-8 mode\n\
 191.150 - ";
 191.151 - 
 191.152 --int use_iso8859 = 1;
 191.153 -+int use_encoding = ISO8859;
 191.154 - 
 191.155 - int
 191.156 - main(int argc, char **argv)
 191.157 -@@ -199,7 +200,8 @@
 191.158 -     if (!strcmp(arg, "-width"        )) { width = atoi(argv[++i]);       } else
 191.159 -     if (!strcmp(arg, "-o"            )) { output_file_name = argv[++i];  } else
 191.160 -     if (!strcmp(arg, "-nobs"         )) { use_backspaces = false;        } else
 191.161 --    if (!strcmp(arg, "-ascii"        )) { use_iso8859 = false;           } else
 191.162 -+    if (!strcmp(arg, "-ascii"        )) { use_encoding = ASCII;          } else
 191.163 -+    if (!strcmp(arg, "-utf8"         )) { use_encoding = UTF8;           } else
 191.164 -     {
 191.165 -       std::cerr
 191.166 - 	<< "Unrecognized command line option \""
 191.167 -Nur in html2text-1.3.2a-patched/: html2text.C.orig.
 191.168 -diff -r -u -bB html2text-1.3.2a/html.h html2text-1.3.2a-patched/html.h
 191.169 ---- html2text-1.3.2a/html.h	2001-10-04 22:03:54.000000000 +0200
 191.170 -+++ html2text-1.3.2a-patched/html.h	2005-05-13 22:19:59.866137080 +0200
 191.171 -@@ -61,6 +61,11 @@
 191.172 - 
 191.173 - /* ------------------------------------------------------------------------- */
 191.174 - 
 191.175 -+enum {ASCII, ISO8859, UTF8};
 191.176 -+#define USE_ISO8859 (use_encoding == ISO8859)
 191.177 -+#define USE_ASCII (use_encoding == ASCII)
 191.178 -+#define USE_UTF8 (use_encoding == UTF8)
 191.179 -+
 191.180 - #define LATIN1_nbsp   160
 191.181 - #define LATIN1_iexcl  161
 191.182 - #define LATIN1_cent   162
 191.183 -diff -r -u -bB html2text-1.3.2a/sgml.C html2text-1.3.2a-patched/sgml.C
 191.184 ---- html2text-1.3.2a/sgml.C	2003-11-23 12:09:11.000000000 +0100
 191.185 -+++ html2text-1.3.2a-patched/sgml.C	2005-05-13 22:19:59.870136472 +0200
 191.186 -@@ -62,261 +62,280 @@
 191.187 -   char name[8];
 191.188 -   int  iso8859code;
 191.189 -   char *asciistr;
 191.190 -+  unsigned long unicode;
 191.191 - } entities[] = {
 191.192 --  { "AElig",   LATIN1_AElig,  "AE"         },
 191.193 --  { "AMP",     0,             "&"          },
 191.194 --  { "Aacute",  LATIN1_Aacute, "A'"         },
 191.195 --  { "Acirc",   LATIN1_Acirc,  "A^"         },
 191.196 --  { "Agrave",  LATIN1_Agrave, "A`"         },
 191.197 --  { "Alpha",   0,             "A"          },
 191.198 --  { "Aring",   LATIN1_Aring,  "AA"         },
 191.199 --  { "Atilde",  LATIN1_Atilde, "A~"         },
 191.200 --  { "Auml",    LATIN1_Auml,   "A\""        },
 191.201 --  { "Beta",    0,             "B"          },
 191.202 --  { "Ccedil",  LATIN1_Ccedil, "C,"         },
 191.203 --  { "Chi",     0,             "H"          },
 191.204 --  { "Dagger",  0,             "++"         },
 191.205 --  { "Delta",   0,             "D"          },
 191.206 --  { "ETH",     LATIN1_ETH,    "D-"         },
 191.207 --  { "Eacute",  LATIN1_Eacute, "E'"         },
 191.208 --  { "Ecirc",   LATIN1_Ecirc,  "E^"         },
 191.209 --  { "Egrave",  LATIN1_Egrave, "E`"         },
 191.210 --  { "Epsilon", 0,             "E"          },
 191.211 --  { "Eta",     0,             "E"          },
 191.212 --  { "Euml",    LATIN1_Euml,   "E\""        },
 191.213 --  { "GT",      0,             ">"          },
 191.214 --  { "Gamma",   0,             "G"          },
 191.215 --  { "Iacute",  LATIN1_Iacute, "I'"         },
 191.216 --  { "Icirc",   LATIN1_Icirc,  "I^"         },
 191.217 --  { "Igrave",  LATIN1_Igrave, "I`"         },
 191.218 --  { "Iota",    0,             "I"          },
 191.219 --  { "Iuml",    LATIN1_Iuml,   "I\""        },
 191.220 --  { "Kappa",   0,             "K"          },
 191.221 --  { "LT",      0,             "<"          },
 191.222 --  { "Lambda",  0,             "L"          },
 191.223 --  { "Mu",      0,             "M"          },
 191.224 --  { "Ntilde",  LATIN1_Ntilde, "N~"         },
 191.225 --  { "Nu",      0,             "N"          },
 191.226 --  { "OElig",   0,             "OE"         },
 191.227 --  { "Oacute",  LATIN1_Oacute, "O'"         },
 191.228 --  { "Ocirc",   LATIN1_Ocirc,  "O^"         },
 191.229 --  { "Ograve",  LATIN1_Ograve, "O`"         },
 191.230 --  { "Omega",   0,             "O"          },
 191.231 --  { "Omicron", 0,             "O"          },
 191.232 --  { "Oslash",  LATIN1_Oslash, "O/"         },
 191.233 --  { "Otilde",  LATIN1_Otilde, "O~"         },
 191.234 --  { "Ouml",    LATIN1_Ouml,   "O\""        },
 191.235 --  { "Phi",     0,             "F"          },
 191.236 --  { "Pi",      0,             "P"          },
 191.237 --  { "Prime",   0,             "''"         },
 191.238 --  { "Psi",     0,             "PS"         },
 191.239 --  { "QUOT",    0,             "\""         },
 191.240 --  { "Rho",     0,             "R"          },
 191.241 --  { "Scaron",  0,             "S"          },
 191.242 --  { "Sigma",   0,             "S"          },
 191.243 --  { "THORN",   LATIN1_THORN,  "TH"         },
 191.244 --  { "Tau",     0,             "T"          },
 191.245 --  { "Theta",   0,             "TH"         },
 191.246 --  { "Uacute",  LATIN1_Uacute, "U'"         },
 191.247 --  { "Ucirc",   LATIN1_Ucirc,  "U^"         },
 191.248 --  { "Ugrave",  LATIN1_Ugrave, "U`"         },
 191.249 --  { "Upsilon", 0,             "U"          },
 191.250 --  { "Uuml",    LATIN1_Uuml,   "U\""        },
 191.251 --  { "Xi",      0,             "X"          },
 191.252 --  { "Yacute",  LATIN1_Yacute, "Y'"         },
 191.253 --  { "Yuml",    0,             "Y\""        },
 191.254 --  { "Zeta",    0,             "Z"          },
 191.255 --  { "aacute",  LATIN1_aacute, "a'"         },
 191.256 --  { "acirc",   LATIN1_acirc,  "a^"         },
 191.257 --  { "acute",   LATIN1_acute,  "'"          },
 191.258 --  { "aelig",   LATIN1_aelig,  "ae"         },
 191.259 --  { "agrave",  LATIN1_agrave, "a`"         },
 191.260 -+  { "AElig",   LATIN1_AElig,  "AE",  0x00c6},
 191.261 -+  { "AMP",     0,             "&",   0x0026},
 191.262 -+  { "Aacute",  LATIN1_Aacute, "A'",  0x00c1},
 191.263 -+  { "Acirc",   LATIN1_Acirc,  "A^",  0x00c2},
 191.264 -+  { "Agrave",  LATIN1_Agrave, "A`",  0x00c0},
 191.265 -+  { "Alpha",   0,             "A",   0x0391},
 191.266 -+  { "Aring",   LATIN1_Aring,  "AA",  0x00c5},
 191.267 -+  { "Atilde",  LATIN1_Atilde, "A~",  0x00c3},
 191.268 -+  { "Auml",    LATIN1_Auml,   "A\"", 0x00c4},
 191.269 -+  { "Beta",    0,             "B",   0x0392},
 191.270 -+  { "Ccedil",  LATIN1_Ccedil, "C,",  0x00c7},
 191.271 -+  { "Chi",     0,             "H",   0x03a7},
 191.272 -+  { "Dagger",  0,             "++",  0x2020},
 191.273 -+  { "Delta",   0,             "D",   0x0394},
 191.274 -+  { "ETH",     LATIN1_ETH,    "D-",  0x00d0},
 191.275 -+  { "Eacute",  LATIN1_Eacute, "E'",  0x00c9},
 191.276 -+  { "Ecirc",   LATIN1_Ecirc,  "E^",  0x00ca},
 191.277 -+  { "Egrave",  LATIN1_Egrave, "E`",  0x00c8},
 191.278 -+  { "Epsilon", 0,             "E",   0x0395},
 191.279 -+  { "Eta",     0,             "E",   0x0397},
 191.280 -+  { "Euml",    LATIN1_Euml,   "E\"", 0x00cb},
 191.281 -+  { "GT",      0,             ">",   0x003e},
 191.282 -+  { "Gamma",   0,             "G",   0x0393},
 191.283 -+  { "Iacute",  LATIN1_Iacute, "I'",  0x00cd},
 191.284 -+  { "Icirc",   LATIN1_Icirc,  "I^",  0x00ce},
 191.285 -+  { "Igrave",  LATIN1_Igrave, "I`",  0x00cc},
 191.286 -+  { "Iota",    0,             "I",   0x0399},
 191.287 -+  { "Iuml",    LATIN1_Iuml,   "I\"", 0x00cf},
 191.288 -+  { "Kappa",   0,             "K",   0x039a},
 191.289 -+  { "LT",      0,             "<",   0x003c},
 191.290 -+  { "Lambda",  0,             "L",   0x039b},
 191.291 -+  { "Mu",      0,             "M",   0x039c},
 191.292 -+  { "Ntilde",  LATIN1_Ntilde, "N~",  0x00d1},
 191.293 -+  { "Nu",      0,             "N",   0x039d},
 191.294 -+  { "OElig",   0,             "OE",  0x0152},
 191.295 -+  { "Oacute",  LATIN1_Oacute, "O'",  0x00d3},
 191.296 -+  { "Ocirc",   LATIN1_Ocirc,  "O^",  0x00d4},
 191.297 -+  { "Ograve",  LATIN1_Ograve, "O`",  0x00d2},
 191.298 -+  { "Omega",   0,             "O",   0x03a9},
 191.299 -+  { "Omicron", 0,             "O",   0x039f},
 191.300 -+  { "Oslash",  LATIN1_Oslash, "O/",  0x00d8},
 191.301 -+  { "Otilde",  LATIN1_Otilde, "O~",  0x00d5},
 191.302 -+  { "Ouml",    LATIN1_Ouml,   "O\"", 0x00d6},
 191.303 -+  { "Phi",     0,             "F",   0x03a6},
 191.304 -+  { "Pi",      0,             "P",   0x03a0},
 191.305 -+  { "Prime",   0,             "''",        },
 191.306 -+  { "Psi",     0,             "PS",  0x03a8},
 191.307 -+  { "QUOT",    0,             "\"",        },
 191.308 -+  { "Rho",     0,             "R",   0x03a1},
 191.309 -+  { "Scaron",  0,             "S",   0x0161},
 191.310 -+  { "Sigma",   0,             "S",   0x03a3},
 191.311 -+  { "THORN",   LATIN1_THORN,  "TH",  0x00de},
 191.312 -+  { "Tau",     0,             "T",   0x03a4},
 191.313 -+  { "Theta",   0,             "TH",  0x0398},
 191.314 -+  { "Uacute",  LATIN1_Uacute, "U'",  0x00da},
 191.315 -+  { "Ucirc",   LATIN1_Ucirc,  "U^",  0x00db},
 191.316 -+  { "Ugrave",  LATIN1_Ugrave, "U`",  0x00d9},
 191.317 -+  { "Upsilon", 0,             "U",   0x03a5},
 191.318 -+  { "Uuml",    LATIN1_Uuml,   "U\"", 0x00dc},
 191.319 -+  { "Xi",      0,             "X",   0x039e},
 191.320 -+  { "Yacute",  LATIN1_Yacute, "Y'",  0x00dd},
 191.321 -+  { "Yuml",    0,             "Y\"", 0x0178},
 191.322 -+  { "Zeta",    0,             "Z",   0x0396},
 191.323 -+  { "aacute",  LATIN1_aacute, "a'",  0x00e1},
 191.324 -+  { "acirc",   LATIN1_acirc,  "a^",  0x00e2},
 191.325 -+  { "acute",   LATIN1_acute,  "'",   0x00b4},
 191.326 -+  { "aelig",   LATIN1_aelig,  "ae",  0x00e6},
 191.327 -+  { "agrave",  LATIN1_agrave, "a`",  0x00e0},
 191.328 -   { "alefsym", 0,             "Aleph"      },
 191.329 --  { "alpha",   0,             "a"          },
 191.330 -+  { "alpha",   0,             "a",   0x03b1},
 191.331 -   { "amp",     0,             "&"          },
 191.332 -   { "and",     0,             "AND"        },
 191.333 -   { "ang",     0,             "-V"         },
 191.334 -   { "apos",    0,             "'"          },
 191.335 --  { "aring",   LATIN1_aring,  "aa"         },
 191.336 --  { "asymp",   0,             "~="         },
 191.337 --  { "atilde",  LATIN1_atilde, "a~"         },
 191.338 --  { "auml",    LATIN1_auml,   "a\""        },
 191.339 -+  { "aring",   LATIN1_aring,  "aa",  0x00e5},
 191.340 -+  { "asymp",   0,             "~=",  0x2248},
 191.341 -+  { "atilde",  LATIN1_atilde, "a~",  0x00e3},
 191.342 -+  { "auml",    LATIN1_auml,   "a\"", 0x00e5},
 191.343 -   { "bdquo",   0,             "\""         },
 191.344 --  { "beta",    0,             "b"          },
 191.345 --  { "brvbar",  LATIN1_brvbar, "|"          },
 191.346 --  { "bull",    0,             " o "        },
 191.347 -+  { "beta",    0,             "b",   0x03b2},
 191.348 -+  { "brvbar",  LATIN1_brvbar, "|",   0x00a6},
 191.349 -+  { "bull",    0,             " o ", 0x2022},
 191.350 -   { "cap",     0,             "(U"         },
 191.351 --  { "ccedil",  LATIN1_ccedil, "c,"         },
 191.352 --  { "cedil",   LATIN1_cedil,  ","          },
 191.353 --  { "cent",    LATIN1_cent,   "-c-"        },
 191.354 --  { "chi",     0,             "h"          },
 191.355 --  { "circ",    0,             "^"          },
 191.356 -+  { "ccedil",  LATIN1_ccedil, "c,",  0x00e7},
 191.357 -+  { "cedil",   LATIN1_cedil,  ",",   0x00b8},
 191.358 -+  { "cent",    LATIN1_cent,   "-c-", 0x00a2},
 191.359 -+  { "chi",     0,             "h",   0x03c7},
 191.360 -+  { "circ",    0,             "^",   0x005e},
 191.361 - //  { "clubs",   0,             "[clubs]"    },
 191.362 -   { "cong",    0,             "?="         },
 191.363 --  { "copy",    LATIN1_copy,   "(c)"        },
 191.364 -+  { "copy",    LATIN1_copy,   "(c)", 0x00a9},
 191.365 -   { "crarr",   0,             "<-'"        },
 191.366 -   { "cup",     0,             ")U"         },
 191.367 --  { "curren",  LATIN1_curren, "CUR"        },
 191.368 -+  { "curren",  LATIN1_curren, "CUR", 0x00a4},
 191.369 -   { "dArr",    0,             "vv"         },
 191.370 --  { "dagger",  0,             "+"          },
 191.371 -+  { "dagger",  0,             "+",   0x2020},
 191.372 -   { "darr",    0,             "v"          },
 191.373 --  { "deg",     LATIN1_deg,    "DEG"        },
 191.374 --  { "delta",   0,             "d"          },
 191.375 -+  { "deg",     LATIN1_deg,    "DEG", 0x00b0},
 191.376 -+  { "delta",   0,             "d",   0x03b4},
 191.377 - //  { "diams",   0,             "[diamonds]" },
 191.378 --  { "divide",  LATIN1_divide, "/"          },
 191.379 --  { "eacute",  LATIN1_eacute, "e'"         },
 191.380 --  { "ecirc",   LATIN1_ecirc,  "e^"         },
 191.381 --  { "egrave",  LATIN1_egrave, "e`"         },
 191.382 -+  { "divide",  LATIN1_divide, "/",   0x00f7},
 191.383 -+  { "eacute",  LATIN1_eacute, "e'",  0x00e9},
 191.384 -+  { "ecirc",   LATIN1_ecirc,  "e^",  0x00ea},
 191.385 -+  { "egrave",  LATIN1_egrave, "e`",  0x00e8},
 191.386 -   { "empty",   0,             "{}"         },
 191.387 --  { "epsilon", 0,             "e"          },
 191.388 --  { "equiv",   0,             "=="         },
 191.389 --  { "eta",     0,             "e"          },
 191.390 --  { "eth",     LATIN1_eth,    "d-"         },
 191.391 --  { "euml",    LATIN1_euml,   "e\""        },
 191.392 --  { "euro",    0,             "EUR"        },
 191.393 -+  { "epsilon", 0,             "e",   0x03b5},
 191.394 -+  { "equiv",   0,             "==",  0x2261},
 191.395 -+  { "eta",     0,             "e",   0x03b7},
 191.396 -+  { "eth",     LATIN1_eth,    "d-",  0x00f0},
 191.397 -+  { "euml",    LATIN1_euml,   "e\"", 0x00eb},
 191.398 -+  { "euro",    0,             "EUR", 0x20ac},
 191.399 -   { "exist",   0,             "TE"         },
 191.400 -   { "fnof",    0,             "f"          },
 191.401 -   { "forall",  0,             "FA"         },
 191.402 --  { "frac12",  LATIN1_frac12, " 1/2"       },
 191.403 --  { "frac14",  LATIN1_frac14, " 1/4"       },
 191.404 --  { "frac34",  LATIN1_frac34, " 3/4"       },
 191.405 -+  { "frac12",  LATIN1_frac12, " 1/2",0x00bd},
 191.406 -+  { "frac14",  LATIN1_frac14, " 1/4",0x00bc},
 191.407 -+  { "frac34",  LATIN1_frac34, " 3/4",0x00be},
 191.408 -   { "frasl",   0,             "/"          },
 191.409 --  { "gamma",   0,             "g"          },
 191.410 --  { "ge",      0,             ">="         },
 191.411 --  { "gt",      0,             ">"          },
 191.412 -+  { "gamma",   0,             "g",   0x03b3},
 191.413 -+  { "ge",      0,             ">=",  0x2265},
 191.414 -+  { "gt",      0,             ">",   0x003e},
 191.415 -   { "hArr",    0,             "<=>"        },
 191.416 -   { "harr",    0,             "<->"        },
 191.417 - //  { "hearts",  0,             "[hearts]"   },
 191.418 --  { "hellip",  0,             "..."        },
 191.419 --  { "iacute",  LATIN1_iacute, "i'"         },
 191.420 --  { "icirc",   LATIN1_icirc,  "i^"         },
 191.421 --  { "iexcl",   LATIN1_iexcl,  "!"          },
 191.422 --  { "igrave",  LATIN1_igrave, "i`"         },
 191.423 -+  { "hellip",  0,             "...", 0x2026},
 191.424 -+  { "iacute",  LATIN1_iacute, "i'",  0x00ed},
 191.425 -+  { "icirc",   LATIN1_icirc,  "i^",  0x00ee},
 191.426 -+  { "iexcl",   LATIN1_iexcl,  "!",   0x00a1},
 191.427 -+  { "igrave",  LATIN1_igrave, "i`",  0x00ec},
 191.428 -   { "image",   0,             "Im"         },
 191.429 --  { "infin",   0,             "oo"         },
 191.430 --  { "int",     0,             "INT"        },
 191.431 --  { "iota",    0,             "i"          },
 191.432 --  { "iquest",  LATIN1_iquest, "?"          },
 191.433 -+  { "infin",   0,             "oo",  0x221e},
 191.434 -+  { "int",     0,             "INT", 0x222b},
 191.435 -+  { "iota",    0,             "i",   0x03b9},
 191.436 -+  { "iquest",  LATIN1_iquest, "?",   0x00bf},
 191.437 -   { "isin",    0,             "(-"         },
 191.438 --  { "iuml",    LATIN1_iuml,   "i\""        },
 191.439 --  { "kappa",   0,             "k"          },
 191.440 -+  { "iuml",    LATIN1_iuml,   "i\"", 0x00ef},
 191.441 -+  { "kappa",   0,             "k",   0x03ba},
 191.442 -   { "lArr",    0,             "<="         },
 191.443 --  { "lambda",  0,             "l"          },
 191.444 -+  { "lambda",  0,             "l",   0x03bb},
 191.445 -   { "lang",    0,             "</"         },
 191.446 -   { "laquo",   LATIN1_laquo,  "<<"         },
 191.447 --  { "larr",    0,             "<-"         },
 191.448 -+  { "larr",    0,             "<-",  0x2190},
 191.449 - //  { "lceil",   0,             "<|"         },
 191.450 -   { "ldquo",   0,             "\""         },
 191.451 --  { "le",      0,             "<="         },
 191.452 -+  { "le",      0,             "<=",  0x2264},
 191.453 - //  { "lfloor",  0,             "|<"         },
 191.454 -   { "lowast",  0,             "*"          },
 191.455 -   { "loz",     0,             "<>"         },
 191.456 -   { "lsaquo",  0,             "<"          },
 191.457 -   { "lsquo",   0,             "`"          },
 191.458 --  { "lt",      0,             "<"          },
 191.459 --  { "macr",    LATIN1_macr,   "-"          },
 191.460 -+  { "lt",      0,             "<",   0x003c},
 191.461 -+  { "macr",    LATIN1_macr,   "-",   0x00af},
 191.462 -   { "mdash",   0,             "--"         },
 191.463 --  { "micro",   LATIN1_micro,  "my"         },
 191.464 --  { "middot",  LATIN1_middot, "."          },
 191.465 --  { "minus",   0,             "-"          },
 191.466 --  { "mu",      0,             "m"          },
 191.467 -+  { "micro",   LATIN1_micro,  "my",  0x00b5},
 191.468 -+  { "middot",  LATIN1_middot, ".",   0x00b7},
 191.469 -+  { "minus",   0,             "-",   0x2212},
 191.470 -+  { "mu",      0,             "m",   0x03bc},
 191.471 -   { "nabla",   0,             "Nabla"      },
 191.472 --  { "nbsp",    LATIN1_nbsp,   " "          },
 191.473 -+  { "nbsp",    LATIN1_nbsp,   " ",   0x00a0},
 191.474 -   { "ndash",   0,             "-"          },
 191.475 --  { "ne",      0,             "!="         },
 191.476 -+  { "ne",      0,             "!=",  0x2260},
 191.477 -   { "ni",      0,             "-)"         },
 191.478 -   { "not",     LATIN1_not,    "NOT"        },
 191.479 -   { "notin",   0,             "!(-"        },
 191.480 -   { "nsub",    0,             "!(C"        },
 191.481 --  { "ntilde",  LATIN1_ntilde, "n~"         },
 191.482 --  { "nu",      0,             "n"          },
 191.483 --  { "oacute",  LATIN1_oacute, "o'"         },
 191.484 --  { "ocirc",   LATIN1_ocirc,  "o^"         },
 191.485 -+  { "ntilde",  LATIN1_ntilde, "n~",  0x00f1},
 191.486 -+  { "nu",      0,             "n",   0x03bd},
 191.487 -+  { "oacute",  LATIN1_oacute, "o'",  0x00f3},
 191.488 -+  { "ocirc",   LATIN1_ocirc,  "o^",  0x00f4},
 191.489 -   { "oelig",   0,             "oe"         },
 191.490 --  { "ograve",  LATIN1_ograve, "o`"         },
 191.491 -+  { "ograve",  LATIN1_ograve, "o`",  0x00f2},
 191.492 -   { "oline",   LATIN1_macr,   "-"          },
 191.493 --  { "omega",   0,             "o"          },
 191.494 --  { "omicron", 0,             "o"          },
 191.495 -+  { "omega",   0,             "o",   0x03c9},
 191.496 -+  { "omicron", 0,             "o",   0x03bf},
 191.497 -   { "oplus",   0,             "(+)"        },
 191.498 -   { "or",      0,             "OR"         },
 191.499 --  { "ordf",    LATIN1_ordf,   "-a"         },
 191.500 --  { "ordm",    LATIN1_ordm,   "-o"         },
 191.501 --  { "oslash",  LATIN1_oslash, "o/"         },
 191.502 --  { "otilde",  LATIN1_otilde, "o~"         },
 191.503 -+  { "ordf",    LATIN1_ordf,   "-a",  0x00aa},
 191.504 -+  { "ordm",    LATIN1_ordm,   "-o",  0x00ba},
 191.505 -+  { "oslash",  LATIN1_oslash, "o/",  0x00f8},
 191.506 -+  { "otilde",  LATIN1_otilde, "o~",  0x00f5},
 191.507 -   { "otimes",  0,             "(x)"        },
 191.508 --  { "ouml",    LATIN1_ouml,   "o\""        },
 191.509 --  { "para",    LATIN1_para,   "P:"         },
 191.510 --  { "part",    0,             "PART"       },
 191.511 --  { "permil",  0,             " 0/00"      },
 191.512 -+  { "ouml",    LATIN1_ouml,   "o\"", 0x00f6},
 191.513 -+  { "para",    LATIN1_para,   "P:",  0x00b6},
 191.514 -+  { "part",    0,             "PART",0x2202},
 191.515 -+  { "permil",  0,             " 0/00",0x2030},
 191.516 -   { "perp",    0,             "-T"         },
 191.517 --  { "phi",     0,             "f"          },
 191.518 --  { "pi",      0,             "p"          },
 191.519 -+  { "phi",     0,             "f",   0x03c6},
 191.520 -+  { "pi",      0,             "p",   0x03c0},
 191.521 -   { "piv",     0,             "Pi"         },
 191.522 --  { "plusmn",  LATIN1_plusmn, "+/-"        },
 191.523 --  { "pound",   LATIN1_pound,  "-L-"        },
 191.524 -+  { "plusmn",  LATIN1_plusmn, "+/-", 0x00b1},
 191.525 -+  { "pound",   LATIN1_pound,  "-L-", 0x00a3},
 191.526 -   { "prime",   0,             "'"          },
 191.527 --  { "prod",    0,             "PROD"       },
 191.528 -+  { "prod",    0,             "PROD",0x220f},
 191.529 -   { "prop",    0,             "0("         },
 191.530 --  { "psi",     0,             "ps"         },
 191.531 -+  { "psi",     0,             "ps",  0x03c8},
 191.532 -   { "quot",    0,             "\""         },
 191.533 -   { "rArr",    0,             "=>"         },
 191.534 --  { "radic",   0,             "SQRT"       },
 191.535 -+  { "radic",   0,             "SQRT",0x221a},
 191.536 -   { "rang",    0,             "/>"         },
 191.537 -   { "raquo",   LATIN1_raquo,  ">>"         },
 191.538 --  { "rarr",    0,             "->"         },
 191.539 -+  { "rarr",    0,             "->",  0x2192},
 191.540 - //  { "rceil",   0,             ">|"         },
 191.541 -   { "rdquo",   0,             "\""         },
 191.542 -   { "real",    0,             "Re"         },
 191.543 --  { "reg",     LATIN1_reg,    "(R)"        },
 191.544 -+  { "reg",     LATIN1_reg,    "(R)", 0x00ae},
 191.545 - //  { "rfloor",  0,             "|>"         },
 191.546 --  { "rho",     0,             "r"          },
 191.547 -+  { "rho",     0,             "r",   0x03c1},
 191.548 -   { "rsaquo",  0,             ">"          },
 191.549 -   { "rsquo",   0,             "'"          },
 191.550 -   { "sbquo",   0,             "'"          },
 191.551 --  { "scaron",  0,             "s"          },
 191.552 -+  { "scaron",  0,             "s",   0x0161},
 191.553 -   { "sdot",    0,             "DOT"        },
 191.554 --  { "sect",    LATIN1_sect,   "S:"         },
 191.555 -+  { "sect",    LATIN1_sect,   "S:",  0x00a7},
 191.556 -   { "shy",     LATIN1_shy,    ""           },
 191.557 --  { "sigma",   0,             "s"          },
 191.558 --  { "sigmaf",  0,             "s"          },
 191.559 -+  { "sigma",   0,             "s",   0x03c3},
 191.560 -+  { "sigmaf",  0,             "s",   0x03c2},
 191.561 -   { "sim",     0,             "~"          },
 191.562 - //  { "spades",  0,             "[spades]"   },
 191.563 -   { "sub",     0,             "(C"         },
 191.564 -   { "sube",    0,             "(_"         },
 191.565 --  { "sum",     0,             "SUM"        },
 191.566 -+  { "sum",     0,             "SUM", 0x2211},
 191.567 -   { "sup",     0,             ")C"         },
 191.568 --  { "sup1",    LATIN1_sup1,   "^1"         },
 191.569 --  { "sup2",    LATIN1_sup2,   "^2"         },
 191.570 --  { "sup3",    LATIN1_sup3,   "^3"         },
 191.571 -+  { "sup1",    LATIN1_sup1,   "^1",  0x00b9},
 191.572 -+  { "sup2",    LATIN1_sup2,   "^2",  0x00b2},
 191.573 -+  { "sup3",    LATIN1_sup3,   "^3",  0x00b3},
 191.574 -   { "supe",    0,             ")_"         },
 191.575 --  { "szlig",   LATIN1_szlig,  "ss"         },
 191.576 --  { "tau",     0,             "t"          },
 191.577 -+  { "szlig",   LATIN1_szlig,  "ss",  0x00df},
 191.578 -+  { "tau",     0,             "t",   0x03c4},
 191.579 -   { "there4",  0,             ".:"         },
 191.580 --  { "theta",   0,             "th"         },
 191.581 --  { "thorn",   LATIN1_thorn,  "th"         },
 191.582 --  { "tilde",   0,             "~"          },
 191.583 --  { "times",   LATIN1_times,  "x"          },
 191.584 --  { "trade",   0,             "[TM]"       },
 191.585 -+  { "theta",   0,             "th",  0x03b8},
 191.586 -+  { "thorn",   LATIN1_thorn,  "th",  0x00fe},
 191.587 -+  { "tilde",   0,             "~",   0x02dc},
 191.588 -+  { "times",   LATIN1_times,  "x",   0x00d7},
 191.589 -+  { "trade",   0,             "[TM]",0x2122},
 191.590 -   { "uArr",    0,             "^^"         },
 191.591 --  { "uacute",  LATIN1_uacute, "u'"         },
 191.592 -+  { "uacute",  LATIN1_uacute, "u'",  0x00fa},
 191.593 -   { "uarr",    0,             "^"          },
 191.594 --  { "ucirc",   LATIN1_ucirc,  "u^"         },
 191.595 --  { "ugrave",  LATIN1_ugrave, "u`"         },
 191.596 --  { "uml",     LATIN1_uml,    "\""         },
 191.597 --  { "upsilon", 0,             "u"          },
 191.598 --  { "uuml",    LATIN1_uuml,   "u\""        },
 191.599 -+  { "ucirc",   LATIN1_ucirc,  "u^",  0x00fb},
 191.600 -+  { "ugrave",  LATIN1_ugrave, "u`",  0x00f9},
 191.601 -+  { "uml",     LATIN1_uml,    "\"",  0x00a8},
 191.602 -+  { "upsilon", 0,             "u",   0x03c5},
 191.603 -+  { "uuml",    LATIN1_uuml,   "u\"", 0x00fc},
 191.604 -   { "weierp",  0,             "P"          },
 191.605 --  { "xi",      0,             "x"          },
 191.606 --  { "yacute",  LATIN1_yacute, "y'"         },
 191.607 --  { "yen",     LATIN1_yen,    "YEN"        },
 191.608 --  { "yuml",    LATIN1_yuml,   "y\""        },
 191.609 --  { "zeta",    0,             "z"          },
 191.610 -+  { "xi",      0,             "x",   0x03be},
 191.611 -+  { "yacute",  LATIN1_yacute, "y'",  0x00fd},
 191.612 -+  { "yen",     LATIN1_yen,    "YEN", 0x00a5},
 191.613 -+  { "yuml",    LATIN1_yuml,   "y\"", 0x00ff},
 191.614 -+  { "zeta",    0,             "z",   0x03b6},
 191.615 - };
 191.616 - 
 191.617 --extern int use_iso8859;
 191.618 -+extern int use_encoding;
 191.619 - 
 191.620 - /* ------------------------------------------------------------------------- */
 191.621 - 
 191.622 -+char ubuf[4];
 191.623 -+
 191.624 -+char *mkutf(unsigned long x)
 191.625 -+{
 191.626 -+  memset(ubuf, 0, 4);
 191.627 -+  if(x < 128) ubuf[0] = x;
 191.628 -+  else if(x < 0x800) {
 191.629 -+     ubuf[0] = (0xc0 | ((x >> 6) & 0x1f));
 191.630 -+     ubuf[1] = (0x80 | (x & 0x3f));
 191.631 -+  }
 191.632 -+  else {
 191.633 -+     ubuf[0] = (0xe0 | ((x >> 12) & 0x0f));
 191.634 -+     ubuf[1] = (0x80 | ((x >> 6) & 0x3f));
 191.635 -+     ubuf[2] = (0x80 | (x & 0x3f));
 191.636 -+  }
 191.637 -+  return ubuf;
 191.638 -+}
 191.639 -+
 191.640 - void
 191.641 - replace_sgml_entities(string *s)
 191.642 - {
 191.643 -@@ -330,9 +349,9 @@
 191.644 -      */
 191.645 -     while (j < l && s->at(j) != '&') ++j;
 191.646 -     /*
 191.647 --     * We could convert high-bit chars to "&#233;" here if use_iso8859
 191.648 --     * is off, then let them be translated or not.  Is the purpose of
 191.649 --     * !use_iso8859 to allow SGML entities to be seen, or to strongly
 191.650 -+     * We could convert high-bit chars to "&#233;" here if USE_ASCII
 191.651 -+     * is on, then let them be translated or not.  Is the purpose of
 191.652 -+     * USE_ASCII to allow SGML entities to be seen, or to strongly
 191.653 -      * filter against high-ASCII chars that might blow up a terminal
 191.654 -      * that doesn't speak ISO8859?  For the moment, "allow SGML entities
 191.655 -      * to be seen" -- no filtering here.
 191.656 -@@ -370,7 +389,11 @@
 191.657 -           if (!isdigit(c)) break;
 191.658 -           x = 10 * x + c - '0';
 191.659 -         }
 191.660 --        if (use_iso8859 || (x < 128)) {
 191.661 -+        if (USE_UTF8) {
 191.662 -+          s->replace(beg, j - beg, mkutf(x));
 191.663 -+          j = beg + 1;
 191.664 -+        }
 191.665 -+        else if (USE_ISO8859 && (x < 256) || USE_ASCII && (x < 128)) {
 191.666 -         s->replace(beg, j - beg, 1, (char) x);
 191.667 -         j = beg + 1;
 191.668 -         } else {
 191.669 -@@ -408,13 +431,17 @@
 191.670 -         (int (*)(const void *, const void *)) strcmp
 191.671 -       );
 191.672 -       if (entity != NULL) {
 191.673 --        if (use_iso8859 && entity->iso8859code) {
 191.674 -+        if (USE_ISO8859 && entity->iso8859code) {
 191.675 -           s->replace(beg, j - beg, 1, (char) entity->iso8859code);
 191.676 -           j = beg + 1;
 191.677 --        } else if (entity->asciistr) {
 191.678 -+        } else if (USE_ASCII && entity->asciistr) {
 191.679 -           s->replace(beg, j - beg, entity->asciistr);
 191.680 -         j = beg + 1;
 191.681 -         } /* else don't replace it at all, we don't have a translation */
 191.682 -+        else if(USE_UTF8 && entity->unicode) {
 191.683 -+        s->replace(beg, j - beg, mkutf(entity->unicode));
 191.684 -+        j = beg + 1;
 191.685 -+        }
 191.686 -       }
 191.687 -     } else {
 191.688 -       ;                         /* EXTENSION: Allow literal '&' sometimes. */
 191.689 -diff -r -u -bB html2text-1.3.2a/table.C html2text-1.3.2a-patched/table.C
 191.690 ---- html2text-1.3.2a/table.C	2002-07-22 13:32:50.000000000 +0200
 191.691 -+++ html2text-1.3.2a-patched/table.C	2005-05-13 22:19:59.871136320 +0200
 191.692 -@@ -175,7 +175,7 @@
 191.693 -           - (*number_of_columns_return - 1) * (column_spacing + 0),
 191.694 -           Area::LEFT // Yields better results than "p->halign"!
 191.695 -         ));
 191.696 --	p->width = tmp.get() ? tmp->width() : 0;
 191.697 -+	p->width = tmp.get() ? tmp->utf_width() : 0;
 191.698 -       }
 191.699 -       p->minimized = false;
 191.700 - 
 191.701 -@@ -308,7 +308,7 @@
 191.702 - 	left_of_column + old_column_width - 1,
 191.703 - 	Area::LEFT // Yields better results than "lc.halign"!
 191.704 -       ));
 191.705 --      w = tmp->width();
 191.706 -+      w = tmp->utf_width();
 191.707 -       if (w >= left_of_column + old_column_width) lc.minimized = true;
 191.708 -     }
 191.709 -     if (w > left_of_column + new_column_width) {
   192.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   192.2 +++ b/html2text/stuff/patches/patch-utf8-html2text-1.3.2a.diff	Thu May 10 21:12:00 2018 +0300
   192.3 @@ -0,0 +1,706 @@
   192.4 +diff -r -u -bB html2text-1.3.2a/Area.C html2text-1.3.2a-patched/Area.C
   192.5 +--- html2text-1.3.2a/Area.C	2003-11-23 12:05:29.000000000 +0100
   192.6 ++++ html2text-1.3.2a-patched/Area.C	2005-05-13 22:19:59.862137688 +0200
   192.7 +@@ -36,10 +36,13 @@
   192.8 + #include <iostream>
   192.9 + 
  192.10 + #include "Area.h"
  192.11 ++#include "html.h"
  192.12 + #include "string.h"
  192.13 + 
  192.14 + #define LATIN1_nbsp 160
  192.15 + 
  192.16 ++extern int use_encoding;
  192.17 ++
  192.18 + /* ------------------------------------------------------------------------- */
  192.19 + 
  192.20 + #define malloc_array(type, size)\
  192.21 +@@ -81,6 +84,27 @@
  192.22 + 
  192.23 + /* ------------------------------------------------------------------------- */
  192.24 + 
  192.25 ++/*           utf_length() and utf_width()       
  192.26 ++ *
  192.27 ++ *     Very simplified algorithm of calculating length of UTF-8
  192.28 ++ *   string. No check for errors. Counting only ASCII bytes and
  192.29 ++ *   leading bytes of UTF-8 multibyte sequences. All bytes like
  192.30 ++ *   10xxxxxx are dropped. If USE_UTF8 is false then returns
  192.31 ++ *   usual length.               --YS
  192.32 ++ */
  192.33 ++
  192.34 ++unsigned int
  192.35 ++Line::utf_length(size_type f, size_type t) const
  192.36 ++{
  192.37 ++  size_type m = (t < length_ ? t : length_);
  192.38 ++  size_type r = m - f;
  192.39 ++  if(USE_UTF8) {
  192.40 ++      for (int i = f; i < m; i++)
  192.41 ++        if((cells_[i].character & 0xc0) == 0x80) r--;
  192.42 ++  }
  192.43 ++  return r;
  192.44 ++}
  192.45 ++
  192.46 + void
  192.47 + Line::resize(size_type l)
  192.48 + {
  192.49 +@@ -236,6 +260,23 @@
  192.50 +   return *this;
  192.51 + }
  192.52 + 
  192.53 ++unsigned int
  192.54 ++Area::utf_width()
  192.55 ++{
  192.56 ++  size_type r = width_;
  192.57 ++  if(USE_UTF8) { r = 0;
  192.58 ++    for (size_type yy = 0; yy < height_; yy++) {
  192.59 ++      size_type r1 = 0;
  192.60 ++      for (int i = width_ - 1; i >= 0; i--) {
  192.61 ++        if(!r1 && isspace(cells_[yy][i].character)) continue;
  192.62 ++        if((cells_[yy][i].character & 0xc0) != 0x80) r1++;
  192.63 ++      }
  192.64 ++      if(r < r1) r = r1;
  192.65 ++    }
  192.66 ++  }
  192.67 ++  return r;
  192.68 ++}
  192.69 ++
  192.70 + void
  192.71 + Area::resize(size_type w, size_type h)
  192.72 + {
  192.73 +@@ -439,7 +480,7 @@
  192.74 +       char c = p->character;
  192.75 +       char a = p->attribute;
  192.76 + 
  192.77 +-      if (c == (char) LATIN1_nbsp) c = ' ';
  192.78 ++      if (c == (char) LATIN1_nbsp && !USE_UTF8) c = ' ';
  192.79 + 
  192.80 +       if (a == Cell::NONE) {
  192.81 +         os << c;
  192.82 +Nur in html2text-1.3.2a-patched/: Area.C.orig.
  192.83 +diff -r -u -bB html2text-1.3.2a/Area.h html2text-1.3.2a-patched/Area.h
  192.84 +--- html2text-1.3.2a/Area.h	2003-11-23 12:05:29.000000000 +0100
  192.85 ++++ html2text-1.3.2a-patched/Area.h	2005-05-13 22:19:59.863137536 +0200
  192.86 +@@ -81,6 +81,8 @@
  192.87 +   Cell       &operator[](size_type x)       { return cells_[x]; }
  192.88 +   const Cell *cells() const { return cells_; }
  192.89 + 
  192.90 ++  unsigned int utf_length(size_type f, size_type t) const;
  192.91 ++
  192.92 +   void resize(size_type l);
  192.93 +   void enlarge(size_type l) { if (l > length_) resize(l); }
  192.94 + 
  192.95 +@@ -134,6 +136,8 @@
  192.96 +   Cell       *operator[](size_type y)       { return cells_[y]; }
  192.97 +   const Area &operator>>=(size_type rs);
  192.98 + 
  192.99 ++  unsigned int utf_width();
 192.100 ++
 192.101 +   void resize(size_type w, size_type h);
 192.102 +   void enlarge(size_type w, size_type h);
 192.103 + 
 192.104 +Nur in html2text-1.3.2a-patched/: Area.h.orig.
 192.105 +diff -r -u -bB html2text-1.3.2a/format.C html2text-1.3.2a-patched/format.C
 192.106 +--- html2text-1.3.2a/format.C	2003-11-23 12:05:29.000000000 +0100
 192.107 ++++ html2text-1.3.2a-patched/format.C	2005-05-13 22:19:59.865137232 +0200
 192.108 +@@ -1210,6 +1210,7 @@
 192.109 +     }
 192.110 + 
 192.111 +     Line::size_type to = from + 1;
 192.112 ++    int to_from;
 192.113 + 
 192.114 +     Line::size_type lbp = (Line::size_type) -1; // "Last break position".
 192.115 + 
 192.116 +@@ -1238,18 +1239,20 @@
 192.117 +         to++;
 192.118 +       }
 192.119 + 
 192.120 +-      if (to - from > w && lbp != (Area::size_type) -1) { to = lbp; break; }
 192.121 ++      if (line.utf_length(from,to) > w && lbp != (Area::size_type) -1) 
 192.122 ++                    { to = lbp; break; }
 192.123 +     }
 192.124 + 
 192.125 ++    to_from = line.utf_length(from,to);
 192.126 +     /*
 192.127 +      * Copy the "from...to" range from the "line" to the bottom of the "res"
 192.128 +      * Area.
 192.129 +      */
 192.130 +     Area::size_type x = 0;
 192.131 +     Area::size_type len = to - from;
 192.132 +-    if (halign == Area::LEFT || len >= w) { ;                   } else
 192.133 +-    if (halign == Area::CENTER)           { x += (w - len) / 2; } else
 192.134 +-    if (halign == Area::RIGHT)            { x += w - len;       }
 192.135 ++    if (halign == Area::LEFT || to_from >= w) { ;                   } else
 192.136 ++    if (halign == Area::CENTER)           { x += (w - to_from) / 2; } else
 192.137 ++    if (halign == Area::RIGHT)            { x += w - to_from;       }
 192.138 +     res->insert(line.cells() + from, len, x, res->height());
 192.139 + 
 192.140 +     /*
 192.141 +Nur in html2text-1.3.2a-patched/: format.C.orig.
 192.142 +diff -r -u -bB html2text-1.3.2a/html2text.C html2text-1.3.2a-patched/html2text.C
 192.143 +--- html2text-1.3.2a/html2text.C	2003-11-23 12:05:29.000000000 +0100
 192.144 ++++ html2text-1.3.2a-patched/html2text.C	2005-05-13 22:19:59.868136776 +0200
 192.145 +@@ -148,9 +148,10 @@
 192.146 +   -o <file>      Redirect output into <file>\n\
 192.147 +   -nobs          Do not use backspaces for boldface and underlining\n\
 192.148 +   -ascii         Use plain ASCII for output instead of ISO-8859-1\n\
 192.149 ++  -utf8          Assume both terminal and input stream are in UTF-8 mode\n\
 192.150 + ";
 192.151 + 
 192.152 +-int use_iso8859 = 1;
 192.153 ++int use_encoding = ISO8859;
 192.154 + 
 192.155 + int
 192.156 + main(int argc, char **argv)
 192.157 +@@ -199,7 +200,8 @@
 192.158 +     if (!strcmp(arg, "-width"        )) { width = atoi(argv[++i]);       } else
 192.159 +     if (!strcmp(arg, "-o"            )) { output_file_name = argv[++i];  } else
 192.160 +     if (!strcmp(arg, "-nobs"         )) { use_backspaces = false;        } else
 192.161 +-    if (!strcmp(arg, "-ascii"        )) { use_iso8859 = false;           } else
 192.162 ++    if (!strcmp(arg, "-ascii"        )) { use_encoding = ASCII;          } else
 192.163 ++    if (!strcmp(arg, "-utf8"         )) { use_encoding = UTF8;           } else
 192.164 +     {
 192.165 +       std::cerr
 192.166 + 	<< "Unrecognized command line option \""
 192.167 +Nur in html2text-1.3.2a-patched/: html2text.C.orig.
 192.168 +diff -r -u -bB html2text-1.3.2a/html.h html2text-1.3.2a-patched/html.h
 192.169 +--- html2text-1.3.2a/html.h	2001-10-04 22:03:54.000000000 +0200
 192.170 ++++ html2text-1.3.2a-patched/html.h	2005-05-13 22:19:59.866137080 +0200
 192.171 +@@ -61,6 +61,11 @@
 192.172 + 
 192.173 + /* ------------------------------------------------------------------------- */
 192.174 + 
 192.175 ++enum {ASCII, ISO8859, UTF8};
 192.176 ++#define USE_ISO8859 (use_encoding == ISO8859)
 192.177 ++#define USE_ASCII (use_encoding == ASCII)
 192.178 ++#define USE_UTF8 (use_encoding == UTF8)
 192.179 ++
 192.180 + #define LATIN1_nbsp   160
 192.181 + #define LATIN1_iexcl  161
 192.182 + #define LATIN1_cent   162
 192.183 +diff -r -u -bB html2text-1.3.2a/sgml.C html2text-1.3.2a-patched/sgml.C
 192.184 +--- html2text-1.3.2a/sgml.C	2003-11-23 12:09:11.000000000 +0100
 192.185 ++++ html2text-1.3.2a-patched/sgml.C	2005-05-13 22:19:59.870136472 +0200
 192.186 +@@ -62,261 +62,280 @@
 192.187 +   char name[8];
 192.188 +   int  iso8859code;
 192.189 +   char *asciistr;
 192.190 ++  unsigned long unicode;
 192.191 + } entities[] = {
 192.192 +-  { "AElig",   LATIN1_AElig,  "AE"         },
 192.193 +-  { "AMP",     0,             "&"          },
 192.194 +-  { "Aacute",  LATIN1_Aacute, "A'"         },
 192.195 +-  { "Acirc",   LATIN1_Acirc,  "A^"         },
 192.196 +-  { "Agrave",  LATIN1_Agrave, "A`"         },
 192.197 +-  { "Alpha",   0,             "A"          },
 192.198 +-  { "Aring",   LATIN1_Aring,  "AA"         },
 192.199 +-  { "Atilde",  LATIN1_Atilde, "A~"         },
 192.200 +-  { "Auml",    LATIN1_Auml,   "A\""        },
 192.201 +-  { "Beta",    0,             "B"          },
 192.202 +-  { "Ccedil",  LATIN1_Ccedil, "C,"         },
 192.203 +-  { "Chi",     0,             "H"          },
 192.204 +-  { "Dagger",  0,             "++"         },
 192.205 +-  { "Delta",   0,             "D"          },
 192.206 +-  { "ETH",     LATIN1_ETH,    "D-"         },
 192.207 +-  { "Eacute",  LATIN1_Eacute, "E'"         },
 192.208 +-  { "Ecirc",   LATIN1_Ecirc,  "E^"         },
 192.209 +-  { "Egrave",  LATIN1_Egrave, "E`"         },
 192.210 +-  { "Epsilon", 0,             "E"          },
 192.211 +-  { "Eta",     0,             "E"          },
 192.212 +-  { "Euml",    LATIN1_Euml,   "E\""        },
 192.213 +-  { "GT",      0,             ">"          },
 192.214 +-  { "Gamma",   0,             "G"          },
 192.215 +-  { "Iacute",  LATIN1_Iacute, "I'"         },
 192.216 +-  { "Icirc",   LATIN1_Icirc,  "I^"         },
 192.217 +-  { "Igrave",  LATIN1_Igrave, "I`"         },
 192.218 +-  { "Iota",    0,             "I"          },
 192.219 +-  { "Iuml",    LATIN1_Iuml,   "I\""        },
 192.220 +-  { "Kappa",   0,             "K"          },
 192.221 +-  { "LT",      0,             "<"          },
 192.222 +-  { "Lambda",  0,             "L"          },
 192.223 +-  { "Mu",      0,             "M"          },
 192.224 +-  { "Ntilde",  LATIN1_Ntilde, "N~"         },
 192.225 +-  { "Nu",      0,             "N"          },
 192.226 +-  { "OElig",   0,             "OE"         },
 192.227 +-  { "Oacute",  LATIN1_Oacute, "O'"         },
 192.228 +-  { "Ocirc",   LATIN1_Ocirc,  "O^"         },
 192.229 +-  { "Ograve",  LATIN1_Ograve, "O`"         },
 192.230 +-  { "Omega",   0,             "O"          },
 192.231 +-  { "Omicron", 0,             "O"          },
 192.232 +-  { "Oslash",  LATIN1_Oslash, "O/"         },
 192.233 +-  { "Otilde",  LATIN1_Otilde, "O~"         },
 192.234 +-  { "Ouml",    LATIN1_Ouml,   "O\""        },
 192.235 +-  { "Phi",     0,             "F"          },
 192.236 +-  { "Pi",      0,             "P"          },
 192.237 +-  { "Prime",   0,             "''"         },
 192.238 +-  { "Psi",     0,             "PS"         },
 192.239 +-  { "QUOT",    0,             "\""         },
 192.240 +-  { "Rho",     0,             "R"          },
 192.241 +-  { "Scaron",  0,             "S"          },
 192.242 +-  { "Sigma",   0,             "S"          },
 192.243 +-  { "THORN",   LATIN1_THORN,  "TH"         },
 192.244 +-  { "Tau",     0,             "T"          },
 192.245 +-  { "Theta",   0,             "TH"         },
 192.246 +-  { "Uacute",  LATIN1_Uacute, "U'"         },
 192.247 +-  { "Ucirc",   LATIN1_Ucirc,  "U^"         },
 192.248 +-  { "Ugrave",  LATIN1_Ugrave, "U`"         },
 192.249 +-  { "Upsilon", 0,             "U"          },
 192.250 +-  { "Uuml",    LATIN1_Uuml,   "U\""        },
 192.251 +-  { "Xi",      0,             "X"          },
 192.252 +-  { "Yacute",  LATIN1_Yacute, "Y'"         },
 192.253 +-  { "Yuml",    0,             "Y\""        },
 192.254 +-  { "Zeta",    0,             "Z"          },
 192.255 +-  { "aacute",  LATIN1_aacute, "a'"         },
 192.256 +-  { "acirc",   LATIN1_acirc,  "a^"         },
 192.257 +-  { "acute",   LATIN1_acute,  "'"          },
 192.258 +-  { "aelig",   LATIN1_aelig,  "ae"         },
 192.259 +-  { "agrave",  LATIN1_agrave, "a`"         },
 192.260 ++  { "AElig",   LATIN1_AElig,  "AE",  0x00c6},
 192.261 ++  { "AMP",     0,             "&",   0x0026},
 192.262 ++  { "Aacute",  LATIN1_Aacute, "A'",  0x00c1},
 192.263 ++  { "Acirc",   LATIN1_Acirc,  "A^",  0x00c2},
 192.264 ++  { "Agrave",  LATIN1_Agrave, "A`",  0x00c0},
 192.265 ++  { "Alpha",   0,             "A",   0x0391},
 192.266 ++  { "Aring",   LATIN1_Aring,  "AA",  0x00c5},
 192.267 ++  { "Atilde",  LATIN1_Atilde, "A~",  0x00c3},
 192.268 ++  { "Auml",    LATIN1_Auml,   "A\"", 0x00c4},
 192.269 ++  { "Beta",    0,             "B",   0x0392},
 192.270 ++  { "Ccedil",  LATIN1_Ccedil, "C,",  0x00c7},
 192.271 ++  { "Chi",     0,             "H",   0x03a7},
 192.272 ++  { "Dagger",  0,             "++",  0x2020},
 192.273 ++  { "Delta",   0,             "D",   0x0394},
 192.274 ++  { "ETH",     LATIN1_ETH,    "D-",  0x00d0},
 192.275 ++  { "Eacute",  LATIN1_Eacute, "E'",  0x00c9},
 192.276 ++  { "Ecirc",   LATIN1_Ecirc,  "E^",  0x00ca},
 192.277 ++  { "Egrave",  LATIN1_Egrave, "E`",  0x00c8},
 192.278 ++  { "Epsilon", 0,             "E",   0x0395},
 192.279 ++  { "Eta",     0,             "E",   0x0397},
 192.280 ++  { "Euml",    LATIN1_Euml,   "E\"", 0x00cb},
 192.281 ++  { "GT",      0,             ">",   0x003e},
 192.282 ++  { "Gamma",   0,             "G",   0x0393},
 192.283 ++  { "Iacute",  LATIN1_Iacute, "I'",  0x00cd},
 192.284 ++  { "Icirc",   LATIN1_Icirc,  "I^",  0x00ce},
 192.285 ++  { "Igrave",  LATIN1_Igrave, "I`",  0x00cc},
 192.286 ++  { "Iota",    0,             "I",   0x0399},
 192.287 ++  { "Iuml",    LATIN1_Iuml,   "I\"", 0x00cf},
 192.288 ++  { "Kappa",   0,             "K",   0x039a},
 192.289 ++  { "LT",      0,             "<",   0x003c},
 192.290 ++  { "Lambda",  0,             "L",   0x039b},
 192.291 ++  { "Mu",      0,             "M",   0x039c},
 192.292 ++  { "Ntilde",  LATIN1_Ntilde, "N~",  0x00d1},
 192.293 ++  { "Nu",      0,             "N",   0x039d},
 192.294 ++  { "OElig",   0,             "OE",  0x0152},
 192.295 ++  { "Oacute",  LATIN1_Oacute, "O'",  0x00d3},
 192.296 ++  { "Ocirc",   LATIN1_Ocirc,  "O^",  0x00d4},
 192.297 ++  { "Ograve",  LATIN1_Ograve, "O`",  0x00d2},
 192.298 ++  { "Omega",   0,             "O",   0x03a9},
 192.299 ++  { "Omicron", 0,             "O",   0x039f},
 192.300 ++  { "Oslash",  LATIN1_Oslash, "O/",  0x00d8},
 192.301 ++  { "Otilde",  LATIN1_Otilde, "O~",  0x00d5},
 192.302 ++  { "Ouml",    LATIN1_Ouml,   "O\"", 0x00d6},
 192.303 ++  { "Phi",     0,             "F",   0x03a6},
 192.304 ++  { "Pi",      0,             "P",   0x03a0},
 192.305 ++  { "Prime",   0,             "''",        },
 192.306 ++  { "Psi",     0,             "PS",  0x03a8},
 192.307 ++  { "QUOT",    0,             "\"",        },
 192.308 ++  { "Rho",     0,             "R",   0x03a1},
 192.309 ++  { "Scaron",  0,             "S",   0x0161},
 192.310 ++  { "Sigma",   0,             "S",   0x03a3},
 192.311 ++  { "THORN",   LATIN1_THORN,  "TH",  0x00de},
 192.312 ++  { "Tau",     0,             "T",   0x03a4},
 192.313 ++  { "Theta",   0,             "TH",  0x0398},
 192.314 ++  { "Uacute",  LATIN1_Uacute, "U'",  0x00da},
 192.315 ++  { "Ucirc",   LATIN1_Ucirc,  "U^",  0x00db},
 192.316 ++  { "Ugrave",  LATIN1_Ugrave, "U`",  0x00d9},
 192.317 ++  { "Upsilon", 0,             "U",   0x03a5},
 192.318 ++  { "Uuml",    LATIN1_Uuml,   "U\"", 0x00dc},
 192.319 ++  { "Xi",      0,             "X",   0x039e},
 192.320 ++  { "Yacute",  LATIN1_Yacute, "Y'",  0x00dd},
 192.321 ++  { "Yuml",    0,             "Y\"", 0x0178},
 192.322 ++  { "Zeta",    0,             "Z",   0x0396},
 192.323 ++  { "aacute",  LATIN1_aacute, "a'",  0x00e1},
 192.324 ++  { "acirc",   LATIN1_acirc,  "a^",  0x00e2},
 192.325 ++  { "acute",   LATIN1_acute,  "'",   0x00b4},
 192.326 ++  { "aelig",   LATIN1_aelig,  "ae",  0x00e6},
 192.327 ++  { "agrave",  LATIN1_agrave, "a`",  0x00e0},
 192.328 +   { "alefsym", 0,             "Aleph"      },
 192.329 +-  { "alpha",   0,             "a"          },
 192.330 ++  { "alpha",   0,             "a",   0x03b1},
 192.331 +   { "amp",     0,             "&"          },
 192.332 +   { "and",     0,             "AND"        },
 192.333 +   { "ang",     0,             "-V"         },
 192.334 +   { "apos",    0,             "'"          },
 192.335 +-  { "aring",   LATIN1_aring,  "aa"         },
 192.336 +-  { "asymp",   0,             "~="         },
 192.337 +-  { "atilde",  LATIN1_atilde, "a~"         },
 192.338 +-  { "auml",    LATIN1_auml,   "a\""        },
 192.339 ++  { "aring",   LATIN1_aring,  "aa",  0x00e5},
 192.340 ++  { "asymp",   0,             "~=",  0x2248},
 192.341 ++  { "atilde",  LATIN1_atilde, "a~",  0x00e3},
 192.342 ++  { "auml",    LATIN1_auml,   "a\"", 0x00e5},
 192.343 +   { "bdquo",   0,             "\""         },
 192.344 +-  { "beta",    0,             "b"          },
 192.345 +-  { "brvbar",  LATIN1_brvbar, "|"          },
 192.346 +-  { "bull",    0,             " o "        },
 192.347 ++  { "beta",    0,             "b",   0x03b2},
 192.348 ++  { "brvbar",  LATIN1_brvbar, "|",   0x00a6},
 192.349 ++  { "bull",    0,             " o ", 0x2022},
 192.350 +   { "cap",     0,             "(U"         },
 192.351 +-  { "ccedil",  LATIN1_ccedil, "c,"         },
 192.352 +-  { "cedil",   LATIN1_cedil,  ","          },
 192.353 +-  { "cent",    LATIN1_cent,   "-c-"        },
 192.354 +-  { "chi",     0,             "h"          },
 192.355 +-  { "circ",    0,             "^"          },
 192.356 ++  { "ccedil",  LATIN1_ccedil, "c,",  0x00e7},
 192.357 ++  { "cedil",   LATIN1_cedil,  ",",   0x00b8},
 192.358 ++  { "cent",    LATIN1_cent,   "-c-", 0x00a2},
 192.359 ++  { "chi",     0,             "h",   0x03c7},
 192.360 ++  { "circ",    0,             "^",   0x005e},
 192.361 + //  { "clubs",   0,             "[clubs]"    },
 192.362 +   { "cong",    0,             "?="         },
 192.363 +-  { "copy",    LATIN1_copy,   "(c)"        },
 192.364 ++  { "copy",    LATIN1_copy,   "(c)", 0x00a9},
 192.365 +   { "crarr",   0,             "<-'"        },
 192.366 +   { "cup",     0,             ")U"         },
 192.367 +-  { "curren",  LATIN1_curren, "CUR"        },
 192.368 ++  { "curren",  LATIN1_curren, "CUR", 0x00a4},
 192.369 +   { "dArr",    0,             "vv"         },
 192.370 +-  { "dagger",  0,             "+"          },
 192.371 ++  { "dagger",  0,             "+",   0x2020},
 192.372 +   { "darr",    0,             "v"          },
 192.373 +-  { "deg",     LATIN1_deg,    "DEG"        },
 192.374 +-  { "delta",   0,             "d"          },
 192.375 ++  { "deg",     LATIN1_deg,    "DEG", 0x00b0},
 192.376 ++  { "delta",   0,             "d",   0x03b4},
 192.377 + //  { "diams",   0,             "[diamonds]" },
 192.378 +-  { "divide",  LATIN1_divide, "/"          },
 192.379 +-  { "eacute",  LATIN1_eacute, "e'"         },
 192.380 +-  { "ecirc",   LATIN1_ecirc,  "e^"         },
 192.381 +-  { "egrave",  LATIN1_egrave, "e`"         },
 192.382 ++  { "divide",  LATIN1_divide, "/",   0x00f7},
 192.383 ++  { "eacute",  LATIN1_eacute, "e'",  0x00e9},
 192.384 ++  { "ecirc",   LATIN1_ecirc,  "e^",  0x00ea},
 192.385 ++  { "egrave",  LATIN1_egrave, "e`",  0x00e8},
 192.386 +   { "empty",   0,             "{}"         },
 192.387 +-  { "epsilon", 0,             "e"          },
 192.388 +-  { "equiv",   0,             "=="         },
 192.389 +-  { "eta",     0,             "e"          },
 192.390 +-  { "eth",     LATIN1_eth,    "d-"         },
 192.391 +-  { "euml",    LATIN1_euml,   "e\""        },
 192.392 +-  { "euro",    0,             "EUR"        },
 192.393 ++  { "epsilon", 0,             "e",   0x03b5},
 192.394 ++  { "equiv",   0,             "==",  0x2261},
 192.395 ++  { "eta",     0,             "e",   0x03b7},
 192.396 ++  { "eth",     LATIN1_eth,    "d-",  0x00f0},
 192.397 ++  { "euml",    LATIN1_euml,   "e\"", 0x00eb},
 192.398 ++  { "euro",    0,             "EUR", 0x20ac},
 192.399 +   { "exist",   0,             "TE"         },
 192.400 +   { "fnof",    0,             "f"          },
 192.401 +   { "forall",  0,             "FA"         },
 192.402 +-  { "frac12",  LATIN1_frac12, " 1/2"       },
 192.403 +-  { "frac14",  LATIN1_frac14, " 1/4"       },
 192.404 +-  { "frac34",  LATIN1_frac34, " 3/4"       },
 192.405 ++  { "frac12",  LATIN1_frac12, " 1/2",0x00bd},
 192.406 ++  { "frac14",  LATIN1_frac14, " 1/4",0x00bc},
 192.407 ++  { "frac34",  LATIN1_frac34, " 3/4",0x00be},
 192.408 +   { "frasl",   0,             "/"          },
 192.409 +-  { "gamma",   0,             "g"          },
 192.410 +-  { "ge",      0,             ">="         },
 192.411 +-  { "gt",      0,             ">"          },
 192.412 ++  { "gamma",   0,             "g",   0x03b3},
 192.413 ++  { "ge",      0,             ">=",  0x2265},
 192.414 ++  { "gt",      0,             ">",   0x003e},
 192.415 +   { "hArr",    0,             "<=>"        },
 192.416 +   { "harr",    0,             "<->"        },
 192.417 + //  { "hearts",  0,             "[hearts]"   },
 192.418 +-  { "hellip",  0,             "..."        },
 192.419 +-  { "iacute",  LATIN1_iacute, "i'"         },
 192.420 +-  { "icirc",   LATIN1_icirc,  "i^"         },
 192.421 +-  { "iexcl",   LATIN1_iexcl,  "!"          },
 192.422 +-  { "igrave",  LATIN1_igrave, "i`"         },
 192.423 ++  { "hellip",  0,             "...", 0x2026},
 192.424 ++  { "iacute",  LATIN1_iacute, "i'",  0x00ed},
 192.425 ++  { "icirc",   LATIN1_icirc,  "i^",  0x00ee},
 192.426 ++  { "iexcl",   LATIN1_iexcl,  "!",   0x00a1},
 192.427 ++  { "igrave",  LATIN1_igrave, "i`",  0x00ec},
 192.428 +   { "image",   0,             "Im"         },
 192.429 +-  { "infin",   0,             "oo"         },
 192.430 +-  { "int",     0,             "INT"        },
 192.431 +-  { "iota",    0,             "i"          },
 192.432 +-  { "iquest",  LATIN1_iquest, "?"          },
 192.433 ++  { "infin",   0,             "oo",  0x221e},
 192.434 ++  { "int",     0,             "INT", 0x222b},
 192.435 ++  { "iota",    0,             "i",   0x03b9},
 192.436 ++  { "iquest",  LATIN1_iquest, "?",   0x00bf},
 192.437 +   { "isin",    0,             "(-"         },
 192.438 +-  { "iuml",    LATIN1_iuml,   "i\""        },
 192.439 +-  { "kappa",   0,             "k"          },
 192.440 ++  { "iuml",    LATIN1_iuml,   "i\"", 0x00ef},
 192.441 ++  { "kappa",   0,             "k",   0x03ba},
 192.442 +   { "lArr",    0,             "<="         },
 192.443 +-  { "lambda",  0,             "l"          },
 192.444 ++  { "lambda",  0,             "l",   0x03bb},
 192.445 +   { "lang",    0,             "</"         },
 192.446 +   { "laquo",   LATIN1_laquo,  "<<"         },
 192.447 +-  { "larr",    0,             "<-"         },
 192.448 ++  { "larr",    0,             "<-",  0x2190},
 192.449 + //  { "lceil",   0,             "<|"         },
 192.450 +   { "ldquo",   0,             "\""         },
 192.451 +-  { "le",      0,             "<="         },
 192.452 ++  { "le",      0,             "<=",  0x2264},
 192.453 + //  { "lfloor",  0,             "|<"         },
 192.454 +   { "lowast",  0,             "*"          },
 192.455 +   { "loz",     0,             "<>"         },
 192.456 +   { "lsaquo",  0,             "<"          },
 192.457 +   { "lsquo",   0,             "`"          },
 192.458 +-  { "lt",      0,             "<"          },
 192.459 +-  { "macr",    LATIN1_macr,   "-"          },
 192.460 ++  { "lt",      0,             "<",   0x003c},
 192.461 ++  { "macr",    LATIN1_macr,   "-",   0x00af},
 192.462 +   { "mdash",   0,             "--"         },
 192.463 +-  { "micro",   LATIN1_micro,  "my"         },
 192.464 +-  { "middot",  LATIN1_middot, "."          },
 192.465 +-  { "minus",   0,             "-"          },
 192.466 +-  { "mu",      0,             "m"          },
 192.467 ++  { "micro",   LATIN1_micro,  "my",  0x00b5},
 192.468 ++  { "middot",  LATIN1_middot, ".",   0x00b7},
 192.469 ++  { "minus",   0,             "-",   0x2212},
 192.470 ++  { "mu",      0,             "m",   0x03bc},
 192.471 +   { "nabla",   0,             "Nabla"      },
 192.472 +-  { "nbsp",    LATIN1_nbsp,   " "          },
 192.473 ++  { "nbsp",    LATIN1_nbsp,   " ",   0x00a0},
 192.474 +   { "ndash",   0,             "-"          },
 192.475 +-  { "ne",      0,             "!="         },
 192.476 ++  { "ne",      0,             "!=",  0x2260},
 192.477 +   { "ni",      0,             "-)"         },
 192.478 +   { "not",     LATIN1_not,    "NOT"        },
 192.479 +   { "notin",   0,             "!(-"        },
 192.480 +   { "nsub",    0,             "!(C"        },
 192.481 +-  { "ntilde",  LATIN1_ntilde, "n~"         },
 192.482 +-  { "nu",      0,             "n"          },
 192.483 +-  { "oacute",  LATIN1_oacute, "o'"         },
 192.484 +-  { "ocirc",   LATIN1_ocirc,  "o^"         },
 192.485 ++  { "ntilde",  LATIN1_ntilde, "n~",  0x00f1},
 192.486 ++  { "nu",      0,             "n",   0x03bd},
 192.487 ++  { "oacute",  LATIN1_oacute, "o'",  0x00f3},
 192.488 ++  { "ocirc",   LATIN1_ocirc,  "o^",  0x00f4},
 192.489 +   { "oelig",   0,             "oe"         },
 192.490 +-  { "ograve",  LATIN1_ograve, "o`"         },
 192.491 ++  { "ograve",  LATIN1_ograve, "o`",  0x00f2},
 192.492 +   { "oline",   LATIN1_macr,   "-"          },
 192.493 +-  { "omega",   0,             "o"          },
 192.494 +-  { "omicron", 0,             "o"          },
 192.495 ++  { "omega",   0,             "o",   0x03c9},
 192.496 ++  { "omicron", 0,             "o",   0x03bf},
 192.497 +   { "oplus",   0,             "(+)"        },
 192.498 +   { "or",      0,             "OR"         },
 192.499 +-  { "ordf",    LATIN1_ordf,   "-a"         },
 192.500 +-  { "ordm",    LATIN1_ordm,   "-o"         },
 192.501 +-  { "oslash",  LATIN1_oslash, "o/"         },
 192.502 +-  { "otilde",  LATIN1_otilde, "o~"         },
 192.503 ++  { "ordf",    LATIN1_ordf,   "-a",  0x00aa},
 192.504 ++  { "ordm",    LATIN1_ordm,   "-o",  0x00ba},
 192.505 ++  { "oslash",  LATIN1_oslash, "o/",  0x00f8},
 192.506 ++  { "otilde",  LATIN1_otilde, "o~",  0x00f5},
 192.507 +   { "otimes",  0,             "(x)"        },
 192.508 +-  { "ouml",    LATIN1_ouml,   "o\""        },
 192.509 +-  { "para",    LATIN1_para,   "P:"         },
 192.510 +-  { "part",    0,             "PART"       },
 192.511 +-  { "permil",  0,             " 0/00"      },
 192.512 ++  { "ouml",    LATIN1_ouml,   "o\"", 0x00f6},
 192.513 ++  { "para",    LATIN1_para,   "P:",  0x00b6},
 192.514 ++  { "part",    0,             "PART",0x2202},
 192.515 ++  { "permil",  0,             " 0/00",0x2030},
 192.516 +   { "perp",    0,             "-T"         },
 192.517 +-  { "phi",     0,             "f"          },
 192.518 +-  { "pi",      0,             "p"          },
 192.519 ++  { "phi",     0,             "f",   0x03c6},
 192.520 ++  { "pi",      0,             "p",   0x03c0},
 192.521 +   { "piv",     0,             "Pi"         },
 192.522 +-  { "plusmn",  LATIN1_plusmn, "+/-"        },
 192.523 +-  { "pound",   LATIN1_pound,  "-L-"        },
 192.524 ++  { "plusmn",  LATIN1_plusmn, "+/-", 0x00b1},
 192.525 ++  { "pound",   LATIN1_pound,  "-L-", 0x00a3},
 192.526 +   { "prime",   0,             "'"          },
 192.527 +-  { "prod",    0,             "PROD"       },
 192.528 ++  { "prod",    0,             "PROD",0x220f},
 192.529 +   { "prop",    0,             "0("         },
 192.530 +-  { "psi",     0,             "ps"         },
 192.531 ++  { "psi",     0,             "ps",  0x03c8},
 192.532 +   { "quot",    0,             "\""         },
 192.533 +   { "rArr",    0,             "=>"         },
 192.534 +-  { "radic",   0,             "SQRT"       },
 192.535 ++  { "radic",   0,             "SQRT",0x221a},
 192.536 +   { "rang",    0,             "/>"         },
 192.537 +   { "raquo",   LATIN1_raquo,  ">>"         },
 192.538 +-  { "rarr",    0,             "->"         },
 192.539 ++  { "rarr",    0,             "->",  0x2192},
 192.540 + //  { "rceil",   0,             ">|"         },
 192.541 +   { "rdquo",   0,             "\""         },
 192.542 +   { "real",    0,             "Re"         },
 192.543 +-  { "reg",     LATIN1_reg,    "(R)"        },
 192.544 ++  { "reg",     LATIN1_reg,    "(R)", 0x00ae},
 192.545 + //  { "rfloor",  0,             "|>"         },
 192.546 +-  { "rho",     0,             "r"          },
 192.547 ++  { "rho",     0,             "r",   0x03c1},
 192.548 +   { "rsaquo",  0,             ">"          },
 192.549 +   { "rsquo",   0,             "'"          },
 192.550 +   { "sbquo",   0,             "'"          },
 192.551 +-  { "scaron",  0,             "s"          },
 192.552 ++  { "scaron",  0,             "s",   0x0161},
 192.553 +   { "sdot",    0,             "DOT"        },
 192.554 +-  { "sect",    LATIN1_sect,   "S:"         },
 192.555 ++  { "sect",    LATIN1_sect,   "S:",  0x00a7},
 192.556 +   { "shy",     LATIN1_shy,    ""           },
 192.557 +-  { "sigma",   0,             "s"          },
 192.558 +-  { "sigmaf",  0,             "s"          },
 192.559 ++  { "sigma",   0,             "s",   0x03c3},
 192.560 ++  { "sigmaf",  0,             "s",   0x03c2},
 192.561 +   { "sim",     0,             "~"          },
 192.562 + //  { "spades",  0,             "[spades]"   },
 192.563 +   { "sub",     0,             "(C"         },
 192.564 +   { "sube",    0,             "(_"         },
 192.565 +-  { "sum",     0,             "SUM"        },
 192.566 ++  { "sum",     0,             "SUM", 0x2211},
 192.567 +   { "sup",     0,             ")C"         },
 192.568 +-  { "sup1",    LATIN1_sup1,   "^1"         },
 192.569 +-  { "sup2",    LATIN1_sup2,   "^2"         },
 192.570 +-  { "sup3",    LATIN1_sup3,   "^3"         },
 192.571 ++  { "sup1",    LATIN1_sup1,   "^1",  0x00b9},
 192.572 ++  { "sup2",    LATIN1_sup2,   "^2",  0x00b2},
 192.573 ++  { "sup3",    LATIN1_sup3,   "^3",  0x00b3},
 192.574 +   { "supe",    0,             ")_"         },
 192.575 +-  { "szlig",   LATIN1_szlig,  "ss"         },
 192.576 +-  { "tau",     0,             "t"          },
 192.577 ++  { "szlig",   LATIN1_szlig,  "ss",  0x00df},
 192.578 ++  { "tau",     0,             "t",   0x03c4},
 192.579 +   { "there4",  0,             ".:"         },
 192.580 +-  { "theta",   0,             "th"         },
 192.581 +-  { "thorn",   LATIN1_thorn,  "th"         },
 192.582 +-  { "tilde",   0,             "~"          },
 192.583 +-  { "times",   LATIN1_times,  "x"          },
 192.584 +-  { "trade",   0,             "[TM]"       },
 192.585 ++  { "theta",   0,             "th",  0x03b8},
 192.586 ++  { "thorn",   LATIN1_thorn,  "th",  0x00fe},
 192.587 ++  { "tilde",   0,             "~",   0x02dc},
 192.588 ++  { "times",   LATIN1_times,  "x",   0x00d7},
 192.589 ++  { "trade",   0,             "[TM]",0x2122},
 192.590 +   { "uArr",    0,             "^^"         },
 192.591 +-  { "uacute",  LATIN1_uacute, "u'"         },
 192.592 ++  { "uacute",  LATIN1_uacute, "u'",  0x00fa},
 192.593 +   { "uarr",    0,             "^"          },
 192.594 +-  { "ucirc",   LATIN1_ucirc,  "u^"         },
 192.595 +-  { "ugrave",  LATIN1_ugrave, "u`"         },
 192.596 +-  { "uml",     LATIN1_uml,    "\""         },
 192.597 +-  { "upsilon", 0,             "u"          },
 192.598 +-  { "uuml",    LATIN1_uuml,   "u\""        },
 192.599 ++  { "ucirc",   LATIN1_ucirc,  "u^",  0x00fb},
 192.600 ++  { "ugrave",  LATIN1_ugrave, "u`",  0x00f9},
 192.601 ++  { "uml",     LATIN1_uml,    "\"",  0x00a8},
 192.602 ++  { "upsilon", 0,             "u",   0x03c5},
 192.603 ++  { "uuml",    LATIN1_uuml,   "u\"", 0x00fc},
 192.604 +   { "weierp",  0,             "P"          },
 192.605 +-  { "xi",      0,             "x"          },
 192.606 +-  { "yacute",  LATIN1_yacute, "y'"         },
 192.607 +-  { "yen",     LATIN1_yen,    "YEN"        },
 192.608 +-  { "yuml",    LATIN1_yuml,   "y\""        },
 192.609 +-  { "zeta",    0,             "z"          },
 192.610 ++  { "xi",      0,             "x",   0x03be},
 192.611 ++  { "yacute",  LATIN1_yacute, "y'",  0x00fd},
 192.612 ++  { "yen",     LATIN1_yen,    "YEN", 0x00a5},
 192.613 ++  { "yuml",    LATIN1_yuml,   "y\"", 0x00ff},
 192.614 ++  { "zeta",    0,             "z",   0x03b6},
 192.615 + };
 192.616 + 
 192.617 +-extern int use_iso8859;
 192.618 ++extern int use_encoding;
 192.619 + 
 192.620 + /* ------------------------------------------------------------------------- */
 192.621 + 
 192.622 ++char ubuf[4];
 192.623 ++
 192.624 ++char *mkutf(unsigned long x)
 192.625 ++{
 192.626 ++  memset(ubuf, 0, 4);
 192.627 ++  if(x < 128) ubuf[0] = x;
 192.628 ++  else if(x < 0x800) {
 192.629 ++     ubuf[0] = (0xc0 | ((x >> 6) & 0x1f));
 192.630 ++     ubuf[1] = (0x80 | (x & 0x3f));
 192.631 ++  }
 192.632 ++  else {
 192.633 ++     ubuf[0] = (0xe0 | ((x >> 12) & 0x0f));
 192.634 ++     ubuf[1] = (0x80 | ((x >> 6) & 0x3f));
 192.635 ++     ubuf[2] = (0x80 | (x & 0x3f));
 192.636 ++  }
 192.637 ++  return ubuf;
 192.638 ++}
 192.639 ++
 192.640 + void
 192.641 + replace_sgml_entities(string *s)
 192.642 + {
 192.643 +@@ -330,9 +349,9 @@
 192.644 +      */
 192.645 +     while (j < l && s->at(j) != '&') ++j;
 192.646 +     /*
 192.647 +-     * We could convert high-bit chars to "&#233;" here if use_iso8859
 192.648 +-     * is off, then let them be translated or not.  Is the purpose of
 192.649 +-     * !use_iso8859 to allow SGML entities to be seen, or to strongly
 192.650 ++     * We could convert high-bit chars to "&#233;" here if USE_ASCII
 192.651 ++     * is on, then let them be translated or not.  Is the purpose of
 192.652 ++     * USE_ASCII to allow SGML entities to be seen, or to strongly
 192.653 +      * filter against high-ASCII chars that might blow up a terminal
 192.654 +      * that doesn't speak ISO8859?  For the moment, "allow SGML entities
 192.655 +      * to be seen" -- no filtering here.
 192.656 +@@ -370,7 +389,11 @@
 192.657 +           if (!isdigit(c)) break;
 192.658 +           x = 10 * x + c - '0';
 192.659 +         }
 192.660 +-        if (use_iso8859 || (x < 128)) {
 192.661 ++        if (USE_UTF8) {
 192.662 ++          s->replace(beg, j - beg, mkutf(x));
 192.663 ++          j = beg + 1;
 192.664 ++        }
 192.665 ++        else if (USE_ISO8859 && (x < 256) || USE_ASCII && (x < 128)) {
 192.666 +         s->replace(beg, j - beg, 1, (char) x);
 192.667 +         j = beg + 1;
 192.668 +         } else {
 192.669 +@@ -408,13 +431,17 @@
 192.670 +         (int (*)(const void *, const void *)) strcmp
 192.671 +       );
 192.672 +       if (entity != NULL) {
 192.673 +-        if (use_iso8859 && entity->iso8859code) {
 192.674 ++        if (USE_ISO8859 && entity->iso8859code) {
 192.675 +           s->replace(beg, j - beg, 1, (char) entity->iso8859code);
 192.676 +           j = beg + 1;
 192.677 +-        } else if (entity->asciistr) {
 192.678 ++        } else if (USE_ASCII && entity->asciistr) {
 192.679 +           s->replace(beg, j - beg, entity->asciistr);
 192.680 +         j = beg + 1;
 192.681 +         } /* else don't replace it at all, we don't have a translation */
 192.682 ++        else if(USE_UTF8 && entity->unicode) {
 192.683 ++        s->replace(beg, j - beg, mkutf(entity->unicode));
 192.684 ++        j = beg + 1;
 192.685 ++        }
 192.686 +       }
 192.687 +     } else {
 192.688 +       ;                         /* EXTENSION: Allow literal '&' sometimes. */
 192.689 +diff -r -u -bB html2text-1.3.2a/table.C html2text-1.3.2a-patched/table.C
 192.690 +--- html2text-1.3.2a/table.C	2002-07-22 13:32:50.000000000 +0200
 192.691 ++++ html2text-1.3.2a-patched/table.C	2005-05-13 22:19:59.871136320 +0200
 192.692 +@@ -175,7 +175,7 @@
 192.693 +           - (*number_of_columns_return - 1) * (column_spacing + 0),
 192.694 +           Area::LEFT // Yields better results than "p->halign"!
 192.695 +         ));
 192.696 +-	p->width = tmp.get() ? tmp->width() : 0;
 192.697 ++	p->width = tmp.get() ? tmp->utf_width() : 0;
 192.698 +       }
 192.699 +       p->minimized = false;
 192.700 + 
 192.701 +@@ -308,7 +308,7 @@
 192.702 + 	left_of_column + old_column_width - 1,
 192.703 + 	Area::LEFT // Yields better results than "lc.halign"!
 192.704 +       ));
 192.705 +-      w = tmp->width();
 192.706 ++      w = tmp->utf_width();
 192.707 +       if (w >= left_of_column + old_column_width) lc.minimized = true;
 192.708 +     }
 192.709 +     if (w > left_of_column + new_column_width) {
   193.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   193.2 +++ b/html2text/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   193.3 @@ -0,0 +1,2 @@
   193.4 +# http://www.mbayer.de/html2text/downloads/patch-utf8-html2text-1.3.2a.diff
   193.5 +-p1|patch-utf8-html2text-1.3.2a.diff
   194.1 --- a/icmpshell/receipt	Wed May 09 17:03:28 2018 +0300
   194.2 +++ b/icmpshell/receipt	Thu May 10 21:12:00 2018 +0300
   194.3 @@ -12,7 +12,6 @@
   194.4  WGET_URL="$SF_MIRROR/$PACKAGE/$TARBALL"
   194.5  
   194.6  compile_rules() {
   194.7 -	patch -p0 < $stuff/ishd.u
   194.8  	make -j 1 linux || return 1
   194.9  
  194.10  	install -Dm755 $src/ish  $install/usr/sbin/ish
   195.1 --- a/icmpshell/stuff/ishd.u	Wed May 09 17:03:28 2018 +0300
   195.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   195.3 @@ -1,48 +0,0 @@
   195.4 ---- ishell.h
   195.5 -+++ ishell.h
   195.6 -@@ -39,6 +39,7 @@
   195.7 -     uint8_t    type;           /* icmp type to send packet as       */
   195.8 -     uint16_t   packetsize;     /* packetsize of data                */
   195.9 -     uint32_t   seq;            /* sequence number tracking          */
  195.10 -+    char       *shell;
  195.11 - };
  195.12 - 
  195.13 - 
  195.14 ---- ishd.c
  195.15 -+++ ishd.c
  195.16 -@@ -28,6 +28,7 @@
  195.17 -     " -i <id>          Set session id; range: 0-65535 (default: 1515)\n"
  195.18 -     " -t <type>        Set ICMP type (default: 0)\n"
  195.19 -     " -p <packetsize>  Set packet size (default: 512)\n"
  195.20 -+    " -s <shell>       Set shell (default: /bin/sh)\n"
  195.21 -     "\nexample:\n"
  195.22 -     "%s -i 65535 -t 0 -p 1024\n"
  195.23 -     "\n", VERSION, program, program);
  195.24 -@@ -74,7 +75,7 @@
  195.25 -     int     n, fd, maxfd;
  195.26 -     char    send_buf[ish_info.packetsize], recv_buf[ish_info.packetsize];
  195.27 - 
  195.28 --    fd = popen2("/bin/sh");
  195.29 -+    fd = popen2(ish_info.shell);
  195.30 -     sendhdr.cntrl = 0;
  195.31 - 
  195.32 -     while(1) {
  195.33 -@@ -122,7 +123,8 @@
  195.34 -     int     opt, sockfd;
  195.35 -     struct  sockaddr_in sin;
  195.36 - 
  195.37 --    while((opt = getopt(argc, argv, "hdi:t:p:")) != -1) {
  195.38 -+    ish_info.shell = "/bin/sh";
  195.39 -+    while((opt = getopt(argc, argv, "hdi:t:p:s:")) != -1) {
  195.40 -         switch(opt) {
  195.41 -         	case 'h':
  195.42 -             	usage(argv[0]);
  195.43 -@@ -138,6 +140,8 @@
  195.44 -             	break;
  195.45 -         	case 'p':
  195.46 -             	ish_info.packetsize = atoi(optarg);
  195.47 -+		case 's':
  195.48 -+		ish_info.shell = optarg;
  195.49 -             	break;
  195.50 -         }
  195.51 -     }
   196.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   196.2 +++ b/icmpshell/stuff/patches/ishd.u	Thu May 10 21:12:00 2018 +0300
   196.3 @@ -0,0 +1,48 @@
   196.4 +--- ishell.h
   196.5 ++++ ishell.h
   196.6 +@@ -39,6 +39,7 @@
   196.7 +     uint8_t    type;           /* icmp type to send packet as       */
   196.8 +     uint16_t   packetsize;     /* packetsize of data                */
   196.9 +     uint32_t   seq;            /* sequence number tracking          */
  196.10 ++    char       *shell;
  196.11 + };
  196.12 + 
  196.13 + 
  196.14 +--- ishd.c
  196.15 ++++ ishd.c
  196.16 +@@ -28,6 +28,7 @@
  196.17 +     " -i <id>          Set session id; range: 0-65535 (default: 1515)\n"
  196.18 +     " -t <type>        Set ICMP type (default: 0)\n"
  196.19 +     " -p <packetsize>  Set packet size (default: 512)\n"
  196.20 ++    " -s <shell>       Set shell (default: /bin/sh)\n"
  196.21 +     "\nexample:\n"
  196.22 +     "%s -i 65535 -t 0 -p 1024\n"
  196.23 +     "\n", VERSION, program, program);
  196.24 +@@ -74,7 +75,7 @@
  196.25 +     int     n, fd, maxfd;
  196.26 +     char    send_buf[ish_info.packetsize], recv_buf[ish_info.packetsize];
  196.27 + 
  196.28 +-    fd = popen2("/bin/sh");
  196.29 ++    fd = popen2(ish_info.shell);
  196.30 +     sendhdr.cntrl = 0;
  196.31 + 
  196.32 +     while(1) {
  196.33 +@@ -122,7 +123,8 @@
  196.34 +     int     opt, sockfd;
  196.35 +     struct  sockaddr_in sin;
  196.36 + 
  196.37 +-    while((opt = getopt(argc, argv, "hdi:t:p:")) != -1) {
  196.38 ++    ish_info.shell = "/bin/sh";
  196.39 ++    while((opt = getopt(argc, argv, "hdi:t:p:s:")) != -1) {
  196.40 +         switch(opt) {
  196.41 +         	case 'h':
  196.42 +             	usage(argv[0]);
  196.43 +@@ -138,6 +140,8 @@
  196.44 +             	break;
  196.45 +         	case 'p':
  196.46 +             	ish_info.packetsize = atoi(optarg);
  196.47 ++		case 's':
  196.48 ++		ish_info.shell = optarg;
  196.49 +             	break;
  196.50 +         }
  196.51 +     }
   197.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   197.2 +++ b/icmpshell/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   197.3 @@ -0,0 +1,1 @@
   197.4 +-p0|ishd.u
   198.1 --- a/idesk/receipt	Wed May 09 17:03:28 2018 +0300
   198.2 +++ b/idesk/receipt	Thu May 10 21:12:00 2018 +0300
   198.3 @@ -14,8 +14,6 @@
   198.4  BUILD_DEPENDS="imlib2-dev xorg-libXft-dev"
   198.5  
   198.6  compile_rules() {
   198.7 -	patch -p 0 < $stuff/DesktopConfig.patch || exit 1
   198.8 -
   198.9  	./configure \
  198.10  		--enable-xft \
  198.11  		$CONFIGURE_ARGS &&
   199.1 --- a/idesk/stuff/DesktopConfig.patch	Wed May 09 17:03:28 2018 +0300
   199.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   199.3 @@ -1,12 +0,0 @@
   199.4 ---- src/DesktopConfig.cpp.0
   199.5 -+++ src/DesktopConfig.cpp
   199.6 -@@ -24,6 +24,9 @@
   199.7 - 
   199.8 - #include "DesktopConfig.h"
   199.9 - #include "Util.h"
  199.10 -+#include <unistd.h>
  199.11 -+#include <sys/stat.h>
  199.12 -+#include <sys/types.h>
  199.13 - 
  199.14 - //the initilizer list just sets the program defaults for non-necessary options
  199.15 - DesktopConfig::DesktopConfig(Database db, string ideskrcFile) :
   200.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   200.2 +++ b/idesk/stuff/patches/DesktopConfig.patch	Thu May 10 21:12:00 2018 +0300
   200.3 @@ -0,0 +1,12 @@
   200.4 +--- src/DesktopConfig.cpp.0
   200.5 ++++ src/DesktopConfig.cpp
   200.6 +@@ -24,6 +24,9 @@
   200.7 + 
   200.8 + #include "DesktopConfig.h"
   200.9 + #include "Util.h"
  200.10 ++#include <unistd.h>
  200.11 ++#include <sys/stat.h>
  200.12 ++#include <sys/types.h>
  200.13 + 
  200.14 + //the initilizer list just sets the program defaults for non-necessary options
  200.15 + DesktopConfig::DesktopConfig(Database db, string ideskrcFile) :
   201.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   201.2 +++ b/idesk/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   201.3 @@ -0,0 +1,1 @@
   201.4 +-p0|DesktopConfig.patch
   202.1 --- a/john/receipt	Wed May 09 17:03:28 2018 +0300
   202.2 +++ b/john/receipt	Thu May 10 21:12:00 2018 +0300
   202.3 @@ -22,7 +22,6 @@
   202.4  	zcat $SRC/$(basename $PATCH) | patch -p1
   202.5  
   202.6  	cd $src/src
   202.7 -	patch -Np0 -i $stuff/params.h.patch
   202.8  	sed -i 's|LIBS = -ldes|LIBS = -ldes -Ldes|' Makefile
   202.9  
  202.10  	case $ARCH in
   203.1 --- a/john/stuff/params.h.patch	Wed May 09 17:03:28 2018 +0300
   203.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   203.3 @@ -1,13 +0,0 @@
   203.4 ---- params.h.orig	2006-03-17 08:23:42.000000000 -0500
   203.5 -+++ params.h	2006-03-17 08:50:35.000000000 -0500
   203.6 -@@ -101,8 +101,8 @@
   203.7 - /*
   203.8 -  * File names.
   203.9 -  */
  203.10 --#define CFG_FULL_NAME			"$JOHN/john.conf"
  203.11 --#define CFG_ALT_NAME			"$JOHN/john.ini"
  203.12 -+#define CFG_FULL_NAME			"/etc/john/john.conf"
  203.13 -+#define CFG_ALT_NAME			"/etc/john/john.ini"
  203.14 - #if JOHN_SYSTEMWIDE
  203.15 - #define CFG_PRIVATE_FULL_NAME		JOHN_PRIVATE_HOME "/john.conf"
  203.16 - #define CFG_PRIVATE_ALT_NAME		JOHN_PRIVATE_HOME "/john.ini"
   204.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   204.2 +++ b/john/stuff/patches/params.h.patch	Thu May 10 21:12:00 2018 +0300
   204.3 @@ -0,0 +1,13 @@
   204.4 +--- a/src/params.h.orig	2006-03-17 08:23:42.000000000 -0500
   204.5 ++++ b/src/params.h	2006-03-17 08:50:35.000000000 -0500
   204.6 +@@ -101,8 +101,8 @@
   204.7 + /*
   204.8 +  * File names.
   204.9 +  */
  204.10 +-#define CFG_FULL_NAME			"$JOHN/john.conf"
  204.11 +-#define CFG_ALT_NAME			"$JOHN/john.ini"
  204.12 ++#define CFG_FULL_NAME			"/etc/john/john.conf"
  204.13 ++#define CFG_ALT_NAME			"/etc/john/john.ini"
  204.14 + #if JOHN_SYSTEMWIDE
  204.15 + #define CFG_PRIVATE_FULL_NAME		JOHN_PRIVATE_HOME "/john.conf"
  204.16 + #define CFG_PRIVATE_ALT_NAME		JOHN_PRIVATE_HOME "/john.ini"
   205.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   205.2 +++ b/john/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   205.3 @@ -0,0 +1,1 @@
   205.4 +params.h.patch
   206.1 --- a/jwm/receipt	Wed May 09 17:03:28 2018 +0300
   206.2 +++ b/jwm/receipt	Thu May 10 21:12:00 2018 +0300
   206.3 @@ -19,8 +19,6 @@
   206.4  		arm*) ARCH_ARGS="--disable-nls";;
   206.5  		*)    ARCH_ARGS="";;
   206.6  	esac
   206.7 -	#[ -f done.resize-backgound.u ] || patch -p1 < $stuff/resize-backgound.u
   206.8 -	#touch done.resize-backgound.u
   206.9  
  206.10  	./configure \
  206.11  		--sysconfdir=/etc/xdg/jwm \
   207.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   207.2 +++ b/jwm/stuff/patches/resize-backgound.u	Thu May 10 21:12:00 2018 +0300
   207.3 @@ -0,0 +1,63 @@
   207.4 +--- jwm-2.0.1/src/icon.c
   207.5 ++++ jwm-2.0.1/src/icon.c
   207.6 +@@ -55,3 +55,3 @@
   207.7 + 
   207.8 +-static ScaledIconNode *GetScaledIcon(IconNode *icon, int width, int height);
   207.9 ++static ScaledIconNode *_GetScaledIcon(IconNode *icon, int width, int height);
  207.10 + 
  207.11 +@@ -194,8 +194,26 @@
  207.12 +    int ix, iy;
  207.13 ++   int nwidth = width, nheight = height;
  207.14 + 
  207.15 +    Assert(icon);
  207.16 ++   Assert(icon->image);
  207.17 + 
  207.18 +-   /* Scale the icon. */
  207.19 +-   node = GetScaledIcon(icon, width, height);
  207.20 ++   if(nwidth == 0) {
  207.21 ++      nwidth = icon->image->width;
  207.22 ++   }
  207.23 ++   if(nheight == 0) {
  207.24 ++      nheight = icon->image->height;
  207.25 ++   }
  207.26 + 
  207.27 ++   /* respect ratio if not background */
  207.28 ++   if (x || y) { 
  207.29 ++      double ratio;
  207.30 ++
  207.31 ++      ratio = (double)icon->image->width / icon->image->height;
  207.32 ++      nwidth = Min(nwidth, nheight * ratio);
  207.33 ++      nheight = Min(nheight, nwidth / ratio);
  207.34 ++      nwidth = nheight * ratio;
  207.35 ++   }
  207.36 ++   
  207.37 ++   node = _GetScaledIcon(icon, nwidth, nheight);
  207.38 ++
  207.39 +    if(node) {
  207.40 +@@ -450,3 +468,3 @@
  207.41 + /** Get a scaled icon. */
  207.42 +-ScaledIconNode *GetScaledIcon(IconNode *icon, int rwidth, int rheight) {
  207.43 ++ScaledIconNode *_GetScaledIcon(IconNode *icon, int nwidth, int nheight) {
  207.44 + 
  207.45 +@@ -460,4 +478,2 @@
  207.46 +    double srcx, srcy;
  207.47 +-   double ratio;
  207.48 +-   int nwidth, nheight;
  207.49 +    int usesMask;
  207.50 +@@ -465,16 +481,2 @@
  207.51 + 
  207.52 +-   Assert(icon);
  207.53 +-   Assert(icon->image);
  207.54 +-
  207.55 +-   if(rwidth == 0) {
  207.56 +-      rwidth = icon->image->width;
  207.57 +-   }
  207.58 +-   if(rheight == 0) {
  207.59 +-      rheight = icon->image->height;
  207.60 +-   }
  207.61 +-
  207.62 +-   ratio = (double)icon->image->width / icon->image->height;
  207.63 +-   nwidth = Min(rwidth, rheight * ratio);
  207.64 +-   nheight = Min(rheight, nwidth / ratio);
  207.65 +-   nwidth = nheight * ratio;
  207.66 +    if(nwidth < 1) {
   208.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   208.2 +++ b/jwm/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   208.3 @@ -0,0 +1,1 @@
   208.4 +#-p1|resize-backgound.u
   209.1 --- a/jwm/stuff/resize-backgound.u	Wed May 09 17:03:28 2018 +0300
   209.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   209.3 @@ -1,63 +0,0 @@
   209.4 ---- jwm-2.0.1/src/icon.c
   209.5 -+++ jwm-2.0.1/src/icon.c
   209.6 -@@ -55,3 +55,3 @@
   209.7 - 
   209.8 --static ScaledIconNode *GetScaledIcon(IconNode *icon, int width, int height);
   209.9 -+static ScaledIconNode *_GetScaledIcon(IconNode *icon, int width, int height);
  209.10 - 
  209.11 -@@ -194,8 +194,26 @@
  209.12 -    int ix, iy;
  209.13 -+   int nwidth = width, nheight = height;
  209.14 - 
  209.15 -    Assert(icon);
  209.16 -+   Assert(icon->image);
  209.17 - 
  209.18 --   /* Scale the icon. */
  209.19 --   node = GetScaledIcon(icon, width, height);
  209.20 -+   if(nwidth == 0) {
  209.21 -+      nwidth = icon->image->width;
  209.22 -+   }
  209.23 -+   if(nheight == 0) {
  209.24 -+      nheight = icon->image->height;
  209.25 -+   }
  209.26 - 
  209.27 -+   /* respect ratio if not background */
  209.28 -+   if (x || y) { 
  209.29 -+      double ratio;
  209.30 -+
  209.31 -+      ratio = (double)icon->image->width / icon->image->height;
  209.32 -+      nwidth = Min(nwidth, nheight * ratio);
  209.33 -+      nheight = Min(nheight, nwidth / ratio);
  209.34 -+      nwidth = nheight * ratio;
  209.35 -+   }
  209.36 -+   
  209.37 -+   node = _GetScaledIcon(icon, nwidth, nheight);
  209.38 -+
  209.39 -    if(node) {
  209.40 -@@ -450,3 +468,3 @@
  209.41 - /** Get a scaled icon. */
  209.42 --ScaledIconNode *GetScaledIcon(IconNode *icon, int rwidth, int rheight) {
  209.43 -+ScaledIconNode *_GetScaledIcon(IconNode *icon, int nwidth, int nheight) {
  209.44 - 
  209.45 -@@ -460,4 +478,2 @@
  209.46 -    double srcx, srcy;
  209.47 --   double ratio;
  209.48 --   int nwidth, nheight;
  209.49 -    int usesMask;
  209.50 -@@ -465,16 +481,2 @@
  209.51 - 
  209.52 --   Assert(icon);
  209.53 --   Assert(icon->image);
  209.54 --
  209.55 --   if(rwidth == 0) {
  209.56 --      rwidth = icon->image->width;
  209.57 --   }
  209.58 --   if(rheight == 0) {
  209.59 --      rheight = icon->image->height;
  209.60 --   }
  209.61 --
  209.62 --   ratio = (double)icon->image->width / icon->image->height;
  209.63 --   nwidth = Min(rwidth, rheight * ratio);
  209.64 --   nheight = Min(rheight, nwidth / ratio);
  209.65 --   nwidth = nheight * ratio;
  209.66 -    if(nwidth < 1) {
   210.1 --- a/knock/receipt	Wed May 09 17:03:28 2018 +0300
   210.2 +++ b/knock/receipt	Thu May 10 21:12:00 2018 +0300
   210.3 @@ -14,9 +14,6 @@
   210.4  BUILD_DEPENDS="libpcap-dev"
   210.5  
   210.6  compile_rules() {
   210.7 -	[ -f done.knock.u ] || patch -p1 < $stuff/knock.u
   210.8 -	touch done.knock.u
   210.9 -
  210.10  	./configure $CONFIGURE_ARGS &&
  210.11  	make &&
  210.12  	make DESTDIR=$DESTDIR install || return 1
   211.1 --- a/knock/stuff/knock.u	Wed May 09 17:03:28 2018 +0300
   211.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   211.3 @@ -1,18 +0,0 @@
   211.4 ---- knock-0.5/knockd.conf
   211.5 -+++ knock-0.5/knockd.conf
   211.6 -@@ -1,4 +1,5 @@
   211.7 - [options]
   211.8 -+	PidFile = /var/run/knockd.pid
   211.9 - 	logfile = /var/log/knockd.log
  211.10 - 
  211.11 - [openSSH]
  211.12 -
  211.13 ---- knock-0.5/src/knockd.c
  211.14 -+++ knock-0.5/src/knockd.c
  211.15 -@@ -46,5 +46,6 @@
  211.16 - #include <syslog.h>
  211.17 - #include <pcap.h>
  211.18 - #include <errno.h>
  211.19 -+#include <linux/limits.h>
  211.20 - #include "list.h"
  211.21 - 
   212.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   212.2 +++ b/knock/stuff/patches/knock.u	Thu May 10 21:12:00 2018 +0300
   212.3 @@ -0,0 +1,18 @@
   212.4 +--- knock-0.5/knockd.conf
   212.5 ++++ knock-0.5/knockd.conf
   212.6 +@@ -1,4 +1,5 @@
   212.7 + [options]
   212.8 ++	PidFile = /var/run/knockd.pid
   212.9 + 	logfile = /var/log/knockd.log
  212.10 + 
  212.11 + [openSSH]
  212.12 +
  212.13 +--- knock-0.5/src/knockd.c
  212.14 ++++ knock-0.5/src/knockd.c
  212.15 +@@ -46,5 +46,6 @@
  212.16 + #include <syslog.h>
  212.17 + #include <pcap.h>
  212.18 + #include <errno.h>
  212.19 ++#include <linux/limits.h>
  212.20 + #include "list.h"
  212.21 + 
   213.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   213.2 +++ b/knock/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   213.3 @@ -0,0 +1,1 @@
   213.4 +-p1|knock.u
   214.1 --- a/le/receipt	Wed May 09 17:03:28 2018 +0300
   214.2 +++ b/le/receipt	Thu May 10 21:12:00 2018 +0300
   214.3 @@ -18,7 +18,7 @@
   214.4  compile_rules()
   214.5  {
   214.6  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
   214.7 -	patch -p 0 < $stuff/gcc-4.patch || return 1
   214.8 +
   214.9  	./configure \
  214.10  		--prefix=/usr \
  214.11  		--infodir=/usr/share/info \
   215.1 --- a/le/stuff/gcc-4.patch	Wed May 09 17:03:28 2018 +0300
   215.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   215.3 @@ -1,11 +0,0 @@
   215.4 ---- src/options.cc	2009-09-22 20:30:26.000000000 +0200
   215.5 -+++ src/options.cc	2009-09-22 20:30:01.000000000 +0200
   215.6 -@@ -1245,7 +1245,7 @@
   215.7 -                 FindColor(new_bw_pal,color_no));
   215.8 -       return -1;
   215.9 -    }
  215.10 --   char *l=strchr(button,'&');
  215.11 -+   const char *l=strchr(button,'&');
  215.12 -    if(!l)
  215.13 -       return -1;
  215.14 -    char res=toupper(l[1]);
   216.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   216.2 +++ b/le/stuff/patches/gcc-4.patch	Thu May 10 21:12:00 2018 +0300
   216.3 @@ -0,0 +1,11 @@
   216.4 +--- src/options.cc	2009-09-22 20:30:26.000000000 +0200
   216.5 ++++ src/options.cc	2009-09-22 20:30:01.000000000 +0200
   216.6 +@@ -1245,7 +1245,7 @@
   216.7 +                 FindColor(new_bw_pal,color_no));
   216.8 +       return -1;
   216.9 +    }
  216.10 +-   char *l=strchr(button,'&');
  216.11 ++   const char *l=strchr(button,'&');
  216.12 +    if(!l)
  216.13 +       return -1;
  216.14 +    char res=toupper(l[1]);
   217.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   217.2 +++ b/le/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   217.3 @@ -0,0 +1,1 @@
   217.4 +-p0|gcc-4.patch
   218.1 --- a/libdvdread/receipt	Wed May 09 17:03:28 2018 +0300
   218.2 +++ b/libdvdread/receipt	Thu May 10 21:12:00 2018 +0300
   218.3 @@ -16,8 +16,6 @@
   218.4  COOKOPTS="skip-log-errors"
   218.5  
   218.6  compile_rules() {
   218.7 -	patch -Np1 -i $stuff/DVDFileStat.patch
   218.8 -
   218.9  	./autogen.sh \
  218.10  		$CONFIGURE_ARGS &&
  218.11  	fix libtool &&
   219.1 --- a/libdvdread/stuff/DVDFileStat.patch	Wed May 09 17:03:28 2018 +0300
   219.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   219.3 @@ -1,237 +0,0 @@
   219.4 -diff -pruN libdvdread-4.1.3/src/dvd_reader.c libdvdread-4.1.3.new/src/dvd_reader.c
   219.5 ---- libdvdread-4.1.3/src/dvd_reader.c	2008-09-06 23:55:51.000000000 +0200
   219.6 -+++ libdvdread-4.1.3.new/src/dvd_reader.c	2009-02-28 01:36:20.000000000 +0100
   219.7 -@@ -889,6 +889,187 @@ void DVDCloseFile( dvd_file_t *dvd_file 
   219.8 -     }
   219.9 - }
  219.10 - 
  219.11 -+static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title, 
  219.12 -+                             int menu, dvd_stat_t *statbuf)
  219.13 -+{
  219.14 -+  char filename[ MAX_UDF_FILE_NAME_LEN ];
  219.15 -+  uint32_t size;
  219.16 -+  off_t tot_size;
  219.17 -+  off_t parts_size[9];
  219.18 -+  int nr_parts = 0;
  219.19 -+  int n;
  219.20 -+ 
  219.21 -+  if( title == 0 ) {
  219.22 -+    sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
  219.23 -+  } else {
  219.24 -+    sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
  219.25 -+  }
  219.26 -+  if(!UDFFindFile( dvd, filename, &size )) {
  219.27 -+    return -1;
  219.28 -+  }
  219.29 -+  tot_size = size;
  219.30 -+  nr_parts = 1;
  219.31 -+  parts_size[0] = size;
  219.32 -+
  219.33 -+  if( !menu ) {
  219.34 -+    int cur;
  219.35 -+
  219.36 -+    for( cur = 2; cur < 10; cur++ ) {
  219.37 -+      sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
  219.38 -+      if( !UDFFindFile( dvd, filename, &size ) ) {
  219.39 -+        break;
  219.40 -+      }
  219.41 -+      parts_size[nr_parts] = size;
  219.42 -+      tot_size += size;
  219.43 -+      nr_parts++;
  219.44 -+    }
  219.45 -+  }
  219.46 -+  
  219.47 -+  statbuf->size = tot_size;
  219.48 -+  statbuf->nr_parts = nr_parts;
  219.49 -+  for(n = 0; n < nr_parts; n++) {
  219.50 -+    statbuf->parts_size[n] = parts_size[n];
  219.51 -+  }
  219.52 -+  return 0;
  219.53 -+}
  219.54 -+
  219.55 -+
  219.56 -+static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
  219.57 -+                                       int menu, dvd_stat_t *statbuf )
  219.58 -+{
  219.59 -+  char filename[ MAX_UDF_FILE_NAME_LEN ];
  219.60 -+  char full_path[ PATH_MAX + 1 ];
  219.61 -+  struct stat fileinfo;
  219.62 -+  off_t tot_size;
  219.63 -+  off_t parts_size[9];
  219.64 -+  int nr_parts = 0;
  219.65 -+  int n;
  219.66 -+
  219.67 -+ 
  219.68 -+    
  219.69 -+  if( title == 0 ) {
  219.70 -+    sprintf( filename, "VIDEO_TS.VOB" );
  219.71 -+  } else {
  219.72 -+    sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
  219.73 -+  }
  219.74 -+  if( !findDVDFile( dvd, filename, full_path ) ) {
  219.75 -+    return -1;
  219.76 -+  }
  219.77 -+  
  219.78 -+  if( stat( full_path, &fileinfo ) < 0 ) {
  219.79 -+    fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
  219.80 -+    return -1;
  219.81 -+  }
  219.82 -+  
  219.83 -+
  219.84 -+  tot_size = fileinfo.st_size;
  219.85 -+  nr_parts = 1;
  219.86 -+  parts_size[0] = fileinfo.st_size;
  219.87 -+
  219.88 -+  if( !menu ) {
  219.89 -+    int cur;
  219.90 -+    
  219.91 -+    for( cur = 2; cur < 10; cur++ ) {
  219.92 -+
  219.93 -+      sprintf( filename, "VTS_%02d_%d.VOB", title, cur );
  219.94 -+      if( !findDVDFile( dvd, filename, full_path ) ) {
  219.95 -+        break;
  219.96 -+      }
  219.97 -+
  219.98 -+      if( stat( full_path, &fileinfo ) < 0 ) {
  219.99 -+        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
 219.100 -+        break;
 219.101 -+      }
 219.102 -+      
 219.103 -+      parts_size[nr_parts] = fileinfo.st_size;
 219.104 -+      tot_size += parts_size[nr_parts];
 219.105 -+      nr_parts++;
 219.106 -+    }
 219.107 -+  }
 219.108 -+
 219.109 -+  statbuf->size = tot_size;
 219.110 -+  statbuf->nr_parts = nr_parts;
 219.111 -+  for(n = 0; n < nr_parts; n++) {
 219.112 -+    statbuf->parts_size[n] = parts_size[n];
 219.113 -+  }
 219.114 -+  return 0;
 219.115 -+}
 219.116 -+
 219.117 -+
 219.118 -+int DVDFileStat(dvd_reader_t *dvd, int titlenum, 
 219.119 -+                dvd_read_domain_t domain, dvd_stat_t *statbuf)
 219.120 -+{
 219.121 -+  char filename[ MAX_UDF_FILE_NAME_LEN ];
 219.122 -+  char full_path[ PATH_MAX + 1 ];
 219.123 -+  struct stat fileinfo;
 219.124 -+  uint32_t size;
 219.125 -+
 219.126 -+  /* Check arguments. */
 219.127 -+  if( dvd == NULL || titlenum < 0 ) {
 219.128 -+    errno = EINVAL;
 219.129 -+    return -1;
 219.130 -+  }
 219.131 -+
 219.132 -+  switch( domain ) {
 219.133 -+  case DVD_READ_INFO_FILE:
 219.134 -+    if( titlenum == 0 ) {
 219.135 -+      sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
 219.136 -+    } else {
 219.137 -+      sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
 219.138 -+    }
 219.139 -+    break;
 219.140 -+  case DVD_READ_INFO_BACKUP_FILE:
 219.141 -+    if( titlenum == 0 ) {
 219.142 -+      sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
 219.143 -+    } else {
 219.144 -+      sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
 219.145 -+    }
 219.146 -+    break;
 219.147 -+  case DVD_READ_MENU_VOBS:
 219.148 -+    if( dvd->isImageFile ) {
 219.149 -+      return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf );
 219.150 -+    } else {
 219.151 -+      return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf );
 219.152 -+    }
 219.153 -+    break;
 219.154 -+  case DVD_READ_TITLE_VOBS:
 219.155 -+    if( titlenum == 0 ) {
 219.156 -+      return -1;
 219.157 -+    }
 219.158 -+    if( dvd->isImageFile ) {
 219.159 -+      return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf );
 219.160 -+    } else {
 219.161 -+      return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf );
 219.162 -+    }
 219.163 -+    break;
 219.164 -+  default:
 219.165 -+    fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" );
 219.166 -+    errno = EINVAL;
 219.167 -+    return -1;
 219.168 -+  }
 219.169 -+  
 219.170 -+  if( dvd->isImageFile ) {
 219.171 -+    if( UDFFindFile( dvd, filename, &size ) ) {
 219.172 -+      statbuf->size = size;
 219.173 -+      statbuf->nr_parts = 1;
 219.174 -+      statbuf->parts_size[0] = size;
 219.175 -+      return 0;
 219.176 -+    }
 219.177 -+  } else {
 219.178 -+    if( findDVDFile( dvd, filename, full_path ) )  {
 219.179 -+      if( stat( full_path, &fileinfo ) < 0 ) {
 219.180 -+        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
 219.181 -+      } else {
 219.182 -+        statbuf->size = fileinfo.st_size;
 219.183 -+        statbuf->nr_parts = 1;
 219.184 -+        statbuf->parts_size[0] = statbuf->size;
 219.185 -+        return 0;
 219.186 -+      }
 219.187 -+    }
 219.188 -+  }
 219.189 -+  return -1;
 219.190 -+}
 219.191 -+
 219.192 - /* Internal, but used from dvd_udf.c */
 219.193 - int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
 219.194 - 			 size_t block_count, unsigned char *data,
 219.195 -diff -pruN libdvdread-4.1.3/src/dvd_reader.h libdvdread-4.1.3.new/src/dvd_reader.h
 219.196 ---- libdvdread-4.1.3/src/dvd_reader.h	2008-09-06 23:55:51.000000000 +0200
 219.197 -+++ libdvdread-4.1.3.new/src/dvd_reader.h	2009-02-28 01:36:49.000000000 +0100
 219.198 -@@ -115,6 +115,42 @@ typedef enum {
 219.199 - } dvd_read_domain_t;
 219.200 - 
 219.201 - /**
 219.202 -+ *
 219.203 -+ */
 219.204 -+typedef struct {
 219.205 -+  off_t size;          /**< Total size of file in bytes */
 219.206 -+  int nr_parts;        /**< Number of file parts */
 219.207 -+  off_t parts_size[9]; /**< Size of each part in bytes */
 219.208 -+} dvd_stat_t;
 219.209 -+
 219.210 -+/**
 219.211 -+ * Stats a file on the DVD given the title number and domain.
 219.212 -+ * The information about the file is stored in a dvd_stat_t
 219.213 -+ * which contains information about the size of the file and
 219.214 -+ * the number of parts in case of a multipart file and the respective
 219.215 -+ * sizes of the parts.
 219.216 -+ * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB
 219.217 -+ * The size of VTS_02_1.VOB will be stored in stat->parts_size[0],
 219.218 -+ * VTS_02_2.VOB in stat->parts_size[1], ...
 219.219 -+ * The total size (sum of all parts) is stored in stat->size and
 219.220 -+ * stat->nr_parts will hold the number of parts.
 219.221 -+ * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files.
 219.222 -+ * 
 219.223 -+ * This function is only of use if you want to get the size of each file
 219.224 -+ * in the filesystem. These sizes are not needed to use any other
 219.225 -+ * functions in libdvdread. 
 219.226 -+ *
 219.227 -+ * @param dvd  A dvd read handle.
 219.228 -+ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
 219.229 -+ * @param domain Which domain. 
 219.230 -+ * @param stat Pointer to where the result is stored.
 219.231 -+ * @return If successful 0, otherwise -1.
 219.232 -+ *
 219.233 -+ * int DVDFileStat(dvd, titlenum, domain, stat);
 219.234 -+ */
 219.235 -+int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *);
 219.236 -+  
 219.237 -+/**
 219.238 -  * Opens a file on the DVD given the title number and domain.
 219.239 -  *
 219.240 -  * If the title number is 0, the video manager information is opened
   220.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   220.2 +++ b/libdvdread/stuff/patches/DVDFileStat.patch	Thu May 10 21:12:00 2018 +0300
   220.3 @@ -0,0 +1,237 @@
   220.4 +diff -pruN libdvdread-4.1.3/src/dvd_reader.c libdvdread-4.1.3.new/src/dvd_reader.c
   220.5 +--- libdvdread-4.1.3/src/dvd_reader.c	2008-09-06 23:55:51.000000000 +0200
   220.6 ++++ libdvdread-4.1.3.new/src/dvd_reader.c	2009-02-28 01:36:20.000000000 +0100
   220.7 +@@ -889,6 +889,187 @@ void DVDCloseFile( dvd_file_t *dvd_file 
   220.8 +     }
   220.9 + }
  220.10 + 
  220.11 ++static int DVDFileStatVOBUDF(dvd_reader_t *dvd, int title, 
  220.12 ++                             int menu, dvd_stat_t *statbuf)
  220.13 ++{
  220.14 ++  char filename[ MAX_UDF_FILE_NAME_LEN ];
  220.15 ++  uint32_t size;
  220.16 ++  off_t tot_size;
  220.17 ++  off_t parts_size[9];
  220.18 ++  int nr_parts = 0;
  220.19 ++  int n;
  220.20 ++ 
  220.21 ++  if( title == 0 ) {
  220.22 ++    sprintf( filename, "/VIDEO_TS/VIDEO_TS.VOB" );
  220.23 ++  } else {
  220.24 ++    sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
  220.25 ++  }
  220.26 ++  if(!UDFFindFile( dvd, filename, &size )) {
  220.27 ++    return -1;
  220.28 ++  }
  220.29 ++  tot_size = size;
  220.30 ++  nr_parts = 1;
  220.31 ++  parts_size[0] = size;
  220.32 ++
  220.33 ++  if( !menu ) {
  220.34 ++    int cur;
  220.35 ++
  220.36 ++    for( cur = 2; cur < 10; cur++ ) {
  220.37 ++      sprintf( filename, "/VIDEO_TS/VTS_%02d_%d.VOB", title, cur );
  220.38 ++      if( !UDFFindFile( dvd, filename, &size ) ) {
  220.39 ++        break;
  220.40 ++      }
  220.41 ++      parts_size[nr_parts] = size;
  220.42 ++      tot_size += size;
  220.43 ++      nr_parts++;
  220.44 ++    }
  220.45 ++  }
  220.46 ++  
  220.47 ++  statbuf->size = tot_size;
  220.48 ++  statbuf->nr_parts = nr_parts;
  220.49 ++  for(n = 0; n < nr_parts; n++) {
  220.50 ++    statbuf->parts_size[n] = parts_size[n];
  220.51 ++  }
  220.52 ++  return 0;
  220.53 ++}
  220.54 ++
  220.55 ++
  220.56 ++static int DVDFileStatVOBPath( dvd_reader_t *dvd, int title,
  220.57 ++                                       int menu, dvd_stat_t *statbuf )
  220.58 ++{
  220.59 ++  char filename[ MAX_UDF_FILE_NAME_LEN ];
  220.60 ++  char full_path[ PATH_MAX + 1 ];
  220.61 ++  struct stat fileinfo;
  220.62 ++  off_t tot_size;
  220.63 ++  off_t parts_size[9];
  220.64 ++  int nr_parts = 0;
  220.65 ++  int n;
  220.66 ++
  220.67 ++ 
  220.68 ++    
  220.69 ++  if( title == 0 ) {
  220.70 ++    sprintf( filename, "VIDEO_TS.VOB" );
  220.71 ++  } else {
  220.72 ++    sprintf( filename, "VTS_%02d_%d.VOB", title, menu ? 0 : 1 );
  220.73 ++  }
  220.74 ++  if( !findDVDFile( dvd, filename, full_path ) ) {
  220.75 ++    return -1;
  220.76 ++  }
  220.77 ++  
  220.78 ++  if( stat( full_path, &fileinfo ) < 0 ) {
  220.79 ++    fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
  220.80 ++    return -1;
  220.81 ++  }
  220.82 ++  
  220.83 ++
  220.84 ++  tot_size = fileinfo.st_size;
  220.85 ++  nr_parts = 1;
  220.86 ++  parts_size[0] = fileinfo.st_size;
  220.87 ++
  220.88 ++  if( !menu ) {
  220.89 ++    int cur;
  220.90 ++    
  220.91 ++    for( cur = 2; cur < 10; cur++ ) {
  220.92 ++
  220.93 ++      sprintf( filename, "VTS_%02d_%d.VOB", title, cur );
  220.94 ++      if( !findDVDFile( dvd, filename, full_path ) ) {
  220.95 ++        break;
  220.96 ++      }
  220.97 ++
  220.98 ++      if( stat( full_path, &fileinfo ) < 0 ) {
  220.99 ++        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
 220.100 ++        break;
 220.101 ++      }
 220.102 ++      
 220.103 ++      parts_size[nr_parts] = fileinfo.st_size;
 220.104 ++      tot_size += parts_size[nr_parts];
 220.105 ++      nr_parts++;
 220.106 ++    }
 220.107 ++  }
 220.108 ++
 220.109 ++  statbuf->size = tot_size;
 220.110 ++  statbuf->nr_parts = nr_parts;
 220.111 ++  for(n = 0; n < nr_parts; n++) {
 220.112 ++    statbuf->parts_size[n] = parts_size[n];
 220.113 ++  }
 220.114 ++  return 0;
 220.115 ++}
 220.116 ++
 220.117 ++
 220.118 ++int DVDFileStat(dvd_reader_t *dvd, int titlenum, 
 220.119 ++                dvd_read_domain_t domain, dvd_stat_t *statbuf)
 220.120 ++{
 220.121 ++  char filename[ MAX_UDF_FILE_NAME_LEN ];
 220.122 ++  char full_path[ PATH_MAX + 1 ];
 220.123 ++  struct stat fileinfo;
 220.124 ++  uint32_t size;
 220.125 ++
 220.126 ++  /* Check arguments. */
 220.127 ++  if( dvd == NULL || titlenum < 0 ) {
 220.128 ++    errno = EINVAL;
 220.129 ++    return -1;
 220.130 ++  }
 220.131 ++
 220.132 ++  switch( domain ) {
 220.133 ++  case DVD_READ_INFO_FILE:
 220.134 ++    if( titlenum == 0 ) {
 220.135 ++      sprintf( filename, "/VIDEO_TS/VIDEO_TS.IFO" );
 220.136 ++    } else {
 220.137 ++      sprintf( filename, "/VIDEO_TS/VTS_%02i_0.IFO", titlenum );
 220.138 ++    }
 220.139 ++    break;
 220.140 ++  case DVD_READ_INFO_BACKUP_FILE:
 220.141 ++    if( titlenum == 0 ) {
 220.142 ++      sprintf( filename, "/VIDEO_TS/VIDEO_TS.BUP" );
 220.143 ++    } else {
 220.144 ++      sprintf( filename, "/VIDEO_TS/VTS_%02i_0.BUP", titlenum );
 220.145 ++    }
 220.146 ++    break;
 220.147 ++  case DVD_READ_MENU_VOBS:
 220.148 ++    if( dvd->isImageFile ) {
 220.149 ++      return DVDFileStatVOBUDF( dvd, titlenum, 1, statbuf );
 220.150 ++    } else {
 220.151 ++      return DVDFileStatVOBPath( dvd, titlenum, 1, statbuf );
 220.152 ++    }
 220.153 ++    break;
 220.154 ++  case DVD_READ_TITLE_VOBS:
 220.155 ++    if( titlenum == 0 ) {
 220.156 ++      return -1;
 220.157 ++    }
 220.158 ++    if( dvd->isImageFile ) {
 220.159 ++      return DVDFileStatVOBUDF( dvd, titlenum, 0, statbuf );
 220.160 ++    } else {
 220.161 ++      return DVDFileStatVOBPath( dvd, titlenum, 0, statbuf );
 220.162 ++    }
 220.163 ++    break;
 220.164 ++  default:
 220.165 ++    fprintf( stderr, "libdvdread: Invalid domain for file stat.\n" );
 220.166 ++    errno = EINVAL;
 220.167 ++    return -1;
 220.168 ++  }
 220.169 ++  
 220.170 ++  if( dvd->isImageFile ) {
 220.171 ++    if( UDFFindFile( dvd, filename, &size ) ) {
 220.172 ++      statbuf->size = size;
 220.173 ++      statbuf->nr_parts = 1;
 220.174 ++      statbuf->parts_size[0] = size;
 220.175 ++      return 0;
 220.176 ++    }
 220.177 ++  } else {
 220.178 ++    if( findDVDFile( dvd, filename, full_path ) )  {
 220.179 ++      if( stat( full_path, &fileinfo ) < 0 ) {
 220.180 ++        fprintf( stderr, "libdvdread: Can't stat() %s.\n", filename );
 220.181 ++      } else {
 220.182 ++        statbuf->size = fileinfo.st_size;
 220.183 ++        statbuf->nr_parts = 1;
 220.184 ++        statbuf->parts_size[0] = statbuf->size;
 220.185 ++        return 0;
 220.186 ++      }
 220.187 ++    }
 220.188 ++  }
 220.189 ++  return -1;
 220.190 ++}
 220.191 ++
 220.192 + /* Internal, but used from dvd_udf.c */
 220.193 + int UDFReadBlocksRaw( dvd_reader_t *device, uint32_t lb_number,
 220.194 + 			 size_t block_count, unsigned char *data,
 220.195 +diff -pruN libdvdread-4.1.3/src/dvd_reader.h libdvdread-4.1.3.new/src/dvd_reader.h
 220.196 +--- libdvdread-4.1.3/src/dvd_reader.h	2008-09-06 23:55:51.000000000 +0200
 220.197 ++++ libdvdread-4.1.3.new/src/dvd_reader.h	2009-02-28 01:36:49.000000000 +0100
 220.198 +@@ -115,6 +115,42 @@ typedef enum {
 220.199 + } dvd_read_domain_t;
 220.200 + 
 220.201 + /**
 220.202 ++ *
 220.203 ++ */
 220.204 ++typedef struct {
 220.205 ++  off_t size;          /**< Total size of file in bytes */
 220.206 ++  int nr_parts;        /**< Number of file parts */
 220.207 ++  off_t parts_size[9]; /**< Size of each part in bytes */
 220.208 ++} dvd_stat_t;
 220.209 ++
 220.210 ++/**
 220.211 ++ * Stats a file on the DVD given the title number and domain.
 220.212 ++ * The information about the file is stored in a dvd_stat_t
 220.213 ++ * which contains information about the size of the file and
 220.214 ++ * the number of parts in case of a multipart file and the respective
 220.215 ++ * sizes of the parts.
 220.216 ++ * A multipart file is for instance VTS_02_1.VOB, VTS_02_2.VOB, VTS_02_3.VOB
 220.217 ++ * The size of VTS_02_1.VOB will be stored in stat->parts_size[0],
 220.218 ++ * VTS_02_2.VOB in stat->parts_size[1], ...
 220.219 ++ * The total size (sum of all parts) is stored in stat->size and
 220.220 ++ * stat->nr_parts will hold the number of parts.
 220.221 ++ * Only DVD_READ_TITLE_VOBS (VTS_??_[1-9].VOB) can be multipart files.
 220.222 ++ * 
 220.223 ++ * This function is only of use if you want to get the size of each file
 220.224 ++ * in the filesystem. These sizes are not needed to use any other
 220.225 ++ * functions in libdvdread. 
 220.226 ++ *
 220.227 ++ * @param dvd  A dvd read handle.
 220.228 ++ * @param titlenum Which Video Title Set should be used, VIDEO_TS is 0.
 220.229 ++ * @param domain Which domain. 
 220.230 ++ * @param stat Pointer to where the result is stored.
 220.231 ++ * @return If successful 0, otherwise -1.
 220.232 ++ *
 220.233 ++ * int DVDFileStat(dvd, titlenum, domain, stat);
 220.234 ++ */
 220.235 ++int DVDFileStat(dvd_reader_t *, int, dvd_read_domain_t, dvd_stat_t *);
 220.236 ++  
 220.237 ++/**
 220.238 +  * Opens a file on the DVD given the title number and domain.
 220.239 +  *
 220.240 +  * If the title number is 0, the video manager information is opened
   221.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   221.2 +++ b/libdvdread/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   221.3 @@ -0,0 +1,1 @@
   221.4 +DVDFileStat.patch
   222.1 --- a/libee/receipt	Wed May 09 17:03:28 2018 +0300
   222.2 +++ b/libee/receipt	Thu May 10 21:12:00 2018 +0300
   222.3 @@ -15,9 +15,6 @@
   222.4  SPLIT="libee-dev"
   222.5  
   222.6  compile_rules() {
   222.7 -	# Patch from http://www.gossamer-threads.com/lists/rsyslog/users/4600
   222.8 -	patch -p 1 < $stuff/libee-build-fix.patch
   222.9 -
  222.10  	./configure \
  222.11  		--disable-testbench \
  222.12  		$CONFIGURE_ARGS &&
   223.1 --- a/libee/stuff/libee-build-fix.patch	Wed May 09 17:03:28 2018 +0300
   223.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   223.3 @@ -1,10 +0,0 @@
   223.4 ---- libee-0.3.2-ori/src/Makefile.am
   223.5 -+++ libee-0.3.2/src/Makefile.am
   223.6 -@@ -39,6 +39,6 @@
   223.7 - 
   223.8 - convert_SOURCES = convert.c
   223.9 - convert_CPPFLAGS =  -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS) $(LIBXML2_CFLAGS)
  223.10 --convert_LDADD = $(LIBEE_LIBS) $(LIBXML2_LIBS) $(LIBESTR_LIBS)
  223.11 -+convert_LDADD = libee.la $(LIBXML2_LIBS) $(LIBESTR_LIBS)
  223.12 - 
  223.13 - include_HEADERS = 
   224.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   224.2 +++ b/libee/stuff/patches/libee-build-fix.patch	Thu May 10 21:12:00 2018 +0300
   224.3 @@ -0,0 +1,10 @@
   224.4 +--- libee-0.3.2-ori/src/Makefile.am
   224.5 ++++ libee-0.3.2/src/Makefile.am
   224.6 +@@ -39,6 +39,6 @@
   224.7 + 
   224.8 + convert_SOURCES = convert.c
   224.9 + convert_CPPFLAGS =  -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS) $(LIBXML2_CFLAGS)
  224.10 +-convert_LDADD = $(LIBEE_LIBS) $(LIBXML2_LIBS) $(LIBESTR_LIBS)
  224.11 ++convert_LDADD = libee.la $(LIBXML2_LIBS) $(LIBESTR_LIBS)
  224.12 + 
  224.13 + include_HEADERS = 
   225.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   225.2 +++ b/libee/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   225.3 @@ -0,0 +1,2 @@
   225.4 +# Patch from http://www.gossamer-threads.com/lists/rsyslog/users/4600
   225.5 +-p1|libee-build-fix.patch
   226.1 --- a/libimobiledevice/receipt	Wed May 09 17:03:28 2018 +0300
   226.2 +++ b/libimobiledevice/receipt	Thu May 10 21:12:00 2018 +0300
   226.3 @@ -17,8 +17,6 @@
   226.4  SPLIT="libimobiledevice-dev"
   226.5  
   226.6  compile_rules() {
   226.7 -	patch -Np1 -i $stuff/swig-version-check.patch
   226.8 -
   226.9  	./configure $CONFIGURE_ARGS &&
  226.10  	fix libtool &&
  226.11  	make &&
   227.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   227.2 +++ b/libimobiledevice/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   227.3 @@ -0,0 +1,1 @@
   227.4 +swig-version-check.patch
   228.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   228.2 +++ b/libimobiledevice/stuff/patches/swig-version-check.patch	Thu May 10 21:12:00 2018 +0300
   228.3 @@ -0,0 +1,14 @@
   228.4 +diff -Nur libimobiledevice-1.0.3.old/configure libimobiledevice-1.0.3/configure
   228.5 +--- libimobiledevice-1.0.3.old/configure	2010-10-04 07:38:37.000000000 -0700
   228.6 ++++ libimobiledevice-1.0.3/configure	2010-10-08 05:43:05.466686656 -0700
   228.7 +@@ -3477,9 +3477,7 @@
   228.8 +                         if test -z "$available_patch" ; then
   228.9 +                                 available_patch=0
  228.10 +                         fi
  228.11 +-                        if test $available_major -ne $required_major \
  228.12 +-                                -o $available_minor -ne $required_minor \
  228.13 +-                                -o $available_patch -lt $required_patch ; then
  228.14 ++                        if test $available_major -lt $required_major ; then
  228.15 +                                 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.21 is required.  You have $swig_version.  You should look at http://www.swig.org" >&5
  228.16 + $as_echo "$as_me: WARNING: SWIG version >= 1.3.21 is required.  You have $swig_version.  You should look at http://www.swig.org" >&2;}
  228.17 +                                 SWIG=false
   229.1 --- a/libimobiledevice/stuff/swig-version-check.patch	Wed May 09 17:03:28 2018 +0300
   229.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   229.3 @@ -1,14 +0,0 @@
   229.4 -diff -Nur libimobiledevice-1.0.3.old/configure libimobiledevice-1.0.3/configure
   229.5 ---- libimobiledevice-1.0.3.old/configure	2010-10-04 07:38:37.000000000 -0700
   229.6 -+++ libimobiledevice-1.0.3/configure	2010-10-08 05:43:05.466686656 -0700
   229.7 -@@ -3477,9 +3477,7 @@
   229.8 -                         if test -z "$available_patch" ; then
   229.9 -                                 available_patch=0
  229.10 -                         fi
  229.11 --                        if test $available_major -ne $required_major \
  229.12 --                                -o $available_minor -ne $required_minor \
  229.13 --                                -o $available_patch -lt $required_patch ; then
  229.14 -+                        if test $available_major -lt $required_major ; then
  229.15 -                                 { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: SWIG version >= 1.3.21 is required.  You have $swig_version.  You should look at http://www.swig.org" >&5
  229.16 - $as_echo "$as_me: WARNING: SWIG version >= 1.3.21 is required.  You have $swig_version.  You should look at http://www.swig.org" >&2;}
  229.17 -                                 SWIG=false
   230.1 --- a/liblognorm/receipt	Wed May 09 17:03:28 2018 +0300
   230.2 +++ b/liblognorm/receipt	Thu May 10 21:12:00 2018 +0300
   230.3 @@ -15,8 +15,6 @@
   230.4  SPLIT="liblognorm-dev"
   230.5  
   230.6  compile_rules() {
   230.7 -	patch -p 1 < $stuff/liblognorm-build-fix.patch
   230.8 -
   230.9  	./configure $CONFIGURE_ARGS &&
  230.10  	fix libtool &&
  230.11  	make &&
   231.1 --- a/liblognorm/stuff/liblognorm-build-fix.patch	Wed May 09 17:03:28 2018 +0300
   231.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   231.3 @@ -1,11 +0,0 @@
   231.4 ---- liblognorm-0.3.2-ori/src/Makefile.am
   231.5 -+++ liblognorm-0.3.2/src/Makefile.am
   231.6 -@@ -9,7 +9,7 @@
   231.7 - bin_PROGRAMS = normalizer
   231.8 - normalizer_SOURCES = normalizer.c
   231.9 - normalizer_CPPFLAGS =  -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS)
  231.10 --normalizer_LDADD = $(LIBEE_LIBS) $(LIBLOGNORM_LIBS) $(LIBESTR_LIBS)
  231.11 -+normalizer_LDADD = $(LIBEE_LIBS) liblognorm.la $(LIBESTR_LIBS)
  231.12 - 
  231.13 - lib_LTLIBRARIES = liblognorm.la
  231.14 - 
   232.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   232.2 +++ b/liblognorm/stuff/patches/liblognorm-build-fix.patch	Thu May 10 21:12:00 2018 +0300
   232.3 @@ -0,0 +1,11 @@
   232.4 +--- liblognorm-0.3.2-ori/src/Makefile.am
   232.5 ++++ liblognorm-0.3.2/src/Makefile.am
   232.6 +@@ -9,7 +9,7 @@
   232.7 + bin_PROGRAMS = normalizer
   232.8 + normalizer_SOURCES = normalizer.c
   232.9 + normalizer_CPPFLAGS =  -I$(top_srcdir) $(LIBEE_CFLAGS) $(LIBESTR_CFLAGS)
  232.10 +-normalizer_LDADD = $(LIBEE_LIBS) $(LIBLOGNORM_LIBS) $(LIBESTR_LIBS)
  232.11 ++normalizer_LDADD = $(LIBEE_LIBS) liblognorm.la $(LIBESTR_LIBS)
  232.12 + 
  232.13 + lib_LTLIBRARIES = liblognorm.la
  232.14 + 
   233.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   233.2 +++ b/liblognorm/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   233.3 @@ -0,0 +1,1 @@
   233.4 +-p1|liblognorm-build-fix.patch
   234.1 --- a/liblrdf/receipt	Wed May 09 17:03:28 2018 +0300
   234.2 +++ b/liblrdf/receipt	Thu May 10 21:12:00 2018 +0300
   234.3 @@ -16,9 +16,6 @@
   234.4  SPLIT="liblrdf-dev"
   234.5  
   234.6  compile_rules() {
   234.7 -	patch -Np1 -i $stuff/md5.patch
   234.8 -	patch -Np0 -i $stuff/raptor2.diff
   234.9 -	patch -Np1 -i $stuff/pkgconfig-raptor.patch
  234.10  	autoreconf -vfi
  234.11  
  234.12  	./configure $CONFIGURE_ARGS &&
   235.1 --- a/liblrdf/stuff/md5.patch	Wed May 09 17:03:28 2018 +0300
   235.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   235.3 @@ -1,18 +0,0 @@
   235.4 ---- liblrdf-0.4.0.orig/src/lrdf_md5.h
   235.5 -+++ liblrdf-0.4.0/src/lrdf_md5.h
   235.6 -@@ -32,6 +32,15 @@
   235.7 - #ifndef __MD5_H__
   235.8 - #define __MD5_H__
   235.9 -
  235.10 -+/* Change function names to prevent symbol conflicts */
  235.11 -+#define md5_init _lrdf_md5_init
  235.12 -+#define md5_buffer _lrdf_md5_buffer
  235.13 -+#define md5_sig_from_string _lrdf_md5_sig_from_string
  235.14 -+#define md5_finish _lrdf_md5_finish
  235.15 -+#define md5_process _lrdf_md5_process
  235.16 -+#define md5_sig_to_string _lrdf_md5_sig_to_string
  235.17 -+#define md5_get_result _lrdf_md5_get_result
  235.18 -+
  235.19 - /*
  235.20 -  * Size of a standard MD5 signature in bytes.  This definition is for
  235.21 -  * external programs only.  The MD5 routines themselves reference the
   236.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   236.2 +++ b/liblrdf/stuff/patches/md5.patch	Thu May 10 21:12:00 2018 +0300
   236.3 @@ -0,0 +1,18 @@
   236.4 +--- liblrdf-0.4.0.orig/src/lrdf_md5.h
   236.5 ++++ liblrdf-0.4.0/src/lrdf_md5.h
   236.6 +@@ -32,6 +32,15 @@
   236.7 + #ifndef __MD5_H__
   236.8 + #define __MD5_H__
   236.9 +
  236.10 ++/* Change function names to prevent symbol conflicts */
  236.11 ++#define md5_init _lrdf_md5_init
  236.12 ++#define md5_buffer _lrdf_md5_buffer
  236.13 ++#define md5_sig_from_string _lrdf_md5_sig_from_string
  236.14 ++#define md5_finish _lrdf_md5_finish
  236.15 ++#define md5_process _lrdf_md5_process
  236.16 ++#define md5_sig_to_string _lrdf_md5_sig_to_string
  236.17 ++#define md5_get_result _lrdf_md5_get_result
  236.18 ++
  236.19 + /*
  236.20 +  * Size of a standard MD5 signature in bytes.  This definition is for
  236.21 +  * external programs only.  The MD5 routines themselves reference the
   237.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   237.2 +++ b/liblrdf/stuff/patches/pkgconfig-raptor.patch	Thu May 10 21:12:00 2018 +0300
   237.3 @@ -0,0 +1,9 @@
   237.4 +--- liblrdf-0.4.0/lrdf.pc.in.orig	2011-10-03 19:28:16.702773254 +0000
   237.5 ++++ liblrdf-0.4.0/lrdf.pc.in	2011-10-03 19:28:43.003017477 +0000
   237.6 +@@ -7,4 +7,5 @@
   237.7 + Version: @VERSION@
   237.8 + Description: liblrdf, a lightweight RDF library with extensions for LADSPA
   237.9 + Libs: -L${libdir} -llrdf
  237.10 +-Cflags: -I${includedir} 
  237.11 ++Libs.private: @RAPTOR_LIBS@
  237.12 ++Cflags: @RAPTOR_CFLAGS@ -I${includedir}
   238.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   238.2 +++ b/liblrdf/stuff/patches/raptor2.diff	Thu May 10 21:12:00 2018 +0300
   238.3 @@ -0,0 +1,193 @@
   238.4 +--- src/Makefile.am
   238.5 ++++ src/Makefile.am
   238.6 +@@ -4,5 +4,5 @@ lib_LTLIBRARIES = liblrdf.la
   238.7 + noinst_HEADERS = lrdf_md5.h md5_loc.h ladspa.h
   238.8 + 
   238.9 + liblrdf_la_SOURCES = lrdf.c lrdf_multi.c md5.c
  238.10 +-liblrdf_la_LIBADD = -lraptor
  238.11 ++liblrdf_la_LIBADD = -lraptor2
  238.12 + liblrdf_la_LDFLAGS = -version-info @LRDF_LIBTOOL_VERSION@
  238.13 +--- src/lrdf.c
  238.14 ++++ src/lrdf.c
  238.15 +@@ -18,6 +18,7 @@
  238.16 + static unsigned int lrdf_uid = 0;	/* A unique(ish) id to append to genid's to
  238.17 + 					 * avoid clashses */
  238.18 + 
  238.19 ++static raptor_world *world = NULL;
  238.20 + static lrdf_statement *triples = NULL;
  238.21 + static lrdf_statement *free_triples;
  238.22 + static lrdf_string_hash *resources_hash[LRDF_HASH_SIZE];
  238.23 +@@ -43,8 +44,7 @@ static void lrdf_remove_triple_hash(lrdf_triple_hash ** tbl,
  238.24 + 				    lrdf_hash hash, lrdf_statement * s);
  238.25 + static void lrdf_add_closure_hash(lrdf_closure_hash ** tbl,
  238.26 + 				  lrdf_hash subject, lrdf_hash object);
  238.27 +-static void lrdf_store(void *user_data,
  238.28 +-		       const raptor_statement * statement);
  238.29 ++static void lrdf_store(void *user_data, raptor_statement * statement);
  238.30 + void lrdf_free_statements(lrdf_statement * s);
  238.31 + void lrdf_copy_statement(lrdf_statement * from, lrdf_statement * to);
  238.32 + void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl,
  238.33 +@@ -71,7 +71,7 @@ void lrdf_init()
  238.34 +     unsigned int i;
  238.35 +     struct timeval tv;
  238.36 + 
  238.37 +-    raptor_init();
  238.38 ++    world = raptor_new_world();
  238.39 +     lrdf_more_triples(256);
  238.40 + 
  238.41 +     /* A UID to add to genids to make them safer */
  238.42 +@@ -112,7 +112,8 @@ void lrdf_more_triples(int count)
  238.43 + 
  238.44 + void lrdf_cleanup()
  238.45 + {
  238.46 +-    raptor_finish();
  238.47 ++    raptor_free_world(world);
  238.48 ++    world = NULL;
  238.49 + 
  238.50 +     lrdf_free_string_hash(resources_hash);
  238.51 +     lrdf_free_string_hash(literals_hash);
  238.52 +@@ -232,26 +233,29 @@ void lrdf_remove_matches(lrdf_statement *pattern)
  238.53 +     }
  238.54 + }
  238.55 + 
  238.56 +-static void lrdf_store(void *user_data, const raptor_statement * statement)
  238.57 ++static const char *lrdf_term_as_string(char *tmp, int tmp_len,
  238.58 ++				       const raptor_term *term)
  238.59 ++{
  238.60 ++    switch (term->type) {
  238.61 ++    case RAPTOR_TERM_TYPE_URI:
  238.62 ++	return (const char *) raptor_uri_as_string(term->value.uri);
  238.63 ++    case RAPTOR_TERM_TYPE_LITERAL:
  238.64 ++	return (const char *) term->value.literal.string;
  238.65 ++    case RAPTOR_TERM_TYPE_BLANK:
  238.66 ++	snprintf(tmp, tmp_len, "_:%s.%x", term->value.blank.string, lrdf_uid);
  238.67 ++	return tmp;
  238.68 ++    default:
  238.69 ++	return "(?)";
  238.70 ++    }
  238.71 ++}
  238.72 ++
  238.73 ++static void lrdf_store(void *user_data, raptor_statement * statement)
  238.74 + {
  238.75 +     lrdf_statement *s = lrdf_alloc_statement();
  238.76 +     char tmps[128], tmpp[128], tmpo[128];
  238.77 +-    char *subj = (char *) statement->subject,
  238.78 +-	 *pred = (char *) statement->predicate,
  238.79 +-	 *obj = (char *) statement->object;
  238.80 +-
  238.81 +-    if (statement->subject_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) {
  238.82 +-	snprintf(tmps, 127, "_:%s.%x", subj, lrdf_uid);
  238.83 +-	subj = tmps;
  238.84 +-    }
  238.85 +-    if (statement->predicate_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) {
  238.86 +-	snprintf(tmpp, 127, "_:%s.%x", pred, lrdf_uid);
  238.87 +-	pred = tmpp;
  238.88 +-    }
  238.89 +-    if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) {
  238.90 +-	snprintf(tmpo, 127, "_:%s.%x", obj, lrdf_uid);
  238.91 +-	obj = tmpo;
  238.92 +-    }
  238.93 ++    const char *subj = lrdf_term_as_string(tmps, 128, statement->subject),
  238.94 ++	       *pred = lrdf_term_as_string(tmpp, 128, statement->predicate),
  238.95 ++	       *obj = lrdf_term_as_string(tmpo, 128, statement->object);
  238.96 + 
  238.97 +     s->shash = lrdf_gen_hash(subj);
  238.98 +     s->phash = lrdf_gen_hash(pred);
  238.99 +@@ -261,7 +265,7 @@ static void lrdf_store(void *user_data, const raptor_statement * statement)
 238.100 + 
 238.101 +     s->subject = lrdf_check_hash(resources_hash, s->shash, subj);
 238.102 +     s->predicate = lrdf_check_hash(resources_hash, s->phash, pred);
 238.103 +-    if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_LITERAL) {
 238.104 ++    if (statement->object->type == RAPTOR_TERM_TYPE_LITERAL) {
 238.105 + 	s->object = lrdf_check_hash(literals_hash, s->ohash, obj);
 238.106 + 	s->object_type = lrdf_literal;
 238.107 +     } else {
 238.108 +@@ -537,28 +541,22 @@ void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl,
 238.109 +     free(pathto);
 238.110 + }
 238.111 + 
 238.112 +-static void lrdf_error_handler(void *data, raptor_locator * locator,
 238.113 +-			       const char *message);
 238.114 ++static void lrdf_log_handler(void *data, raptor_log_message *message);
 238.115 + 
 238.116 +-static void lrdf_error_handler(void *data, raptor_locator * locator,
 238.117 +-			       const char *message)
 238.118 ++static void lrdf_log_handler(void *data, raptor_log_message *message)
 238.119 + {
 238.120 +-    fprintf(stderr, "liblrdf: error - ");
 238.121 +-    raptor_print_locator(stderr, locator);
 238.122 +-    fprintf(stderr, " - %s\n", message);
 238.123 +-
 238.124 +-    raptor_parse_abort((raptor_parser*)data);
 238.125 +-}
 238.126 ++    const char *severity = "error";
 238.127 ++    if (message->level == RAPTOR_LOG_LEVEL_WARN) {
 238.128 ++	severity = "warning";
 238.129 ++    }
 238.130 + 
 238.131 +-static void lrdf_warning_handler(void *data, raptor_locator * locator,
 238.132 +-				 const char *message);
 238.133 ++    fprintf(stderr, "liblrdf: %s - ", severity);
 238.134 ++    raptor_locator_print(message->locator, stderr);
 238.135 ++    fprintf(stderr, " - %s\n", message->text);
 238.136 + 
 238.137 +-static void lrdf_warning_handler(void *data, raptor_locator * locator,
 238.138 +-				 const char *message)
 238.139 +-{
 238.140 +-    fprintf(stderr, "liblrdf: warning - ");
 238.141 +-    raptor_print_locator(stderr, locator);
 238.142 +-    fprintf(stderr, " - %s\n", message);
 238.143 ++    if (message->level != RAPTOR_LOG_LEVEL_WARN) {
 238.144 ++	raptor_parser_parse_abort((raptor_parser*)data);
 238.145 ++    }
 238.146 + }
 238.147 + 
 238.148 + 
 238.149 +@@ -593,15 +591,15 @@ int lrdf_read_file_intl(const char *uri)
 238.150 +     lrdf_hash source;
 238.151 + 
 238.152 +     //printf("lrdf: reading %s\n", uri);
 238.153 +-    ruri = raptor_new_uri(uri);
 238.154 +-    furi = raptor_new_uri(uri);
 238.155 ++    ruri = raptor_new_uri(world, (const unsigned char *) uri);
 238.156 ++    furi = raptor_new_uri(world, (const unsigned char *) uri);
 238.157 +     source = lrdf_gen_hash(uri);
 238.158 +     lrdf_check_hash(resources_hash, source, uri);
 238.159 + 
 238.160 +     if (strstr(uri, ".rdf")) {
 238.161 +-	parser = raptor_new_parser("rdfxml");
 238.162 ++	parser = raptor_new_parser(world, "rdfxml");
 238.163 +     } else {
 238.164 +-	parser = raptor_new_parser("ntriples");
 238.165 ++	parser = raptor_new_parser(world, "ntriples");
 238.166 +     }
 238.167 +     if (!parser) {
 238.168 + 	fprintf(stderr, "liblrdf: failed to create parser\n");
 238.169 +@@ -609,12 +607,11 @@ int lrdf_read_file_intl(const char *uri)
 238.170 + 	return 1;
 238.171 +     }
 238.172 + 
 238.173 +-    raptor_set_error_handler(parser, parser, lrdf_error_handler);
 238.174 +-    raptor_set_warning_handler(parser, NULL, lrdf_warning_handler);
 238.175 +-    raptor_set_statement_handler(parser, &source, lrdf_store);
 238.176 +-    raptor_set_default_generate_id_parameters(parser, NULL, ++lrdf_uid);
 238.177 ++    raptor_world_set_log_handler(world, parser, lrdf_log_handler);
 238.178 ++    raptor_parser_set_statement_handler(parser, &source, lrdf_store);
 238.179 ++    raptor_world_set_generate_bnodeid_parameters(world, NULL, ++lrdf_uid);
 238.180 + 
 238.181 +-    if (raptor_parse_file(parser, furi, ruri)) {
 238.182 ++    if (raptor_parser_parse_file(parser, furi, ruri)) {
 238.183 + 	raptor_free_uri(furi);
 238.184 + 	raptor_free_uri(ruri);
 238.185 + 	raptor_free_parser(parser);
 238.186 +--- configure.ac
 238.187 ++++ configure.ac
 238.188 +@@ -18,7 +18,7 @@
 238.189 + AC_HEADER_STDC
 238.190 + AC_CHECK_HEADERS([errno.h limits.h stdlib.h string.h unistd.h])
 238.191 + 
 238.192 +-PKG_CHECK_MODULES(RAPTOR, raptor >= 0.9.11)
 238.193 ++PKG_CHECK_MODULES(RAPTOR, raptor2 >= 0.9.11)
 238.194 + 
 238.195 + # Checks for typedefs, structures, and compiler characteristics.
 238.196 + AC_C_CONST
   239.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   239.2 +++ b/liblrdf/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   239.3 @@ -0,0 +1,3 @@
   239.4 +-Np1|md5.patch
   239.5 +-Np0|raptor2.diff
   239.6 +-Np1|pkgconfig-raptor.patch
   240.1 --- a/liblrdf/stuff/pkgconfig-raptor.patch	Wed May 09 17:03:28 2018 +0300
   240.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   240.3 @@ -1,9 +0,0 @@
   240.4 ---- liblrdf-0.4.0/lrdf.pc.in.orig	2011-10-03 19:28:16.702773254 +0000
   240.5 -+++ liblrdf-0.4.0/lrdf.pc.in	2011-10-03 19:28:43.003017477 +0000
   240.6 -@@ -7,4 +7,5 @@
   240.7 - Version: @VERSION@
   240.8 - Description: liblrdf, a lightweight RDF library with extensions for LADSPA
   240.9 - Libs: -L${libdir} -llrdf
  240.10 --Cflags: -I${includedir} 
  240.11 -+Libs.private: @RAPTOR_LIBS@
  240.12 -+Cflags: @RAPTOR_CFLAGS@ -I${includedir}
   241.1 --- a/liblrdf/stuff/raptor2.diff	Wed May 09 17:03:28 2018 +0300
   241.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   241.3 @@ -1,193 +0,0 @@
   241.4 ---- src/Makefile.am
   241.5 -+++ src/Makefile.am
   241.6 -@@ -4,5 +4,5 @@ lib_LTLIBRARIES = liblrdf.la
   241.7 - noinst_HEADERS = lrdf_md5.h md5_loc.h ladspa.h
   241.8 - 
   241.9 - liblrdf_la_SOURCES = lrdf.c lrdf_multi.c md5.c
  241.10 --liblrdf_la_LIBADD = -lraptor
  241.11 -+liblrdf_la_LIBADD = -lraptor2
  241.12 - liblrdf_la_LDFLAGS = -version-info @LRDF_LIBTOOL_VERSION@
  241.13 ---- src/lrdf.c
  241.14 -+++ src/lrdf.c
  241.15 -@@ -18,6 +18,7 @@
  241.16 - static unsigned int lrdf_uid = 0;	/* A unique(ish) id to append to genid's to
  241.17 - 					 * avoid clashses */
  241.18 - 
  241.19 -+static raptor_world *world = NULL;
  241.20 - static lrdf_statement *triples = NULL;
  241.21 - static lrdf_statement *free_triples;
  241.22 - static lrdf_string_hash *resources_hash[LRDF_HASH_SIZE];
  241.23 -@@ -43,8 +44,7 @@ static void lrdf_remove_triple_hash(lrdf_triple_hash ** tbl,
  241.24 - 				    lrdf_hash hash, lrdf_statement * s);
  241.25 - static void lrdf_add_closure_hash(lrdf_closure_hash ** tbl,
  241.26 - 				  lrdf_hash subject, lrdf_hash object);
  241.27 --static void lrdf_store(void *user_data,
  241.28 --		       const raptor_statement * statement);
  241.29 -+static void lrdf_store(void *user_data, raptor_statement * statement);
  241.30 - void lrdf_free_statements(lrdf_statement * s);
  241.31 - void lrdf_copy_statement(lrdf_statement * from, lrdf_statement * to);
  241.32 - void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl,
  241.33 -@@ -71,7 +71,7 @@ void lrdf_init()
  241.34 -     unsigned int i;
  241.35 -     struct timeval tv;
  241.36 - 
  241.37 --    raptor_init();
  241.38 -+    world = raptor_new_world();
  241.39 -     lrdf_more_triples(256);
  241.40 - 
  241.41 -     /* A UID to add to genids to make them safer */
  241.42 -@@ -112,7 +112,8 @@ void lrdf_more_triples(int count)
  241.43 - 
  241.44 - void lrdf_cleanup()
  241.45 - {
  241.46 --    raptor_finish();
  241.47 -+    raptor_free_world(world);
  241.48 -+    world = NULL;
  241.49 - 
  241.50 -     lrdf_free_string_hash(resources_hash);
  241.51 -     lrdf_free_string_hash(literals_hash);
  241.52 -@@ -232,26 +233,29 @@ void lrdf_remove_matches(lrdf_statement *pattern)
  241.53 -     }
  241.54 - }
  241.55 - 
  241.56 --static void lrdf_store(void *user_data, const raptor_statement * statement)
  241.57 -+static const char *lrdf_term_as_string(char *tmp, int tmp_len,
  241.58 -+				       const raptor_term *term)
  241.59 -+{
  241.60 -+    switch (term->type) {
  241.61 -+    case RAPTOR_TERM_TYPE_URI:
  241.62 -+	return (const char *) raptor_uri_as_string(term->value.uri);
  241.63 -+    case RAPTOR_TERM_TYPE_LITERAL:
  241.64 -+	return (const char *) term->value.literal.string;
  241.65 -+    case RAPTOR_TERM_TYPE_BLANK:
  241.66 -+	snprintf(tmp, tmp_len, "_:%s.%x", term->value.blank.string, lrdf_uid);
  241.67 -+	return tmp;
  241.68 -+    default:
  241.69 -+	return "(?)";
  241.70 -+    }
  241.71 -+}
  241.72 -+
  241.73 -+static void lrdf_store(void *user_data, raptor_statement * statement)
  241.74 - {
  241.75 -     lrdf_statement *s = lrdf_alloc_statement();
  241.76 -     char tmps[128], tmpp[128], tmpo[128];
  241.77 --    char *subj = (char *) statement->subject,
  241.78 --	 *pred = (char *) statement->predicate,
  241.79 --	 *obj = (char *) statement->object;
  241.80 --
  241.81 --    if (statement->subject_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) {
  241.82 --	snprintf(tmps, 127, "_:%s.%x", subj, lrdf_uid);
  241.83 --	subj = tmps;
  241.84 --    }
  241.85 --    if (statement->predicate_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) {
  241.86 --	snprintf(tmpp, 127, "_:%s.%x", pred, lrdf_uid);
  241.87 --	pred = tmpp;
  241.88 --    }
  241.89 --    if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_ANONYMOUS) {
  241.90 --	snprintf(tmpo, 127, "_:%s.%x", obj, lrdf_uid);
  241.91 --	obj = tmpo;
  241.92 --    }
  241.93 -+    const char *subj = lrdf_term_as_string(tmps, 128, statement->subject),
  241.94 -+	       *pred = lrdf_term_as_string(tmpp, 128, statement->predicate),
  241.95 -+	       *obj = lrdf_term_as_string(tmpo, 128, statement->object);
  241.96 - 
  241.97 -     s->shash = lrdf_gen_hash(subj);
  241.98 -     s->phash = lrdf_gen_hash(pred);
  241.99 -@@ -261,7 +265,7 @@ static void lrdf_store(void *user_data, const raptor_statement * statement)
 241.100 - 
 241.101 -     s->subject = lrdf_check_hash(resources_hash, s->shash, subj);
 241.102 -     s->predicate = lrdf_check_hash(resources_hash, s->phash, pred);
 241.103 --    if (statement->object_type == RAPTOR_IDENTIFIER_TYPE_LITERAL) {
 241.104 -+    if (statement->object->type == RAPTOR_TERM_TYPE_LITERAL) {
 241.105 - 	s->object = lrdf_check_hash(literals_hash, s->ohash, obj);
 241.106 - 	s->object_type = lrdf_literal;
 241.107 -     } else {
 241.108 -@@ -537,28 +541,22 @@ void lrdf_rebuild_taxonomic_closure(lrdf_closure_hash ** fwd_tbl,
 241.109 -     free(pathto);
 241.110 - }
 241.111 - 
 241.112 --static void lrdf_error_handler(void *data, raptor_locator * locator,
 241.113 --			       const char *message);
 241.114 -+static void lrdf_log_handler(void *data, raptor_log_message *message);
 241.115 - 
 241.116 --static void lrdf_error_handler(void *data, raptor_locator * locator,
 241.117 --			       const char *message)
 241.118 -+static void lrdf_log_handler(void *data, raptor_log_message *message)
 241.119 - {
 241.120 --    fprintf(stderr, "liblrdf: error - ");
 241.121 --    raptor_print_locator(stderr, locator);
 241.122 --    fprintf(stderr, " - %s\n", message);
 241.123 --
 241.124 --    raptor_parse_abort((raptor_parser*)data);
 241.125 --}
 241.126 -+    const char *severity = "error";
 241.127 -+    if (message->level == RAPTOR_LOG_LEVEL_WARN) {
 241.128 -+	severity = "warning";
 241.129 -+    }
 241.130 - 
 241.131 --static void lrdf_warning_handler(void *data, raptor_locator * locator,
 241.132 --				 const char *message);
 241.133 -+    fprintf(stderr, "liblrdf: %s - ", severity);
 241.134 -+    raptor_locator_print(message->locator, stderr);
 241.135 -+    fprintf(stderr, " - %s\n", message->text);
 241.136 - 
 241.137 --static void lrdf_warning_handler(void *data, raptor_locator * locator,
 241.138 --				 const char *message)
 241.139 --{
 241.140 --    fprintf(stderr, "liblrdf: warning - ");
 241.141 --    raptor_print_locator(stderr, locator);
 241.142 --    fprintf(stderr, " - %s\n", message);
 241.143 -+    if (message->level != RAPTOR_LOG_LEVEL_WARN) {
 241.144 -+	raptor_parser_parse_abort((raptor_parser*)data);
 241.145 -+    }
 241.146 - }
 241.147 - 
 241.148 - 
 241.149 -@@ -593,15 +591,15 @@ int lrdf_read_file_intl(const char *uri)
 241.150 -     lrdf_hash source;
 241.151 - 
 241.152 -     //printf("lrdf: reading %s\n", uri);
 241.153 --    ruri = raptor_new_uri(uri);
 241.154 --    furi = raptor_new_uri(uri);
 241.155 -+    ruri = raptor_new_uri(world, (const unsigned char *) uri);
 241.156 -+    furi = raptor_new_uri(world, (const unsigned char *) uri);
 241.157 -     source = lrdf_gen_hash(uri);
 241.158 -     lrdf_check_hash(resources_hash, source, uri);
 241.159 - 
 241.160 -     if (strstr(uri, ".rdf")) {
 241.161 --	parser = raptor_new_parser("rdfxml");
 241.162 -+	parser = raptor_new_parser(world, "rdfxml");
 241.163 -     } else {
 241.164 --	parser = raptor_new_parser("ntriples");
 241.165 -+	parser = raptor_new_parser(world, "ntriples");
 241.166 -     }
 241.167 -     if (!parser) {
 241.168 - 	fprintf(stderr, "liblrdf: failed to create parser\n");
 241.169 -@@ -609,12 +607,11 @@ int lrdf_read_file_intl(const char *uri)
 241.170 - 	return 1;
 241.171 -     }
 241.172 - 
 241.173 --    raptor_set_error_handler(parser, parser, lrdf_error_handler);
 241.174 --    raptor_set_warning_handler(parser, NULL, lrdf_warning_handler);
 241.175 --    raptor_set_statement_handler(parser, &source, lrdf_store);
 241.176 --    raptor_set_default_generate_id_parameters(parser, NULL, ++lrdf_uid);
 241.177 -+    raptor_world_set_log_handler(world, parser, lrdf_log_handler);
 241.178 -+    raptor_parser_set_statement_handler(parser, &source, lrdf_store);
 241.179 -+    raptor_world_set_generate_bnodeid_parameters(world, NULL, ++lrdf_uid);
 241.180 - 
 241.181 --    if (raptor_parse_file(parser, furi, ruri)) {
 241.182 -+    if (raptor_parser_parse_file(parser, furi, ruri)) {
 241.183 - 	raptor_free_uri(furi);
 241.184 - 	raptor_free_uri(ruri);
 241.185 - 	raptor_free_parser(parser);
 241.186 ---- configure.ac
 241.187 -+++ configure.ac
 241.188 -@@ -18,7 +18,7 @@
 241.189 - AC_HEADER_STDC
 241.190 - AC_CHECK_HEADERS([errno.h limits.h stdlib.h string.h unistd.h])
 241.191 - 
 241.192 --PKG_CHECK_MODULES(RAPTOR, raptor >= 0.9.11)
 241.193 -+PKG_CHECK_MODULES(RAPTOR, raptor2 >= 0.9.11)
 241.194 - 
 241.195 - # Checks for typedefs, structures, and compiler characteristics.
 241.196 - AC_C_CONST
   242.1 --- a/libquicktime/receipt	Wed May 09 17:03:28 2018 +0300
   242.2 +++ b/libquicktime/receipt	Thu May 10 21:12:00 2018 +0300
   242.3 @@ -16,8 +16,6 @@
   242.4  SPLIT="libquicktime-dev"
   242.5  
   242.6  compile_rules() {
   242.7 -	patch -p0 < $stuff/ffmpeg.u
   242.8 -
   242.9  	./configure \
  242.10  		--enable-gpl \
  242.11  		--with-ffmpeg \
   243.1 --- a/libquicktime/stuff/ffmpeg.u	Wed May 09 17:03:28 2018 +0300
   243.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   243.3 @@ -1,91 +0,0 @@
   243.4 ---- plugins/ffmpeg/audio.c
   243.5 -+++ plugins/ffmpeg/audio.c
   243.6 -@@ -45,6 +45,11 @@
   243.7 - #define ENCODE_AUDIO 1
   243.8 - #endif
   243.9 - 
  243.10 -+#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
  243.11 -+/* from libavcodec/avcodec.h dated Dec 23 2012 */
  243.12 -+#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
  243.13 -+#endif
  243.14 -+
  243.15 - /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
  243.16 - 
  243.17 - /* MPEG Audio header parsing code */
  243.18 ---- plugins/ffmpeg/params.c
  243.19 -+++ plugins/ffmpeg/params.c
  243.20 -@@ -101,6 +101,17 @@
  243.21 -     }                                           \
  243.22 -   }
  243.23 - 
  243.24 -+#define PARAM_DICT_INT(name, dict_name)             \
  243.25 -+  {                                                 \
  243.26 -+  if(!strcasecmp(name, key))                        \
  243.27 -+    {                                               \
  243.28 -+    char buf[128];                                  \
  243.29 -+    snprintf(buf, sizeof(buf), "%d", *(int*)value); \
  243.30 -+    av_dict_set(options, dict_name, buf, 0);        \
  243.31 -+    found = 1;                                      \
  243.32 -+    }                                               \
  243.33 -+  }
  243.34 -+
  243.35 - #define PARAM_DICT_FLAG(name, dict_name)        \
  243.36 -   {                                             \
  243.37 -   if(!strcasecmp(name, key))                    \
  243.38 -@@ -202,8 +213,15 @@
  243.39 -   PARAM_INT("ff_max_b_frames",max_b_frames);
  243.40 -   PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
  243.41 -   PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
  243.42 -+
  243.43 -+#if LIBAVCODEC_VERSION_MAJOR >= 55
  243.44 -+  PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
  243.45 -+  PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
  243.46 -+#else
  243.47 -   PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
  243.48 -   PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
  243.49 -+#endif
  243.50 -+
  243.51 -   PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
  243.52 -   PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
  243.53 -   PARAM_INT("ff_rc_min_rate",rc_min_rate);
  243.54 -@@ -241,8 +259,15 @@
  243.55 -   PARAM_QP2LAMBDA("ff_lmax", lmax);
  243.56 -   PARAM_INT("ff_noise_reduction",noise_reduction);
  243.57 -   PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
  243.58 -+
  243.59 -+#if LIBAVCODEC_VERSION_MAJOR >= 55
  243.60 -+  PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
  243.61 -+  PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
  243.62 -+#else
  243.63 -   PARAM_INT("ff_inter_threshold",inter_threshold);
  243.64 -   PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
  243.65 -+#endif
  243.66 -+
  243.67 -   PARAM_INT("ff_thread_count",thread_count);
  243.68 -   PARAM_INT("ff_me_threshold",me_threshold);
  243.69 -   PARAM_INT("ff_mb_threshold",mb_threshold);
  243.70 -@@ -272,8 +297,16 @@
  243.71 -   PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
  243.72 -   PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
  243.73 -   //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
  243.74 -+
  243.75 -+#if LIBAVCODEC_VERSION_MAJOR >= 55
  243.76 -+  PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
  243.77 -+  PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
  243.78 -+  PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
  243.79 -+#else
  243.80 -   PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
  243.81 -   PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
  243.82 -+  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
  243.83 -+#endif
  243.84 - 
  243.85 - #if LIBAVCODEC_VERSION_MAJOR >= 54
  243.86 -   PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
  243.87 -@@ -288,7 +321,6 @@
  243.88 -   PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
  243.89 -   PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
  243.90 -   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
  243.91 --  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
  243.92 -   PARAM_ENUM("ff_coder_type",coder_type,coder_type);
  243.93 -   
  243.94 -   }
   244.1 --- a/libquicktime/stuff/gtk22.patch	Wed May 09 17:03:28 2018 +0300
   244.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   244.3 @@ -1,41 +0,0 @@
   244.4 -diff -Nur libquicktime-1.1.5.orig/utils/gtk/libquicktime_config.c libquicktime-1.1.5/utils/gtk/libquicktime_config.c
   244.5 ---- libquicktime-1.1.5.orig/utils/gtk/libquicktime_config.c	2008-12-30 08:05:36.000000000 -0800
   244.6 -+++ libquicktime-1.1.5/utils/gtk/libquicktime_config.c	2010-10-15 05:46:21.956697112 -0700
   244.7 -@@ -112,9 +112,9 @@
   244.8 -                    G_CALLBACK(main_window_button_callback),
   244.9 -                    (gpointer)ret);
  244.10 - 
  244.11 --  GTK_WIDGET_SET_FLAGS (ret->close_button, GTK_CAN_DEFAULT);
  244.12 --  GTK_WIDGET_SET_FLAGS (ret->save_button, GTK_CAN_DEFAULT);
  244.13 --  
  244.14 -+  gtk_widget_set_can_default(GTK_WIDGET(ret->close_button), TRUE);
  244.15 -+  gtk_widget_set_can_default(GTK_WIDGET(ret->save_button), TRUE);
  244.16 -+
  244.17 -   gtk_widget_show(ret->close_button);
  244.18 -   gtk_widget_show(ret->save_button);
  244.19 - 
  244.20 -diff -Nur libquicktime-1.1.5.orig/utils/gtk/lqt_gtk.c libquicktime-1.1.5/utils/gtk/lqt_gtk.c
  244.21 ---- libquicktime-1.1.5.orig/utils/gtk/lqt_gtk.c	2009-03-11 07:25:50.000000000 -0700
  244.22 -+++ libquicktime-1.1.5/utils/gtk/lqt_gtk.c	2010-10-15 05:47:14.720013265 -0700
  244.23 -@@ -941,9 +941,9 @@
  244.24 - 		   G_CALLBACK(codec_config_window_button_callback),
  244.25 - 		   (gpointer)ret);
  244.26 - 
  244.27 --  GTK_WIDGET_SET_FLAGS (ret->apply_button, GTK_CAN_DEFAULT);
  244.28 --  GTK_WIDGET_SET_FLAGS (ret->close_button, GTK_CAN_DEFAULT);
  244.29 --  GTK_WIDGET_SET_FLAGS (ret->restore_button, GTK_CAN_DEFAULT);
  244.30 -+  gtk_widget_set_can_default(GTK_WIDGET(ret->apply_button), TRUE);
  244.31 -+  gtk_widget_set_can_default(GTK_WIDGET(ret->close_button), TRUE);
  244.32 -+  gtk_widget_set_can_default(GTK_WIDGET(ret->restore_button), TRUE);
  244.33 - 
  244.34 -   gtk_widget_show(ret->apply_button);
  244.35 -   gtk_widget_show(ret->close_button);
  244.36 -@@ -1240,7 +1240,7 @@
  244.37 -   ret->mainbox = gtk_vbox_new(0, 10);
  244.38 - 
  244.39 -   ret->close_button = gtk_button_new_from_stock(GTK_STOCK_CLOSE);
  244.40 --  GTK_WIDGET_SET_FLAGS (ret->close_button, GTK_CAN_DEFAULT);
  244.41 -+  gtk_widget_set_can_default(GTK_WIDGET(ret->close_button), TRUE);
  244.42 - 
  244.43 -   g_signal_connect(G_OBJECT(ret->close_button), "clicked",
  244.44 -                      G_CALLBACK(codec_info_window_button_callback),
   245.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   245.2 +++ b/libquicktime/stuff/patches/ffmpeg.u	Thu May 10 21:12:00 2018 +0300
   245.3 @@ -0,0 +1,91 @@
   245.4 +--- plugins/ffmpeg/audio.c
   245.5 ++++ plugins/ffmpeg/audio.c
   245.6 +@@ -45,6 +45,11 @@
   245.7 + #define ENCODE_AUDIO 1
   245.8 + #endif
   245.9 + 
  245.10 ++#ifndef AVCODEC_MAX_AUDIO_FRAME_SIZE
  245.11 ++/* from libavcodec/avcodec.h dated Dec 23 2012 */
  245.12 ++#define AVCODEC_MAX_AUDIO_FRAME_SIZE 192000 // 1 second of 48khz 32bit audio
  245.13 ++#endif
  245.14 ++
  245.15 + /* The following code was ported from gmerlin_avdecoder (http://gmerlin.sourceforge.net) */
  245.16 + 
  245.17 + /* MPEG Audio header parsing code */
  245.18 +--- plugins/ffmpeg/params.c
  245.19 ++++ plugins/ffmpeg/params.c
  245.20 +@@ -101,6 +101,17 @@
  245.21 +     }                                           \
  245.22 +   }
  245.23 + 
  245.24 ++#define PARAM_DICT_INT(name, dict_name)             \
  245.25 ++  {                                                 \
  245.26 ++  if(!strcasecmp(name, key))                        \
  245.27 ++    {                                               \
  245.28 ++    char buf[128];                                  \
  245.29 ++    snprintf(buf, sizeof(buf), "%d", *(int*)value); \
  245.30 ++    av_dict_set(options, dict_name, buf, 0);        \
  245.31 ++    found = 1;                                      \
  245.32 ++    }                                               \
  245.33 ++  }
  245.34 ++
  245.35 + #define PARAM_DICT_FLAG(name, dict_name)        \
  245.36 +   {                                             \
  245.37 +   if(!strcasecmp(name, key))                    \
  245.38 +@@ -202,8 +213,15 @@
  245.39 +   PARAM_INT("ff_max_b_frames",max_b_frames);
  245.40 +   PARAM_FLOAT("ff_b_quant_factor",b_quant_factor);
  245.41 +   PARAM_INT("ff_b_frame_strategy",b_frame_strategy);
  245.42 ++
  245.43 ++#if LIBAVCODEC_VERSION_MAJOR >= 55
  245.44 ++  PARAM_DICT_INT("ff_luma_elim_threshold","luma_elim_threshold");
  245.45 ++  PARAM_DICT_INT("ff_chroma_elim_threshold","chroma_elim_threshold");
  245.46 ++#else
  245.47 +   PARAM_INT("ff_luma_elim_threshold",luma_elim_threshold);
  245.48 +   PARAM_INT("ff_chroma_elim_threshold",chroma_elim_threshold);
  245.49 ++#endif
  245.50 ++
  245.51 +   PARAM_INT("ff_strict_std_compliance",strict_std_compliance);
  245.52 +   PARAM_QP2LAMBDA("ff_b_quant_offset",b_quant_offset);
  245.53 +   PARAM_INT("ff_rc_min_rate",rc_min_rate);
  245.54 +@@ -241,8 +259,15 @@
  245.55 +   PARAM_QP2LAMBDA("ff_lmax", lmax);
  245.56 +   PARAM_INT("ff_noise_reduction",noise_reduction);
  245.57 +   PARAM_INT_SCALE("ff_rc_initial_buffer_occupancy",rc_initial_buffer_occupancy,1000);
  245.58 ++
  245.59 ++#if LIBAVCODEC_VERSION_MAJOR >= 55
  245.60 ++  PARAM_DICT_INT("ff_inter_threshold","inter_threshold");
  245.61 ++  PARAM_DICT_INT("ff_quantizer_noise_shaping","quantizer_noise_shaping");
  245.62 ++#else
  245.63 +   PARAM_INT("ff_inter_threshold",inter_threshold);
  245.64 +   PARAM_INT("ff_quantizer_noise_shaping",quantizer_noise_shaping);
  245.65 ++#endif
  245.66 ++
  245.67 +   PARAM_INT("ff_thread_count",thread_count);
  245.68 +   PARAM_INT("ff_me_threshold",me_threshold);
  245.69 +   PARAM_INT("ff_mb_threshold",mb_threshold);
  245.70 +@@ -272,8 +297,16 @@
  245.71 +   PARAM_FLAG("ff_flag_bitexact",CODEC_FLAG_BITEXACT);
  245.72 +   PARAM_FLAG("ff_flag_ac_pred",CODEC_FLAG_AC_PRED);
  245.73 +   //  PARAM_FLAG("ff_flag_h263p_umv",CODEC_FLAG_H263P_UMV); // Unused
  245.74 ++
  245.75 ++#if LIBAVCODEC_VERSION_MAJOR >= 55
  245.76 ++  PARAM_DICT_FLAG("ff_flag_cbp_rd","cbp_rd");
  245.77 ++  PARAM_DICT_FLAG("ff_flag_qp_rd","qp_rd");
  245.78 ++  PARAM_DICT_FLAG("ff_flag2_strict_gop","strict_gop");
  245.79 ++#else
  245.80 +   PARAM_FLAG("ff_flag_cbp_rd",CODEC_FLAG_CBP_RD);
  245.81 +   PARAM_FLAG("ff_flag_qp_rd",CODEC_FLAG_QP_RD);
  245.82 ++  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
  245.83 ++#endif
  245.84 + 
  245.85 + #if LIBAVCODEC_VERSION_MAJOR >= 54
  245.86 +   PARAM_DICT_FLAG("ff_flag_h263p_aiv", "aiv");
  245.87 +@@ -288,7 +321,6 @@
  245.88 +   PARAM_FLAG("ff_flag_loop_filter",CODEC_FLAG_LOOP_FILTER);
  245.89 +   PARAM_FLAG("ff_flag_closed_gop",CODEC_FLAG_CLOSED_GOP);
  245.90 +   PARAM_FLAG2("ff_flag2_fast",CODEC_FLAG2_FAST);
  245.91 +-  PARAM_FLAG2("ff_flag2_strict_gop",CODEC_FLAG2_STRICT_GOP);
  245.92 +   PARAM_ENUM("ff_coder_type",coder_type,coder_type);
  245.93 +   
  245.94 +   }
   246.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   246.2 +++ b/libquicktime/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   246.3 @@ -0,0 +1,1 @@
   246.4 +-p0|ffmpeg.u
   247.1 --- a/libwrap/receipt	Wed May 09 17:03:28 2018 +0300
   247.2 +++ b/libwrap/receipt	Thu May 10 21:12:00 2018 +0300
   247.3 @@ -16,10 +16,6 @@
   247.4  # Rules to configure and make the package.
   247.5  compile_rules()
   247.6  {
   247.7 -	# Patch from Linux From Scratch
   247.8 -	[ -f done.tcp_wrappers-7.6-shared_lib_plus_plus-1.patch ] ||
   247.9 -	patch -p1 -i $stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
  247.10 -	touch done.tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
  247.11  	sed -i -e "s,^extern char \*malloc();,/* & */," scaffold.c 
  247.12  		
  247.13  	make REAL_DAEMON_DIR=/usr/sbin STYLE=-DPROCESS_OPTIONS linux
   248.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   248.2 +++ b/libwrap/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   248.3 @@ -0,0 +1,2 @@
   248.4 +# Patch from Linux From Scratch
   248.5 +-p1|tcp_wrappers-7.6-shared_lib_plus_plus-1.patch
   249.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   249.2 +++ b/libwrap/stuff/patches/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch	Thu May 10 21:12:00 2018 +0300
   249.3 @@ -0,0 +1,1035 @@
   249.4 +Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
   249.5 +Date: 2003-10-04
   249.6 +Initial Package Version: 7.6
   249.7 +Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-January/001960.html
   249.8 +Description: The patch was created from the tcp_wrappers modified package by Mark Heerdink.
   249.9 +This patch provides the following improvements:
  249.10 +    * Install libwrap.so along with libwrap.a.
  249.11 +    * Create an install target for tcp_wrappers.
  249.12 +    * Compilation and security fixes.
  249.13 +    * Documentation fixes.
  249.14 +diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile
  249.15 +--- tcp_wrappers_7.6/Makefile	1997-03-21 12:27:21.000000000 -0600
  249.16 ++++ tcp_wrappers_7.6.gimli/Makefile	2002-07-15 16:07:21.000000000 -0500
  249.17 +@@ -1,5 +1,10 @@
  249.18 ++GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
  249.19 ++
  249.20 + # @(#) Makefile 1.23 97/03/21 19:27:20
  249.21 + 
  249.22 ++# unset the HOSTNAME environment variable
  249.23 ++HOSTNAME =
  249.24 ++
  249.25 + what:
  249.26 + 	@echo
  249.27 + 	@echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
  249.28 +@@ -19,7 +24,7 @@
  249.29 + 	@echo "	generic (most bsd-ish systems with sys5 compatibility)"
  249.30 + 	@echo "	386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
  249.31 + 	@echo "	dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
  249.32 +-	@echo "	linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
  249.33 ++	@echo "	linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
  249.34 + 	@echo "	ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
  249.35 + 	@echo "	sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
  249.36 + 	@echo "	uts215 uxp"
  249.37 +@@ -43,8 +48,8 @@
  249.38 + # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
  249.39 + #REAL_DAEMON_DIR=/usr/etc
  249.40 + #
  249.41 +-# SysV.4 Solaris 2.x OSF AIX
  249.42 +-#REAL_DAEMON_DIR=/usr/sbin
  249.43 ++# SysV.4 Solaris 2.x OSF AIX Linux
  249.44 ++REAL_DAEMON_DIR=/usr/sbin
  249.45 + #
  249.46 + # BSD 4.4
  249.47 + #REAL_DAEMON_DIR=/usr/libexec
  249.48 +@@ -141,10 +146,21 @@
  249.49 + 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
  249.50 + 	EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
  249.51 + 
  249.52 ++ifneq ($(GLIBC),0)
  249.53 ++MYLIB=-lnsl
  249.54 ++endif
  249.55 ++
  249.56 + linux:
  249.57 + 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
  249.58 +-	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
  249.59 +-	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
  249.60 ++	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
  249.61 ++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
  249.62 ++	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
  249.63 ++
  249.64 ++gnu:
  249.65 ++	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
  249.66 ++	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
  249.67 ++	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
  249.68 ++	EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
  249.69 + 
  249.70 + # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
  249.71 + hpux hpux8 hpux9 hpux10:
  249.72 +@@ -391,7 +407,7 @@
  249.73 + # the ones provided with this source distribution. The environ.c module
  249.74 + # implements setenv(), getenv(), and putenv().
  249.75 + 
  249.76 +-AUX_OBJ= setenv.o
  249.77 ++#AUX_OBJ= setenv.o
  249.78 + #AUX_OBJ= environ.o
  249.79 + #AUX_OBJ= environ.o strcasecmp.o
  249.80 + 
  249.81 +@@ -454,7 +470,8 @@
  249.82 + # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
  249.83 + # around this. The workaround does no harm on other Solaris versions.
  249.84 + 
  249.85 +-BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
  249.86 ++BUGS =
  249.87 ++#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
  249.88 + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
  249.89 + #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
  249.90 + 
  249.91 +@@ -464,7 +481,7 @@
  249.92 + # If your system supports NIS or YP-style netgroups, enable the following
  249.93 + # macro definition. Netgroups are used only for host access control.
  249.94 + #
  249.95 +-#NETGROUP= -DNETGROUP
  249.96 ++NETGROUP= -DNETGROUP
  249.97 + 
  249.98 + ###############################################################
  249.99 + # System dependencies: whether or not your system has vsyslog()
 249.100 +@@ -491,7 +508,7 @@
 249.101 + # Uncomment the next definition to turn on the language extensions
 249.102 + # (examples: allow, deny, banners, twist and spawn).
 249.103 + # 
 249.104 +-#STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
 249.105 ++STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
 249.106 + 
 249.107 + ################################################################
 249.108 + # Optional: Changing the default disposition of logfile records
 249.109 +@@ -514,7 +531,7 @@
 249.110 + #
 249.111 + # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
 249.112 + 
 249.113 +-FACILITY= LOG_MAIL	# LOG_MAIL is what most sendmail daemons use
 249.114 ++FACILITY= LOG_DAEMON	# LOG_MAIL is what most sendmail daemons use
 249.115 + 
 249.116 + # The syslog priority at which successful connections are logged.
 249.117 + 
 249.118 +@@ -610,7 +627,7 @@
 249.119 + # Paranoid mode implies hostname lookup. In order to disable hostname
 249.120 + # lookups altogether, see the next section.
 249.121 + 
 249.122 +-PARANOID= -DPARANOID
 249.123 ++#PARANOID= -DPARANOID
 249.124 + 
 249.125 + ########################################
 249.126 + # Optional: turning off hostname lookups
 249.127 +@@ -623,7 +640,7 @@
 249.128 + # In order to perform selective hostname lookups, disable paranoid
 249.129 + # mode (see previous section) and comment out the following definition.
 249.130 + 
 249.131 +-HOSTNAME= -DALWAYS_HOSTNAME
 249.132 ++#HOSTNAME= -DALWAYS_HOSTNAME
 249.133 + 
 249.134 + #############################################
 249.135 + # Optional: Turning on host ADDRESS checking
 249.136 +@@ -649,28 +666,46 @@
 249.137 + # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
 249.138 + # Solaris 2.x, and Linux. See your system documentation for details.
 249.139 + #
 249.140 +-# KILL_OPT= -DKILL_IP_OPTIONS
 249.141 ++KILL_OPT= -DKILL_IP_OPTIONS
 249.142 + 
 249.143 + ## End configuration options
 249.144 + ############################
 249.145 + 
 249.146 + # Protection against weird shells or weird make programs.
 249.147 + 
 249.148 ++CC	= gcc
 249.149 + SHELL	= /bin/sh
 249.150 +-.c.o:;	$(CC) $(CFLAGS) -c $*.c
 249.151 ++.c.o:;	$(CC) $(CFLAGS) -o $*.o -c $*.c
 249.152 ++
 249.153 ++SOMAJOR = 0
 249.154 ++SOMINOR = 7.6
 249.155 ++
 249.156 ++LIB	= libwrap.a
 249.157 ++SHLIB	= shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
 249.158 ++SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
 249.159 ++SHLIBSO	= shared/libwrap.so
 249.160 ++SHLIBFLAGS = -Lshared -lwrap
 249.161 + 
 249.162 +-CFLAGS	= -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
 249.163 ++shared/%.o: %.c
 249.164 ++	$(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
 249.165 ++
 249.166 ++CFLAGS	= -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
 249.167 + 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
 249.168 + 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
 249.169 + 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
 249.170 + 	$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
 249.171 + 	$(VSYSLOG) $(HOSTNAME)
 249.172 + 
 249.173 ++SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
 249.174 ++SHCFLAGS = -fPIC -shared -D_REENTRANT
 249.175 ++
 249.176 + LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
 249.177 + 	hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
 249.178 + 	$(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
 249.179 + 	update.o misc.o diag.o percent_m.o myvsyslog.o
 249.180 + 
 249.181 ++SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
 249.182 ++
 249.183 + FROM_OBJ= fromhost.o
 249.184 + 
 249.185 + KIT	= README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
 249.186 +@@ -684,46 +719,80 @@
 249.187 + 	refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
 249.188 + 	scaffold.h tcpdmatch.8 README.NIS
 249.189 + 
 249.190 +-LIB	= libwrap.a
 249.191 +-
 249.192 +-all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
 249.193 ++all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
 249.194 + 
 249.195 + # Invalidate all object files when the compiler options (CFLAGS) have changed.
 249.196 + 
 249.197 + config-check:
 249.198 + 	@set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
 249.199 +-	@set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
 249.200 +-	if cmp cflags /tmp/cflags.$$$$ ; \
 249.201 +-	then rm /tmp/cflags.$$$$ ; \
 249.202 +-	else mv /tmp/cflags.$$$$ cflags ; \
 249.203 ++	@set +e; echo $(CFLAGS) >cflags.new ; \
 249.204 ++	if cmp cflags cflags.new ; \
 249.205 ++	then rm cflags.new ; \
 249.206 ++	else mv cflags.new cflags ; \
 249.207 + 	fi >/dev/null 2>/dev/null
 249.208 ++	@if [ ! -d shared ]; then mkdir shared; fi
 249.209 + 
 249.210 + $(LIB):	$(LIB_OBJ)
 249.211 + 	rm -f $(LIB)
 249.212 + 	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
 249.213 + 	-$(RANLIB) $(LIB)
 249.214 + 
 249.215 +-tcpd:	tcpd.o $(LIB)
 249.216 +-	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
 249.217 ++$(SHLIB): $(SHLIB_OBJ)
 249.218 ++	rm -f $(SHLIB)
 249.219 ++	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
 249.220 ++	ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
 249.221 ++	ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
 249.222 ++
 249.223 ++tcpd:	tcpd.o $(SHLIB)
 249.224 ++	$(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
 249.225 + 
 249.226 +-miscd:	miscd.o $(LIB)
 249.227 +-	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
 249.228 ++miscd:	miscd.o $(SHLIB)
 249.229 ++	$(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
 249.230 + 
 249.231 +-safe_finger: safe_finger.o $(LIB)
 249.232 +-	$(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
 249.233 ++safe_finger: safe_finger.o $(SHLIB)
 249.234 ++	$(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
 249.235 + 
 249.236 + TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
 249.237 + 
 249.238 +-tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
 249.239 +-	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
 249.240 ++tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
 249.241 ++	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
 249.242 + 
 249.243 +-try-from: try-from.o fakelog.o $(LIB)
 249.244 +-	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
 249.245 ++try-from: try-from.o fakelog.o $(SHLIB)
 249.246 ++	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
 249.247 + 
 249.248 + TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
 249.249 + 
 249.250 +-tcpdchk: $(TCPDCHK_OBJ) $(LIB)
 249.251 +-	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
 249.252 ++tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
 249.253 ++	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
 249.254 ++
 249.255 ++install: install-lib install-bin install-dev
 249.256 ++
 249.257 ++install-lib:
 249.258 ++	install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/
 249.259 ++	ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ))
 249.260 ++	ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
 249.261 ++
 249.262 ++install-bin:
 249.263 ++	install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
 249.264 ++	install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
 249.265 ++	install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
 249.266 ++	install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
 249.267 ++	install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
 249.268 ++	install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
 249.269 ++	install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
 249.270 ++	install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/
 249.271 ++	install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
 249.272 ++	install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/
 249.273 ++	install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
 249.274 ++	install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
 249.275 ++
 249.276 ++install-dev:
 249.277 ++	install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
 249.278 ++	install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
 249.279 ++	install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
 249.280 ++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
 249.281 ++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
 249.282 ++	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
 249.283 + 
 249.284 + shar:	$(KIT)
 249.285 + 	@shar $(KIT)
 249.286 +@@ -739,7 +808,8 @@
 249.287 + 
 249.288 + clean:
 249.289 + 	rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
 249.290 +-	cflags
 249.291 ++	cflags libwrap*.so*
 249.292 ++	rm -rf shared
 249.293 + 
 249.294 + tidy:	clean
 249.295 + 	chmod -R a+r .
 249.296 +@@ -885,5 +955,6 @@
 249.297 + update.o: mystdarg.h
 249.298 + update.o: tcpd.h
 249.299 + vfprintf.o: cflags
 249.300 ++weak_symbols.o: tcpd.h
 249.301 + workarounds.o: cflags
 249.302 + workarounds.o: tcpd.h
 249.303 +diff -Naur tcp_wrappers_7.6/fix_options.c tcp_wrappers_7.6.gimli/fix_options.c
 249.304 +--- tcp_wrappers_7.6/fix_options.c	1997-04-07 19:29:19.000000000 -0500
 249.305 ++++ tcp_wrappers_7.6.gimli/fix_options.c	2002-01-07 08:50:19.000000000 -0600
 249.306 +@@ -35,7 +35,12 @@
 249.307 + #ifdef IP_OPTIONS
 249.308 +     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
 249.309 +     char    lbuf[BUFFER_SIZE], *lp;
 249.310 ++#if !defined(__GLIBC__)
 249.311 +     int     optsize = sizeof(optbuf), ipproto;
 249.312 ++#else /* __GLIBC__ */
 249.313 ++    size_t  optsize = sizeof(optbuf);
 249.314 ++    int     ipproto;
 249.315 ++#endif /* __GLIBC__ */
 249.316 +     struct protoent *ip;
 249.317 +     int     fd = request->fd;
 249.318 +     unsigned int opt;
 249.319 +diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3
 249.320 +--- tcp_wrappers_7.6/hosts_access.3	1996-02-11 10:01:27.000000000 -0600
 249.321 ++++ tcp_wrappers_7.6.gimli/hosts_access.3	2002-01-07 08:50:19.000000000 -0600
 249.322 +@@ -3,7 +3,7 @@
 249.323 + hosts_access, hosts_ctl, request_init, request_set \- access control library
 249.324 + .SH SYNOPSIS
 249.325 + .nf
 249.326 +-#include "tcpd.h"
 249.327 ++#include <tcpd.h>
 249.328 + 
 249.329 + extern int allow_severity;
 249.330 + extern int deny_severity;
 249.331 +diff -Naur tcp_wrappers_7.6/hosts_access.5 tcp_wrappers_7.6.gimli/hosts_access.5
 249.332 +--- tcp_wrappers_7.6/hosts_access.5	1995-01-30 12:51:47.000000000 -0600
 249.333 ++++ tcp_wrappers_7.6.gimli/hosts_access.5	2002-01-07 08:50:19.000000000 -0600
 249.334 +@@ -8,9 +8,9 @@
 249.335 + impatient reader is encouraged to skip to the EXAMPLES section for a
 249.336 + quick introduction.
 249.337 + .PP
 249.338 +-An extended version of the access control language is described in the
 249.339 +-\fIhosts_options\fR(5) document. The extensions are turned on at
 249.340 +-program build time by building with -DPROCESS_OPTIONS.
 249.341 ++The extended version of the access control language is described in the
 249.342 ++\fIhosts_options\fR(5) document. \fBNote that this language supersedes
 249.343 ++the meaning of \fIshell_command\fB as documented below.\fR
 249.344 + .PP
 249.345 + In the following text, \fIdaemon\fR is the the process name of a
 249.346 + network daemon process, and \fIclient\fR is the name and/or address of
 249.347 +@@ -40,7 +40,7 @@
 249.348 + character. This permits you to break up long lines so that they are
 249.349 + easier to edit.
 249.350 + .IP \(bu
 249.351 +-Blank lines or lines that begin with a `#\' character are ignored.
 249.352 ++Blank lines or lines that begin with a `#' character are ignored.
 249.353 + This permits you to insert comments and whitespace so that the tables
 249.354 + are easier to read.
 249.355 + .IP \(bu
 249.356 +@@ -69,26 +69,33 @@
 249.357 + .SH PATTERNS
 249.358 + The access control language implements the following patterns:
 249.359 + .IP \(bu
 249.360 +-A string that begins with a `.\' character. A host name is matched if
 249.361 ++A string that begins with a `.' character. A host name is matched if
 249.362 + the last components of its name match the specified pattern.  For
 249.363 +-example, the pattern `.tue.nl\' matches the host name
 249.364 +-`wzv.win.tue.nl\'.
 249.365 ++example, the pattern `.tue.nl' matches the host name
 249.366 ++`wzv.win.tue.nl'.
 249.367 + .IP \(bu
 249.368 +-A string that ends with a `.\' character. A host address is matched if
 249.369 ++A string that ends with a `.' character. A host address is matched if
 249.370 + its first numeric fields match the given string.  For example, the
 249.371 +-pattern `131.155.\' matches the address of (almost) every host on the
 249.372 ++pattern `131.155.' matches the address of (almost) every host on the
 249.373 + Eind\%hoven University network (131.155.x.x).
 249.374 + .IP \(bu
 249.375 +-A string that begins with an `@\' character is treated as an NIS
 249.376 ++A string that begins with an `@' character is treated as an NIS
 249.377 + (formerly YP) netgroup name. A host name is matched if it is a host
 249.378 + member of the specified netgroup. Netgroup matches are not supported
 249.379 + for daemon process names or for client user names.
 249.380 + .IP \(bu
 249.381 +-An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
 249.382 +-`net/mask\' pair. A host address is matched if `net\' is equal to the
 249.383 +-bitwise AND of the address and the `mask\'. For example, the net/mask
 249.384 +-pattern `131.155.72.0/255.255.254.0\' matches every address in the
 249.385 +-range `131.155.72.0\' through `131.155.73.255\'.
 249.386 ++An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
 249.387 ++`net/mask' pair. A host address is matched if `net' is equal to the
 249.388 ++bitwise AND of the address and the `mask'. For example, the net/mask
 249.389 ++pattern `131.155.72.0/255.255.254.0' matches every address in the
 249.390 ++range `131.155.72.0' through `131.155.73.255'.
 249.391 ++.IP \(bu
 249.392 ++A string that begins with a `/' character is treated as a file
 249.393 ++name. A host name or address is matched if it matches any host name
 249.394 ++or address pattern listed in the named file. The file format is
 249.395 ++zero or more lines with zero or more host name or address patterns
 249.396 ++separated by whitespace.  A file name pattern can be used anywhere
 249.397 ++a host name or address pattern can be used.
 249.398 + .SH WILDCARDS
 249.399 + The access control language supports explicit wildcards:
 249.400 + .IP ALL
 249.401 +@@ -115,19 +122,19 @@
 249.402 + .ne 6
 249.403 + .SH OPERATORS
 249.404 + .IP EXCEPT
 249.405 +-Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
 249.406 ++Intended use is of the form: `list_1 EXCEPT list_2'; this construct
 249.407 + matches anything that matches \fIlist_1\fR unless it matches
 249.408 + \fIlist_2\fR.  The EXCEPT operator can be used in daemon_lists and in
 249.409 + client_lists. The EXCEPT operator can be nested: if the control
 249.410 +-language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
 249.411 +-would parse as `(a EXCEPT (b EXCEPT c))\'.
 249.412 ++language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
 249.413 ++would parse as `(a EXCEPT (b EXCEPT c))'.
 249.414 + .br
 249.415 + .ne 6
 249.416 + .SH SHELL COMMANDS
 249.417 + If the first-matched access control rule contains a shell command, that
 249.418 + command is subjected to %<letter> substitutions (see next section).
 249.419 + The result is executed by a \fI/bin/sh\fR child process with standard
 249.420 +-input, output and error connected to \fI/dev/null\fR.  Specify an `&\'
 249.421 ++input, output and error connected to \fI/dev/null\fR.  Specify an `&'
 249.422 + at the end of the command if you do not want to wait until it has
 249.423 + completed.
 249.424 + .PP
 249.425 +@@ -159,7 +166,7 @@
 249.426 + .IP %u
 249.427 + The client user name (or "unknown").
 249.428 + .IP %%
 249.429 +-Expands to a single `%\' character.
 249.430 ++Expands to a single `%' character.
 249.431 + .PP
 249.432 + Characters in % expansions that may confuse the shell are replaced by
 249.433 + underscores.
 249.434 +@@ -243,9 +250,9 @@
 249.435 + less trustworthy. It is possible for an intruder to spoof both the
 249.436 + client connection and the IDENT lookup, although doing so is much
 249.437 + harder than spoofing just a client connection. It may also be that
 249.438 +-the client\'s IDENT server is lying.
 249.439 ++the client's IDENT server is lying.
 249.440 + .PP
 249.441 +-Note: IDENT lookups don\'t work with UDP services. 
 249.442 ++Note: IDENT lookups don't work with UDP services. 
 249.443 + .SH EXAMPLES
 249.444 + The language is flexible enough that different types of access control
 249.445 + policy can be expressed with a minimum of fuss. Although the language
 249.446 +@@ -285,7 +292,7 @@
 249.447 + .br
 249.448 + ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
 249.449 + .PP
 249.450 +-The first rule permits access from hosts in the local domain (no `.\'
 249.451 ++The first rule permits access from hosts in the local domain (no `.'
 249.452 + in the host name) and from members of the \fIsome_netgroup\fP
 249.453 + netgroup.  The second rule permits access from all hosts in the
 249.454 + \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
 249.455 +@@ -322,8 +329,8 @@
 249.456 + /etc/hosts.deny:
 249.457 + .in +3
 249.458 + .nf
 249.459 +-in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
 249.460 +-	/usr/ucb/mail -s %d-%h root) &
 249.461 ++in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
 249.462 ++	/usr/bin/mail -s %d-%h root) &
 249.463 + .fi
 249.464 + .PP
 249.465 + The safe_finger command comes with the tcpd wrapper and should be
 249.466 +@@ -349,7 +356,7 @@
 249.467 + capacity of an internal buffer; when an access control rule is not
 249.468 + terminated by a newline character; when the result of %<letter>
 249.469 + expansion would overflow an internal buffer; when a system call fails
 249.470 +-that shouldn\'t.  All problems are reported via the syslog daemon.
 249.471 ++that shouldn't.  All problems are reported via the syslog daemon.
 249.472 + .SH FILES
 249.473 + .na
 249.474 + .nf
 249.475 +diff -Naur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.gimli/hosts_access.c
 249.476 +--- tcp_wrappers_7.6/hosts_access.c	1997-02-11 19:13:23.000000000 -0600
 249.477 ++++ tcp_wrappers_7.6.gimli/hosts_access.c	2002-01-07 08:50:19.000000000 -0600
 249.478 +@@ -240,6 +240,26 @@
 249.479 +     }
 249.480 + }
 249.481 + 
 249.482 ++/* hostfile_match - look up host patterns from file */
 249.483 ++
 249.484 ++static int hostfile_match(path, host)
 249.485 ++char   *path;
 249.486 ++struct hosts_info *host;
 249.487 ++{
 249.488 ++    char    tok[BUFSIZ];
 249.489 ++    int     match = NO;
 249.490 ++    FILE   *fp;
 249.491 ++
 249.492 ++    if ((fp = fopen(path, "r")) != 0) {
 249.493 ++        while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
 249.494 ++            /* void */ ;
 249.495 ++        fclose(fp);
 249.496 ++    } else if (errno != ENOENT) {
 249.497 ++        tcpd_warn("open %s: %m", path);
 249.498 ++    }
 249.499 ++    return (match);
 249.500 ++}
 249.501 ++
 249.502 + /* host_match - match host name and/or address against pattern */
 249.503 + 
 249.504 + static int host_match(tok, host)
 249.505 +@@ -267,6 +287,8 @@
 249.506 + 	tcpd_warn("netgroup support is disabled");	/* not tcpd_jump() */
 249.507 + 	return (NO);
 249.508 + #endif
 249.509 ++    } else if (tok[0] == '/') {                         /* /file hack */
 249.510 ++        return (hostfile_match(tok, host));
 249.511 +     } else if (STR_EQ(tok, "KNOWN")) {		/* check address and name */
 249.512 + 	char   *name = eval_hostname(host);
 249.513 + 	return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
 249.514 +diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5
 249.515 +--- tcp_wrappers_7.6/hosts_options.5	1994-12-28 10:42:29.000000000 -0600
 249.516 ++++ tcp_wrappers_7.6.gimli/hosts_options.5	2002-01-07 08:50:19.000000000 -0600
 249.517 +@@ -58,12 +58,12 @@
 249.518 + Execute, in a child process, the specified shell command, after
 249.519 + performing the %<letter> expansions described in the hosts_access(5)
 249.520 + manual page.  The command is executed with stdin, stdout and stderr
 249.521 +-connected to the null device, so that it won\'t mess up the
 249.522 ++connected to the null device, so that it won't mess up the
 249.523 + conversation with the client host. Example:
 249.524 + .sp
 249.525 + .nf
 249.526 + .ti +3
 249.527 +-spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
 249.528 ++spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
 249.529 + .fi
 249.530 + .sp
 249.531 + executes, in a background child process, the shell command "safe_finger
 249.532 +diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c
 249.533 +--- tcp_wrappers_7.6/options.c	1996-02-11 10:01:32.000000000 -0600
 249.534 ++++ tcp_wrappers_7.6.gimli/options.c	2002-01-07 08:50:19.000000000 -0600
 249.535 +@@ -473,6 +473,9 @@
 249.536 + #ifdef LOG_CRON
 249.537 +     "cron", LOG_CRON,
 249.538 + #endif
 249.539 ++#ifdef LOG_FTP
 249.540 ++    "ftp", LOG_FTP,
 249.541 ++#endif
 249.542 + #ifdef LOG_LOCAL0
 249.543 +     "local0", LOG_LOCAL0,
 249.544 + #endif
 249.545 +diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c
 249.546 +--- tcp_wrappers_7.6/percent_m.c	1994-12-28 10:42:37.000000000 -0600
 249.547 ++++ tcp_wrappers_7.6.gimli/percent_m.c	2002-01-07 08:50:19.000000000 -0600
 249.548 +@@ -13,7 +13,7 @@
 249.549 + #include <string.h>
 249.550 + 
 249.551 + extern int errno;
 249.552 +-#ifndef SYS_ERRLIST_DEFINED
 249.553 ++#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
 249.554 + extern char *sys_errlist[];
 249.555 + extern int sys_nerr;
 249.556 + #endif
 249.557 +@@ -29,11 +29,15 @@
 249.558 + 
 249.559 +     while (*bp = *cp)
 249.560 + 	if (*cp == '%' && cp[1] == 'm') {
 249.561 ++#ifdef HAVE_STRERROR
 249.562 ++            strcpy(bp, strerror(errno));
 249.563 ++#else
 249.564 + 	    if (errno < sys_nerr && errno > 0) {
 249.565 + 		strcpy(bp, sys_errlist[errno]);
 249.566 + 	    } else {
 249.567 + 		sprintf(bp, "Unknown error %d", errno);
 249.568 + 	    }
 249.569 ++#endif
 249.570 + 	    bp += strlen(bp);
 249.571 + 	    cp += 2;
 249.572 + 	} else {
 249.573 +diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c
 249.574 +--- tcp_wrappers_7.6/rfc931.c	1995-01-02 09:11:34.000000000 -0600
 249.575 ++++ tcp_wrappers_7.6.gimli/rfc931.c	2002-01-07 08:50:19.000000000 -0600
 249.576 +@@ -33,7 +33,7 @@
 249.577 + 
 249.578 + int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
 249.579 + 
 249.580 +-static jmp_buf timebuf;
 249.581 ++static sigjmp_buf timebuf;
 249.582 + 
 249.583 + /* fsocket - open stdio stream on top of socket */
 249.584 + 
 249.585 +@@ -62,7 +62,7 @@
 249.586 + static void timeout(sig)
 249.587 + int     sig;
 249.588 + {
 249.589 +-    longjmp(timebuf, sig);
 249.590 ++    siglongjmp(timebuf, sig);
 249.591 + }
 249.592 + 
 249.593 + /* rfc931 - return remote user name, given socket structures */
 249.594 +@@ -99,7 +99,7 @@
 249.595 + 	 * Set up a timer so we won't get stuck while waiting for the server.
 249.596 + 	 */
 249.597 + 
 249.598 +-	if (setjmp(timebuf) == 0) {
 249.599 ++	if (sigsetjmp(timebuf,1) == 0) {
 249.600 + 	    signal(SIGALRM, timeout);
 249.601 + 	    alarm(rfc931_timeout);
 249.602 + 
 249.603 +diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8
 249.604 +--- tcp_wrappers_7.6/safe_finger.8	1969-12-31 18:00:00.000000000 -0600
 249.605 ++++ tcp_wrappers_7.6.gimli/safe_finger.8	2002-01-07 08:50:19.000000000 -0600
 249.606 +@@ -0,0 +1,34 @@
 249.607 ++.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
 249.608 ++.SH NAME
 249.609 ++safe_finger \- finger client wrapper that protects against nasty stuff
 249.610 ++from finger servers
 249.611 ++.SH SYNOPSIS
 249.612 ++.B safe_finger [finger_options]
 249.613 ++.SH DESCRIPTION
 249.614 ++The
 249.615 ++.B safe_finger
 249.616 ++command protects against nasty stuff from finger servers. Use this
 249.617 ++program for automatic reverse finger probes from the
 249.618 ++.B tcp_wrapper
 249.619 ++.B (tcpd)
 249.620 ++, not the raw finger command. The
 249.621 ++.B safe_finger
 249.622 ++command makes sure that the finger client is not run with root
 249.623 ++privileges. It also runs the finger client with a defined PATH
 249.624 ++environment.
 249.625 ++.B safe_finger
 249.626 ++will also protect you from problems caused by the output of some
 249.627 ++finger servers. The problem: some programs may react to stuff in
 249.628 ++the first column. Other programs may get upset by thrash anywhere
 249.629 ++on a line. File systems may fill up as the finger server keeps
 249.630 ++sending data. Text editors may bomb out on extremely long lines.
 249.631 ++The finger server may take forever because it is somehow wedged.
 249.632 ++.B safe_finger
 249.633 ++takes care of all this badness.
 249.634 ++.SH SEE ALSO
 249.635 ++.BR hosts_access (5),
 249.636 ++.BR hosts_options (5),
 249.637 ++.BR tcpd (8)
 249.638 ++.SH AUTHOR
 249.639 ++Wietse Venema, Eindhoven University of Technology, The Netherlands.
 249.640 ++
 249.641 +diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c
 249.642 +--- tcp_wrappers_7.6/safe_finger.c	1994-12-28 10:42:42.000000000 -0600
 249.643 ++++ tcp_wrappers_7.6.gimli/safe_finger.c	2002-01-07 08:50:19.000000000 -0600
 249.644 +@@ -26,21 +26,24 @@
 249.645 + #include <stdio.h>
 249.646 + #include <ctype.h>
 249.647 + #include <pwd.h>
 249.648 ++#include <syslog.h>
 249.649 + 
 249.650 + extern void exit();
 249.651 + 
 249.652 + /* Local stuff */
 249.653 + 
 249.654 +-char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
 249.655 ++char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
 249.656 + 
 249.657 + #define	TIME_LIMIT	60		/* Do not keep listinging forever */
 249.658 + #define	INPUT_LENGTH	100000		/* Do not keep listinging forever */
 249.659 + #define	LINE_LENGTH	128		/* Editors can choke on long lines */
 249.660 + #define	FINGER_PROGRAM	"finger"	/* Most, if not all, UNIX systems */
 249.661 + #define	UNPRIV_NAME	"nobody"	/* Preferred privilege level */
 249.662 +-#define	UNPRIV_UGID	32767		/* Default uid and gid */
 249.663 ++#define	UNPRIV_UGID	65534		/* Default uid and gid */
 249.664 + 
 249.665 + int     finger_pid;
 249.666 ++int	allow_severity = SEVERITY;
 249.667 ++int	deny_severity = LOG_WARNING;
 249.668 + 
 249.669 + void    cleanup(sig)
 249.670 + int     sig;
 249.671 +diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c
 249.672 +--- tcp_wrappers_7.6/scaffold.c	1997-03-21 12:27:24.000000000 -0600
 249.673 ++++ tcp_wrappers_7.6.gimli/scaffold.c	2002-01-07 08:50:19.000000000 -0600
 249.674 +@@ -180,10 +180,12 @@
 249.675 + 
 249.676 + /* ARGSUSED */
 249.677 + 
 249.678 +-void    rfc931(request)
 249.679 +-struct request_info *request;
 249.680 ++void    rfc931(rmt_sin, our_sin, dest)
 249.681 ++struct sockaddr_in *rmt_sin;
 249.682 ++struct sockaddr_in *our_sin;
 249.683 ++char   *dest;
 249.684 + {
 249.685 +-    strcpy(request->user, unknown);
 249.686 ++    strcpy(dest, unknown);
 249.687 + }
 249.688 + 
 249.689 + /* check_path - examine accessibility */
 249.690 +diff -Naur tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.gimli/socket.c
 249.691 +--- tcp_wrappers_7.6/socket.c	1997-03-21 12:27:25.000000000 -0600
 249.692 ++++ tcp_wrappers_7.6.gimli/socket.c	2002-01-07 08:50:19.000000000 -0600
 249.693 +@@ -76,7 +76,11 @@
 249.694 + {
 249.695 +     static struct sockaddr_in client;
 249.696 +     static struct sockaddr_in server;
 249.697 ++#if !defined (__GLIBC__)
 249.698 +     int     len;
 249.699 ++#else /* __GLIBC__ */
 249.700 ++    size_t  len;
 249.701 ++#endif /* __GLIBC__ */
 249.702 +     char    buf[BUFSIZ];
 249.703 +     int     fd = request->fd;
 249.704 + 
 249.705 +@@ -224,7 +228,11 @@
 249.706 + {
 249.707 +     char    buf[BUFSIZ];
 249.708 +     struct sockaddr_in sin;
 249.709 ++#if !defined(__GLIBC__)
 249.710 +     int     size = sizeof(sin);
 249.711 ++#else /* __GLIBC__ */
 249.712 ++    size_t  size = sizeof(sin);
 249.713 ++#endif /* __GLIBC__ */
 249.714 + 
 249.715 +     /*
 249.716 +      * Eat up the not-yet received datagram. Some systems insist on a
 249.717 +diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8
 249.718 +--- tcp_wrappers_7.6/tcpd.8	1996-02-21 09:39:16.000000000 -0600
 249.719 ++++ tcp_wrappers_7.6.gimli/tcpd.8	2002-01-07 08:50:19.000000000 -0600
 249.720 +@@ -94,7 +94,7 @@
 249.721 + .PP
 249.722 + The example assumes that the network daemons live in /usr/etc. On some
 249.723 + systems, network daemons live in /usr/sbin or in /usr/libexec, or have
 249.724 +-no `in.\' prefix to their name.
 249.725 ++no `in.' prefix to their name.
 249.726 + .SH EXAMPLE 2
 249.727 + This example applies when \fItcpd\fR expects that the network daemons
 249.728 + are left in their original place.
 249.729 +@@ -110,26 +110,26 @@
 249.730 + becomes:
 249.731 + .sp
 249.732 + .ti +5
 249.733 +-finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
 249.734 ++finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd       in.fingerd
 249.735 + .sp
 249.736 + .fi
 249.737 + .PP
 249.738 + The example assumes that the network daemons live in /usr/etc. On some
 249.739 + systems, network daemons live in /usr/sbin or in /usr/libexec, the
 249.740 +-daemons have no `in.\' prefix to their name, or there is no userid
 249.741 ++daemons have no `in.' prefix to their name, or there is no userid
 249.742 + field in the inetd configuration file.
 249.743 + .PP
 249.744 + Similar changes will be needed for the other services that are to be
 249.745 +-covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
 249.746 ++covered by \fItcpd\fR.  Send a `kill -HUP' to the \fIinetd\fR(8)
 249.747 + process to make the changes effective. AIX users may also have to
 249.748 +-execute the `inetimp\' command.
 249.749 ++execute the `inetimp' command.
 249.750 + .SH EXAMPLE 3
 249.751 + In the case of daemons that do not live in a common directory ("secret"
 249.752 + or otherwise), edit the \fIinetd\fR configuration file so that it
 249.753 + specifies an absolute path name for the process name field. For example:
 249.754 + .nf
 249.755 + .sp
 249.756 +-    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
 249.757 ++    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/sbin/in.ntalkd
 249.758 + .sp
 249.759 + .fi
 249.760 + .PP
 249.761 +diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h
 249.762 +--- tcp_wrappers_7.6/tcpd.h	1996-03-19 09:22:25.000000000 -0600
 249.763 ++++ tcp_wrappers_7.6.gimli/tcpd.h	2002-01-07 08:50:19.000000000 -0600
 249.764 +@@ -4,6 +4,25 @@
 249.765 +   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
 249.766 +   */
 249.767 + 
 249.768 ++#ifndef _TCPWRAPPERS_TCPD_H
 249.769 ++#define _TCPWRAPPERS_TCPD_H
 249.770 ++
 249.771 ++/* someone else may have defined this */
 249.772 ++#undef  __P
 249.773 ++
 249.774 ++/* use prototypes if we have an ANSI C compiler or are using C++ */
 249.775 ++#if defined(__STDC__) || defined(__cplusplus)
 249.776 ++#define __P(args)       args
 249.777 ++#else
 249.778 ++#define __P(args)       ()
 249.779 ++#endif
 249.780 ++
 249.781 ++/* Need definitions of struct sockaddr_in and FILE. */
 249.782 ++#include <netinet/in.h>
 249.783 ++#include <stdio.h>
 249.784 ++
 249.785 ++__BEGIN_DECLS
 249.786 ++
 249.787 + /* Structure to describe one communications endpoint. */
 249.788 + 
 249.789 + #define STRING_LENGTH	128		/* hosts, users, processes */
 249.790 +@@ -25,10 +44,10 @@
 249.791 +     char    pid[10];			/* access via eval_pid(request) */
 249.792 +     struct host_info client[1];		/* client endpoint info */
 249.793 +     struct host_info server[1];		/* server endpoint info */
 249.794 +-    void  (*sink) ();			/* datagram sink function or 0 */
 249.795 +-    void  (*hostname) ();		/* address to printable hostname */
 249.796 +-    void  (*hostaddr) ();		/* address to printable address */
 249.797 +-    void  (*cleanup) ();		/* cleanup function or 0 */
 249.798 ++    void  (*sink) __P((int));		/* datagram sink function or 0 */
 249.799 ++    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
 249.800 ++    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
 249.801 ++    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
 249.802 +     struct netconfig *config;		/* netdir handle */
 249.803 + };
 249.804 + 
 249.805 +@@ -61,25 +80,30 @@
 249.806 + /* Global functions. */
 249.807 + 
 249.808 + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 249.809 +-extern void fromhost();			/* get/validate client host info */
 249.810 ++extern void fromhost __P((struct request_info *));	/* get/validate client host info */
 249.811 + #else
 249.812 + #define fromhost sock_host		/* no TLI support needed */
 249.813 + #endif
 249.814 + 
 249.815 +-extern int hosts_access();		/* access control */
 249.816 +-extern void shell_cmd();		/* execute shell command */
 249.817 +-extern char *percent_x();		/* do %<char> expansion */
 249.818 +-extern void rfc931();			/* client name from RFC 931 daemon */
 249.819 +-extern void clean_exit();		/* clean up and exit */
 249.820 +-extern void refuse();			/* clean up and exit */
 249.821 +-extern char *xgets();			/* fgets() on steroids */
 249.822 +-extern char *split_at();		/* strchr() and split */
 249.823 +-extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
 249.824 ++extern void shell_cmd __P((char *));	/* execute shell command */
 249.825 ++extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
 249.826 ++extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
 249.827 ++extern void clean_exit __P((struct request_info *)); /* clean up and exit */
 249.828 ++extern void refuse __P((struct request_info *));	/* clean up and exit */
 249.829 ++extern char *xgets __P((char *, int, FILE *));	/* fgets() on steroids */
 249.830 ++extern char *split_at __P((char *, int));	/* strchr() and split */
 249.831 ++extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
 249.832 + 
 249.833 + /* Global variables. */
 249.834 + 
 249.835 ++#ifdef HAVE_WEAKSYMS
 249.836 ++extern int allow_severity __attribute__ ((weak)); /* for connection logging */
 249.837 ++extern int deny_severity __attribute__ ((weak)); /* for connection logging */
 249.838 ++#else
 249.839 + extern int allow_severity;		/* for connection logging */
 249.840 + extern int deny_severity;		/* for connection logging */
 249.841 ++#endif
 249.842 ++
 249.843 + extern char *hosts_allow_table;		/* for verification mode redirection */
 249.844 + extern char *hosts_deny_table;		/* for verification mode redirection */
 249.845 + extern int hosts_access_verbose;	/* for verbose matching mode */
 249.846 +@@ -92,9 +116,14 @@
 249.847 +   */
 249.848 + 
 249.849 + #ifdef __STDC__
 249.850 ++extern int hosts_access(struct request_info *request);
 249.851 ++extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
 249.852 ++                     char *client_user);
 249.853 + extern struct request_info *request_init(struct request_info *,...);
 249.854 + extern struct request_info *request_set(struct request_info *,...);
 249.855 + #else
 249.856 ++extern int hosts_access();
 249.857 ++extern int hosts_ctl();
 249.858 + extern struct request_info *request_init();	/* initialize request */
 249.859 + extern struct request_info *request_set();	/* update request structure */
 249.860 + #endif
 249.861 +@@ -117,27 +146,31 @@
 249.862 +   * host_info structures serve as caches for the lookup results.
 249.863 +   */
 249.864 + 
 249.865 +-extern char *eval_user();		/* client user */
 249.866 +-extern char *eval_hostname();		/* printable hostname */
 249.867 +-extern char *eval_hostaddr();		/* printable host address */
 249.868 +-extern char *eval_hostinfo();		/* host name or address */
 249.869 +-extern char *eval_client();		/* whatever is available */
 249.870 +-extern char *eval_server();		/* whatever is available */
 249.871 ++extern char *eval_user __P((struct request_info *));	/* client user */
 249.872 ++extern char *eval_hostname __P((struct host_info *));	/* printable hostname */
 249.873 ++extern char *eval_hostaddr __P((struct host_info *));	/* printable host address */
 249.874 ++extern char *eval_hostinfo __P((struct host_info *));	/* host name or address */
 249.875 ++extern char *eval_client __P((struct request_info *));	/* whatever is available */
 249.876 ++extern char *eval_server __P((struct request_info *));	/* whatever is available */
 249.877 + #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
 249.878 + #define eval_pid(r)	((r)->pid)	/* process id */
 249.879 + 
 249.880 + /* Socket-specific methods, including DNS hostname lookups. */
 249.881 + 
 249.882 +-extern void sock_host();		/* look up endpoint addresses */
 249.883 +-extern void sock_hostname();		/* translate address to hostname */
 249.884 +-extern void sock_hostaddr();		/* address to printable address */
 249.885 ++/* look up endpoint addresses */
 249.886 ++extern void sock_host __P((struct request_info *));
 249.887 ++/* translate address to hostname */
 249.888 ++extern void sock_hostname __P((struct host_info *));
 249.889 ++/* address to printable address */
 249.890 ++extern void sock_hostaddr __P((struct host_info *));
 249.891 ++
 249.892 + #define sock_methods(r) \
 249.893 + 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
 249.894 + 
 249.895 + /* The System V Transport-Level Interface (TLI) interface. */
 249.896 + 
 249.897 + #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 249.898 +-extern void tli_host();			/* look up endpoint addresses etc. */
 249.899 ++extern void tli_host __P((struct request_info *));	/* look up endpoint addresses etc. */
 249.900 + #endif
 249.901 + 
 249.902 +  /*
 249.903 +@@ -178,7 +211,7 @@
 249.904 +   * behavior.
 249.905 +   */
 249.906 + 
 249.907 +-extern void process_options();		/* execute options */
 249.908 ++extern void process_options __P((char *, struct request_info *)); /* execute options */
 249.909 + extern int dry_run;			/* verification flag */
 249.910 + 
 249.911 + /* Bug workarounds. */
 249.912 +@@ -217,3 +250,7 @@
 249.913 + #define strtok	my_strtok
 249.914 + extern char *my_strtok();
 249.915 + #endif
 249.916 ++
 249.917 ++__END_DECLS
 249.918 ++
 249.919 ++#endif /* tcpd.h */
 249.920 +diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c
 249.921 +--- tcp_wrappers_7.6/tcpdchk.c	1997-02-11 19:13:25.000000000 -0600
 249.922 ++++ tcp_wrappers_7.6.gimli/tcpdchk.c	2002-01-07 08:50:19.000000000 -0600
 249.923 +@@ -350,6 +350,8 @@
 249.924 + {
 249.925 +     if (pat[0] == '@') {
 249.926 + 	tcpd_warn("%s: daemon name begins with \"@\"", pat);
 249.927 ++    } else if (pat[0] == '/') {
 249.928 ++        tcpd_warn("%s: daemon name begins with \"/\"", pat);
 249.929 +     } else if (pat[0] == '.') {
 249.930 + 	tcpd_warn("%s: daemon name begins with dot", pat);
 249.931 +     } else if (pat[strlen(pat) - 1] == '.') {
 249.932 +@@ -382,6 +384,8 @@
 249.933 + {
 249.934 +     if (pat[0] == '@') {			/* @netgroup */
 249.935 + 	tcpd_warn("%s: user name begins with \"@\"", pat);
 249.936 ++    } else if (pat[0] == '/') {
 249.937 ++        tcpd_warn("%s: user name begins with \"/\"", pat);
 249.938 +     } else if (pat[0] == '.') {
 249.939 + 	tcpd_warn("%s: user name begins with dot", pat);
 249.940 +     } else if (pat[strlen(pat) - 1] == '.') {
 249.941 +@@ -402,8 +406,13 @@
 249.942 + static int check_host(pat)
 249.943 + char   *pat;
 249.944 + {
 249.945 ++    char    buf[BUFSIZ];
 249.946 +     char   *mask;
 249.947 +     int     addr_count = 1;
 249.948 ++    FILE   *fp;
 249.949 ++    struct tcpd_context saved_context;
 249.950 ++    char   *cp;
 249.951 ++    char   *wsp = " \t\r\n";
 249.952 + 
 249.953 +     if (pat[0] == '@') {			/* @netgroup */
 249.954 + #ifdef NO_NETGRENT
 249.955 +@@ -422,6 +431,21 @@
 249.956 + 	tcpd_warn("netgroup support disabled");
 249.957 + #endif
 249.958 + #endif
 249.959 ++    } else if (pat[0] == '/') {                 /* /path/name */
 249.960 ++        if ((fp = fopen(pat, "r")) != 0) {
 249.961 ++            saved_context = tcpd_context;
 249.962 ++            tcpd_context.file = pat;
 249.963 ++            tcpd_context.line = 0;
 249.964 ++            while (fgets(buf, sizeof(buf), fp)) {
 249.965 ++                tcpd_context.line++;
 249.966 ++                for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
 249.967 ++                    check_host(cp);
 249.968 ++            }
 249.969 ++            tcpd_context = saved_context;
 249.970 ++            fclose(fp);
 249.971 ++        } else if (errno != ENOENT) {
 249.972 ++            tcpd_warn("open %s: %m", pat);
 249.973 ++        }
 249.974 +     } else if (mask = split_at(pat, '/')) {	/* network/netmask */
 249.975 + 	if (dot_quad_addr(pat) == INADDR_NONE
 249.976 + 	    || dot_quad_addr(mask) == INADDR_NONE)
 249.977 +diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8
 249.978 +--- tcp_wrappers_7.6/try-from.8	1969-12-31 18:00:00.000000000 -0600
 249.979 ++++ tcp_wrappers_7.6.gimli/try-from.8	2002-01-07 08:50:19.000000000 -0600
 249.980 +@@ -0,0 +1,28 @@
 249.981 ++.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
 249.982 ++.SH NAME
 249.983 ++try-from \- test program for the tcp_wrapper
 249.984 ++.SH SYNOPSIS
 249.985 ++.B try-from
 249.986 ++.SH DESCRIPTION
 249.987 ++The
 249.988 ++.B try-from
 249.989 ++command can be called via a remote shell command to find out
 249.990 ++if the hostname and address are properly recognized
 249.991 ++by the
 249.992 ++.B tcp_wrapper
 249.993 ++library, if username lookup works, and (SysV only) if the TLI
 249.994 ++on top of IP heuristics work. Diagnostics are reported through
 249.995 ++.BR syslog (3)
 249.996 ++and redirected to stderr.
 249.997 ++
 249.998 ++Example:
 249.999 ++
249.1000 ++rsh host /some/where/try-from
249.1001 ++
249.1002 ++.SH SEE ALSO
249.1003 ++.BR hosts_access (5),
249.1004 ++.BR hosts_options (5),
249.1005 ++.BR tcpd (8)
249.1006 ++.SH AUTHOR
249.1007 ++Wietse Venema, Eindhoven University of Technology, The Netherlands.
249.1008 ++
249.1009 +diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c
249.1010 +--- tcp_wrappers_7.6/weak_symbols.c	1969-12-31 18:00:00.000000000 -0600
249.1011 ++++ tcp_wrappers_7.6.gimli/weak_symbols.c	2002-01-07 08:50:19.000000000 -0600
249.1012 +@@ -0,0 +1,11 @@
249.1013 ++ /*
249.1014 ++  * @(#) weak_symbols.h 1.5 99/12/29 23:50
249.1015 ++  * 
249.1016 ++  * Author: Anthony Towns <ajt@debian.org>
249.1017 ++  */
249.1018 ++
249.1019 ++#ifdef HAVE_WEAKSYMS
249.1020 ++#include <syslog.h>
249.1021 ++int deny_severity = LOG_WARNING;
249.1022 ++int allow_severity = SEVERITY; 
249.1023 ++#endif
249.1024 +diff -Naur tcp_wrappers_7.6/workarounds.c tcp_wrappers_7.6.gimli/workarounds.c
249.1025 +--- tcp_wrappers_7.6/workarounds.c	1996-03-19 09:22:26.000000000 -0600
249.1026 ++++ tcp_wrappers_7.6.gimli/workarounds.c	2002-01-07 08:50:19.000000000 -0600
249.1027 +@@ -163,7 +163,11 @@
249.1028 + int     fix_getpeername(sock, sa, len)
249.1029 + int     sock;
249.1030 + struct sockaddr *sa;
249.1031 ++#if !defined(__GLIBC__)
249.1032 + int    *len;
249.1033 ++#else /* __GLIBC__ */
249.1034 ++size_t *len;
249.1035 ++#endif /* __GLIBC__ */
249.1036 + {
249.1037 +     int     ret;
249.1038 +     struct sockaddr_in *sin = (struct sockaddr_in *) sa;
   250.1 --- a/libwrap/stuff/tcp_wrappers-7.6-shared_lib_plus_plus-1.patch	Wed May 09 17:03:28 2018 +0300
   250.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   250.3 @@ -1,1035 +0,0 @@
   250.4 -Submitted By: Tushar Teredesai <tushar@linuxfromscratch.org>
   250.5 -Date: 2003-10-04
   250.6 -Initial Package Version: 7.6
   250.7 -Origin: http://archives.linuxfromscratch.org/mail-archives/blfs-dev/2003-January/001960.html
   250.8 -Description: The patch was created from the tcp_wrappers modified package by Mark Heerdink.
   250.9 -This patch provides the following improvements:
  250.10 -    * Install libwrap.so along with libwrap.a.
  250.11 -    * Create an install target for tcp_wrappers.
  250.12 -    * Compilation and security fixes.
  250.13 -    * Documentation fixes.
  250.14 -diff -Naur tcp_wrappers_7.6/Makefile tcp_wrappers_7.6.gimli/Makefile
  250.15 ---- tcp_wrappers_7.6/Makefile	1997-03-21 12:27:21.000000000 -0600
  250.16 -+++ tcp_wrappers_7.6.gimli/Makefile	2002-07-15 16:07:21.000000000 -0500
  250.17 -@@ -1,5 +1,10 @@
  250.18 -+GLIBC=$(shell grep -s -c __GLIBC__ /usr/include/features.h)
  250.19 -+
  250.20 - # @(#) Makefile 1.23 97/03/21 19:27:20
  250.21 - 
  250.22 -+# unset the HOSTNAME environment variable
  250.23 -+HOSTNAME =
  250.24 -+
  250.25 - what:
  250.26 - 	@echo
  250.27 - 	@echo "Usage: edit the REAL_DAEMON_DIR definition in the Makefile then:"
  250.28 -@@ -19,7 +24,7 @@
  250.29 - 	@echo "	generic (most bsd-ish systems with sys5 compatibility)"
  250.30 - 	@echo "	386bsd aix alpha apollo bsdos convex-ultranet dell-gcc dgux dgux543"
  250.31 - 	@echo "	dynix epix esix freebsd hpux irix4 irix5 irix6 isc iunix"
  250.32 --	@echo "	linux machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
  250.33 -+	@echo "	linux gnu machten mips(untested) ncrsvr4 netbsd next osf power_unix_211"
  250.34 - 	@echo "	ptx-2.x ptx-generic pyramid sco sco-nis sco-od2 sco-os5 sinix sunos4"
  250.35 - 	@echo "	sunos40 sunos5 sysv4 tandem ultrix unicos7 unicos8 unixware1 unixware2"
  250.36 - 	@echo "	uts215 uxp"
  250.37 -@@ -43,8 +48,8 @@
  250.38 - # Ultrix 4.x SunOS 4.x ConvexOS 10.x Dynix/ptx
  250.39 - #REAL_DAEMON_DIR=/usr/etc
  250.40 - #
  250.41 --# SysV.4 Solaris 2.x OSF AIX
  250.42 --#REAL_DAEMON_DIR=/usr/sbin
  250.43 -+# SysV.4 Solaris 2.x OSF AIX Linux
  250.44 -+REAL_DAEMON_DIR=/usr/sbin
  250.45 - #
  250.46 - # BSD 4.4
  250.47 - #REAL_DAEMON_DIR=/usr/libexec
  250.48 -@@ -141,10 +146,21 @@
  250.49 - 	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ= NETGROUP= TLI= \
  250.50 - 	EXTRA_CFLAGS=-DSYS_ERRLIST_DEFINED VSYSLOG= all
  250.51 - 
  250.52 -+ifneq ($(GLIBC),0)
  250.53 -+MYLIB=-lnsl
  250.54 -+endif
  250.55 -+
  250.56 - linux:
  250.57 - 	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
  250.58 --	LIBS= RANLIB=ranlib ARFLAGS=rv AUX_OBJ=setenv.o \
  250.59 --	NETGROUP= TLI= EXTRA_CFLAGS="-DBROKEN_SO_LINGER" all
  250.60 -+	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
  250.61 -+	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
  250.62 -+	EXTRA_CFLAGS="-DSYS_ERRLIST_DEFINED -DHAVE_WEAKSYMS -D_REENTRANT"
  250.63 -+
  250.64 -+gnu:
  250.65 -+	@make REAL_DAEMON_DIR=$(REAL_DAEMON_DIR) STYLE=$(STYLE) \
  250.66 -+	LIBS=$(MYLIB) RANLIB=ranlib ARFLAGS=rv AUX_OBJ=weak_symbols.o \
  250.67 -+	NETGROUP=-DNETGROUP TLI= VSYSLOG= BUGS= all \
  250.68 -+	EXTRA_CFLAGS="-DHAVE_STRERROR -DHAVE_WEAKSYMS -D_REENTRANT"
  250.69 - 
  250.70 - # This is good for many SYSV+BSD hybrids with NIS, probably also for HP-UX 7.x.
  250.71 - hpux hpux8 hpux9 hpux10:
  250.72 -@@ -391,7 +407,7 @@
  250.73 - # the ones provided with this source distribution. The environ.c module
  250.74 - # implements setenv(), getenv(), and putenv().
  250.75 - 
  250.76 --AUX_OBJ= setenv.o
  250.77 -+#AUX_OBJ= setenv.o
  250.78 - #AUX_OBJ= environ.o
  250.79 - #AUX_OBJ= environ.o strcasecmp.o
  250.80 - 
  250.81 -@@ -454,7 +470,8 @@
  250.82 - # host name aliases. Compile with -DSOLARIS_24_GETHOSTBYNAME_BUG to work
  250.83 - # around this. The workaround does no harm on other Solaris versions.
  250.84 - 
  250.85 --BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
  250.86 -+BUGS =
  250.87 -+#BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DLIBC_CALLS_STRTOK
  250.88 - #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DINET_ADDR_BUG
  250.89 - #BUGS = -DGETPEERNAME_BUG -DBROKEN_FGETS -DSOLARIS_24_GETHOSTBYNAME_BUG
  250.90 - 
  250.91 -@@ -464,7 +481,7 @@
  250.92 - # If your system supports NIS or YP-style netgroups, enable the following
  250.93 - # macro definition. Netgroups are used only for host access control.
  250.94 - #
  250.95 --#NETGROUP= -DNETGROUP
  250.96 -+NETGROUP= -DNETGROUP
  250.97 - 
  250.98 - ###############################################################
  250.99 - # System dependencies: whether or not your system has vsyslog()
 250.100 -@@ -491,7 +508,7 @@
 250.101 - # Uncomment the next definition to turn on the language extensions
 250.102 - # (examples: allow, deny, banners, twist and spawn).
 250.103 - # 
 250.104 --#STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
 250.105 -+STYLE	= -DPROCESS_OPTIONS	# Enable language extensions.
 250.106 - 
 250.107 - ################################################################
 250.108 - # Optional: Changing the default disposition of logfile records
 250.109 -@@ -514,7 +531,7 @@
 250.110 - #
 250.111 - # The LOG_XXX names below are taken from the /usr/include/syslog.h file.
 250.112 - 
 250.113 --FACILITY= LOG_MAIL	# LOG_MAIL is what most sendmail daemons use
 250.114 -+FACILITY= LOG_DAEMON	# LOG_MAIL is what most sendmail daemons use
 250.115 - 
 250.116 - # The syslog priority at which successful connections are logged.
 250.117 - 
 250.118 -@@ -610,7 +627,7 @@
 250.119 - # Paranoid mode implies hostname lookup. In order to disable hostname
 250.120 - # lookups altogether, see the next section.
 250.121 - 
 250.122 --PARANOID= -DPARANOID
 250.123 -+#PARANOID= -DPARANOID
 250.124 - 
 250.125 - ########################################
 250.126 - # Optional: turning off hostname lookups
 250.127 -@@ -623,7 +640,7 @@
 250.128 - # In order to perform selective hostname lookups, disable paranoid
 250.129 - # mode (see previous section) and comment out the following definition.
 250.130 - 
 250.131 --HOSTNAME= -DALWAYS_HOSTNAME
 250.132 -+#HOSTNAME= -DALWAYS_HOSTNAME
 250.133 - 
 250.134 - #############################################
 250.135 - # Optional: Turning on host ADDRESS checking
 250.136 -@@ -649,28 +666,46 @@
 250.137 - # source-routed traffic in the kernel. Examples: 4.4BSD derivatives,
 250.138 - # Solaris 2.x, and Linux. See your system documentation for details.
 250.139 - #
 250.140 --# KILL_OPT= -DKILL_IP_OPTIONS
 250.141 -+KILL_OPT= -DKILL_IP_OPTIONS
 250.142 - 
 250.143 - ## End configuration options
 250.144 - ############################
 250.145 - 
 250.146 - # Protection against weird shells or weird make programs.
 250.147 - 
 250.148 -+CC	= gcc
 250.149 - SHELL	= /bin/sh
 250.150 --.c.o:;	$(CC) $(CFLAGS) -c $*.c
 250.151 -+.c.o:;	$(CC) $(CFLAGS) -o $*.o -c $*.c
 250.152 -+
 250.153 -+SOMAJOR = 0
 250.154 -+SOMINOR = 7.6
 250.155 -+
 250.156 -+LIB	= libwrap.a
 250.157 -+SHLIB	= shared/libwrap.so.$(SOMAJOR).$(SOMINOR)
 250.158 -+SHLIBSOMAJ= shared/libwrap.so.$(SOMAJOR)
 250.159 -+SHLIBSO	= shared/libwrap.so
 250.160 -+SHLIBFLAGS = -Lshared -lwrap
 250.161 - 
 250.162 --CFLAGS	= -O -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
 250.163 -+shared/%.o: %.c
 250.164 -+	$(CC) $(CFLAGS) $(SHCFLAGS) -c $< -o $@
 250.165 -+
 250.166 -+CFLAGS	= -O2 -DFACILITY=$(FACILITY) $(ACCESS) $(PARANOID) $(NETGROUP) \
 250.167 - 	$(BUGS) $(SYSTYPE) $(AUTH) $(UMASK) \
 250.168 - 	-DREAL_DAEMON_DIR=\"$(REAL_DAEMON_DIR)\" $(STYLE) $(KILL_OPT) \
 250.169 - 	-DSEVERITY=$(SEVERITY) -DRFC931_TIMEOUT=$(RFC931_TIMEOUT) \
 250.170 - 	$(UCHAR) $(TABLES) $(STRINGS) $(TLI) $(EXTRA_CFLAGS) $(DOT) \
 250.171 - 	$(VSYSLOG) $(HOSTNAME)
 250.172 - 
 250.173 -+SHLINKFLAGS = -shared -Xlinker -soname -Xlinker libwrap.so.$(SOMAJOR) -lc $(LIBS)
 250.174 -+SHCFLAGS = -fPIC -shared -D_REENTRANT
 250.175 -+
 250.176 - LIB_OBJ= hosts_access.o options.o shell_cmd.o rfc931.o eval.o \
 250.177 - 	hosts_ctl.o refuse.o percent_x.o clean_exit.o $(AUX_OBJ) \
 250.178 - 	$(FROM_OBJ) fix_options.o socket.o tli.o workarounds.o \
 250.179 - 	update.o misc.o diag.o percent_m.o myvsyslog.o
 250.180 - 
 250.181 -+SHLIB_OBJ= $(addprefix shared/, $(LIB_OBJ));
 250.182 -+
 250.183 - FROM_OBJ= fromhost.o
 250.184 - 
 250.185 - KIT	= README miscd.c tcpd.c fromhost.c hosts_access.c shell_cmd.c \
 250.186 -@@ -684,46 +719,80 @@
 250.187 - 	refuse.c tcpdchk.8 setenv.c inetcf.c inetcf.h scaffold.c \
 250.188 - 	scaffold.h tcpdmatch.8 README.NIS
 250.189 - 
 250.190 --LIB	= libwrap.a
 250.191 --
 250.192 --all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk
 250.193 -+all other: config-check tcpd tcpdmatch try-from safe_finger tcpdchk $(LIB)
 250.194 - 
 250.195 - # Invalidate all object files when the compiler options (CFLAGS) have changed.
 250.196 - 
 250.197 - config-check:
 250.198 - 	@set +e; test -n "$(REAL_DAEMON_DIR)" || { make; exit 1; }
 250.199 --	@set +e; echo $(CFLAGS) >/tmp/cflags.$$$$ ; \
 250.200 --	if cmp cflags /tmp/cflags.$$$$ ; \
 250.201 --	then rm /tmp/cflags.$$$$ ; \
 250.202 --	else mv /tmp/cflags.$$$$ cflags ; \
 250.203 -+	@set +e; echo $(CFLAGS) >cflags.new ; \
 250.204 -+	if cmp cflags cflags.new ; \
 250.205 -+	then rm cflags.new ; \
 250.206 -+	else mv cflags.new cflags ; \
 250.207 - 	fi >/dev/null 2>/dev/null
 250.208 -+	@if [ ! -d shared ]; then mkdir shared; fi
 250.209 - 
 250.210 - $(LIB):	$(LIB_OBJ)
 250.211 - 	rm -f $(LIB)
 250.212 - 	$(AR) $(ARFLAGS) $(LIB) $(LIB_OBJ)
 250.213 - 	-$(RANLIB) $(LIB)
 250.214 - 
 250.215 --tcpd:	tcpd.o $(LIB)
 250.216 --	$(CC) $(CFLAGS) -o $@ tcpd.o $(LIB) $(LIBS)
 250.217 -+$(SHLIB): $(SHLIB_OBJ)
 250.218 -+	rm -f $(SHLIB)
 250.219 -+	$(CC) -o $(SHLIB) $(SHLINKFLAGS) $(SHLIB_OBJ)
 250.220 -+	ln -s $(notdir $(SHLIB)) $(SHLIBSOMAJ)
 250.221 -+	ln -s $(notdir $(SHLIBSOMAJ)) $(SHLIBSO)
 250.222 -+
 250.223 -+tcpd:	tcpd.o $(SHLIB)
 250.224 -+	$(CC) $(CFLAGS) -o $@ tcpd.o $(SHLIBFLAGS)
 250.225 - 
 250.226 --miscd:	miscd.o $(LIB)
 250.227 --	$(CC) $(CFLAGS) -o $@ miscd.o $(LIB) $(LIBS)
 250.228 -+miscd:	miscd.o $(SHLIB)
 250.229 -+	$(CC) $(CFLAGS) -o $@ miscd.o $(SHLIBFLAGS)
 250.230 - 
 250.231 --safe_finger: safe_finger.o $(LIB)
 250.232 --	$(CC) $(CFLAGS) -o $@ safe_finger.o $(LIB) $(LIBS)
 250.233 -+safe_finger: safe_finger.o $(SHLIB)
 250.234 -+	$(CC) $(CFLAGS) -o $@ safe_finger.o $(SHLIBFLAGS)
 250.235 - 
 250.236 - TCPDMATCH_OBJ = tcpdmatch.o fakelog.o inetcf.o scaffold.o
 250.237 - 
 250.238 --tcpdmatch: $(TCPDMATCH_OBJ) $(LIB)
 250.239 --	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(LIB) $(LIBS)
 250.240 -+tcpdmatch: $(TCPDMATCH_OBJ) $(SHLIB)
 250.241 -+	$(CC) $(CFLAGS) -o $@ $(TCPDMATCH_OBJ) $(SHLIBFLAGS)
 250.242 - 
 250.243 --try-from: try-from.o fakelog.o $(LIB)
 250.244 --	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(LIB) $(LIBS)
 250.245 -+try-from: try-from.o fakelog.o $(SHLIB)
 250.246 -+	$(CC) $(CFLAGS) -o $@ try-from.o fakelog.o $(SHLIBFLAGS)
 250.247 - 
 250.248 - TCPDCHK_OBJ = tcpdchk.o fakelog.o inetcf.o scaffold.o
 250.249 - 
 250.250 --tcpdchk: $(TCPDCHK_OBJ) $(LIB)
 250.251 --	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(LIB) $(LIBS)
 250.252 -+tcpdchk: $(TCPDCHK_OBJ) $(SHLIB)
 250.253 -+	$(CC) $(CFLAGS) -o $@ $(TCPDCHK_OBJ) $(SHLIBFLAGS)
 250.254 -+
 250.255 -+install: install-lib install-bin install-dev
 250.256 -+
 250.257 -+install-lib:
 250.258 -+	install -o root -g root -m 0755 $(SHLIB) ${DESTDIR}/usr/lib/
 250.259 -+	ln -sf $(notdir $(SHLIB)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSOMAJ))
 250.260 -+	ln -sf $(notdir $(SHLIBSOMAJ)) ${DESTDIR}/usr/lib/$(notdir $(SHLIBSO))
 250.261 -+
 250.262 -+install-bin:
 250.263 -+	install -o root -g root -m 0755 tcpd ${DESTDIR}/usr/sbin/
 250.264 -+	install -o root -g root -m 0755 tcpdchk ${DESTDIR}/usr/sbin/
 250.265 -+	install -o root -g root -m 0755 tcpdmatch ${DESTDIR}/usr/sbin/
 250.266 -+	install -o root -g root -m 0755 try-from ${DESTDIR}/usr/sbin/
 250.267 -+	install -o root -g root -m 0755 safe_finger ${DESTDIR}/usr/sbin/
 250.268 -+	install -o root -g root -m 0644 tcpd.8 ${DESTDIR}/usr/share/man/man8/
 250.269 -+	install -o root -g root -m 0644 tcpdchk.8 ${DESTDIR}/usr/share/man/man8/
 250.270 -+	install -o root -g root -m 0644 try-from.8 ${DESTDIR}/usr/share/man/man8/
 250.271 -+	install -o root -g root -m 0644 tcpdmatch.8 ${DESTDIR}/usr/share/man/man8/
 250.272 -+	install -o root -g root -m 0644 safe_finger.8 ${DESTDIR}/usr/share/man/man8/
 250.273 -+	install -o root -g root -m 0644 hosts_access.5 ${DESTDIR}/usr/share/man/man5/
 250.274 -+	install -o root -g root -m 0644 hosts_options.5 ${DESTDIR}/usr/share/man/man5/
 250.275 -+
 250.276 -+install-dev:
 250.277 -+	install -o root -g root -m 0644 hosts_access.3 ${DESTDIR}/usr/share/man/man3/
 250.278 -+	install -o root -g root -m 0644 tcpd.h ${DESTDIR}/usr/include/
 250.279 -+	install -o root -g root -m 0644 $(LIB) ${DESTDIR}/usr/lib/
 250.280 -+	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/hosts_ctl.3
 250.281 -+	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_init.3
 250.282 -+	ln -sf hosts_access.3 ${DESTDIR}/usr/share/man/man3/request_set.3
 250.283 - 
 250.284 - shar:	$(KIT)
 250.285 - 	@shar $(KIT)
 250.286 -@@ -739,7 +808,8 @@
 250.287 - 
 250.288 - clean:
 250.289 - 	rm -f tcpd miscd safe_finger tcpdmatch tcpdchk try-from *.[oa] core \
 250.290 --	cflags
 250.291 -+	cflags libwrap*.so*
 250.292 -+	rm -rf shared
 250.293 - 
 250.294 - tidy:	clean
 250.295 - 	chmod -R a+r .
 250.296 -@@ -885,5 +955,6 @@
 250.297 - update.o: mystdarg.h
 250.298 - update.o: tcpd.h
 250.299 - vfprintf.o: cflags
 250.300 -+weak_symbols.o: tcpd.h
 250.301 - workarounds.o: cflags
 250.302 - workarounds.o: tcpd.h
 250.303 -diff -Naur tcp_wrappers_7.6/fix_options.c tcp_wrappers_7.6.gimli/fix_options.c
 250.304 ---- tcp_wrappers_7.6/fix_options.c	1997-04-07 19:29:19.000000000 -0500
 250.305 -+++ tcp_wrappers_7.6.gimli/fix_options.c	2002-01-07 08:50:19.000000000 -0600
 250.306 -@@ -35,7 +35,12 @@
 250.307 - #ifdef IP_OPTIONS
 250.308 -     unsigned char optbuf[BUFFER_SIZE / 3], *cp;
 250.309 -     char    lbuf[BUFFER_SIZE], *lp;
 250.310 -+#if !defined(__GLIBC__)
 250.311 -     int     optsize = sizeof(optbuf), ipproto;
 250.312 -+#else /* __GLIBC__ */
 250.313 -+    size_t  optsize = sizeof(optbuf);
 250.314 -+    int     ipproto;
 250.315 -+#endif /* __GLIBC__ */
 250.316 -     struct protoent *ip;
 250.317 -     int     fd = request->fd;
 250.318 -     unsigned int opt;
 250.319 -diff -Naur tcp_wrappers_7.6/hosts_access.3 tcp_wrappers_7.6.gimli/hosts_access.3
 250.320 ---- tcp_wrappers_7.6/hosts_access.3	1996-02-11 10:01:27.000000000 -0600
 250.321 -+++ tcp_wrappers_7.6.gimli/hosts_access.3	2002-01-07 08:50:19.000000000 -0600
 250.322 -@@ -3,7 +3,7 @@
 250.323 - hosts_access, hosts_ctl, request_init, request_set \- access control library
 250.324 - .SH SYNOPSIS
 250.325 - .nf
 250.326 --#include "tcpd.h"
 250.327 -+#include <tcpd.h>
 250.328 - 
 250.329 - extern int allow_severity;
 250.330 - extern int deny_severity;
 250.331 -diff -Naur tcp_wrappers_7.6/hosts_access.5 tcp_wrappers_7.6.gimli/hosts_access.5
 250.332 ---- tcp_wrappers_7.6/hosts_access.5	1995-01-30 12:51:47.000000000 -0600
 250.333 -+++ tcp_wrappers_7.6.gimli/hosts_access.5	2002-01-07 08:50:19.000000000 -0600
 250.334 -@@ -8,9 +8,9 @@
 250.335 - impatient reader is encouraged to skip to the EXAMPLES section for a
 250.336 - quick introduction.
 250.337 - .PP
 250.338 --An extended version of the access control language is described in the
 250.339 --\fIhosts_options\fR(5) document. The extensions are turned on at
 250.340 --program build time by building with -DPROCESS_OPTIONS.
 250.341 -+The extended version of the access control language is described in the
 250.342 -+\fIhosts_options\fR(5) document. \fBNote that this language supersedes
 250.343 -+the meaning of \fIshell_command\fB as documented below.\fR
 250.344 - .PP
 250.345 - In the following text, \fIdaemon\fR is the the process name of a
 250.346 - network daemon process, and \fIclient\fR is the name and/or address of
 250.347 -@@ -40,7 +40,7 @@
 250.348 - character. This permits you to break up long lines so that they are
 250.349 - easier to edit.
 250.350 - .IP \(bu
 250.351 --Blank lines or lines that begin with a `#\' character are ignored.
 250.352 -+Blank lines or lines that begin with a `#' character are ignored.
 250.353 - This permits you to insert comments and whitespace so that the tables
 250.354 - are easier to read.
 250.355 - .IP \(bu
 250.356 -@@ -69,26 +69,33 @@
 250.357 - .SH PATTERNS
 250.358 - The access control language implements the following patterns:
 250.359 - .IP \(bu
 250.360 --A string that begins with a `.\' character. A host name is matched if
 250.361 -+A string that begins with a `.' character. A host name is matched if
 250.362 - the last components of its name match the specified pattern.  For
 250.363 --example, the pattern `.tue.nl\' matches the host name
 250.364 --`wzv.win.tue.nl\'.
 250.365 -+example, the pattern `.tue.nl' matches the host name
 250.366 -+`wzv.win.tue.nl'.
 250.367 - .IP \(bu
 250.368 --A string that ends with a `.\' character. A host address is matched if
 250.369 -+A string that ends with a `.' character. A host address is matched if
 250.370 - its first numeric fields match the given string.  For example, the
 250.371 --pattern `131.155.\' matches the address of (almost) every host on the
 250.372 -+pattern `131.155.' matches the address of (almost) every host on the
 250.373 - Eind\%hoven University network (131.155.x.x).
 250.374 - .IP \(bu
 250.375 --A string that begins with an `@\' character is treated as an NIS
 250.376 -+A string that begins with an `@' character is treated as an NIS
 250.377 - (formerly YP) netgroup name. A host name is matched if it is a host
 250.378 - member of the specified netgroup. Netgroup matches are not supported
 250.379 - for daemon process names or for client user names.
 250.380 - .IP \(bu
 250.381 --An expression of the form `n.n.n.n/m.m.m.m\' is interpreted as a
 250.382 --`net/mask\' pair. A host address is matched if `net\' is equal to the
 250.383 --bitwise AND of the address and the `mask\'. For example, the net/mask
 250.384 --pattern `131.155.72.0/255.255.254.0\' matches every address in the
 250.385 --range `131.155.72.0\' through `131.155.73.255\'.
 250.386 -+An expression of the form `n.n.n.n/m.m.m.m' is interpreted as a
 250.387 -+`net/mask' pair. A host address is matched if `net' is equal to the
 250.388 -+bitwise AND of the address and the `mask'. For example, the net/mask
 250.389 -+pattern `131.155.72.0/255.255.254.0' matches every address in the
 250.390 -+range `131.155.72.0' through `131.155.73.255'.
 250.391 -+.IP \(bu
 250.392 -+A string that begins with a `/' character is treated as a file
 250.393 -+name. A host name or address is matched if it matches any host name
 250.394 -+or address pattern listed in the named file. The file format is
 250.395 -+zero or more lines with zero or more host name or address patterns
 250.396 -+separated by whitespace.  A file name pattern can be used anywhere
 250.397 -+a host name or address pattern can be used.
 250.398 - .SH WILDCARDS
 250.399 - The access control language supports explicit wildcards:
 250.400 - .IP ALL
 250.401 -@@ -115,19 +122,19 @@
 250.402 - .ne 6
 250.403 - .SH OPERATORS
 250.404 - .IP EXCEPT
 250.405 --Intended use is of the form: `list_1 EXCEPT list_2\'; this construct
 250.406 -+Intended use is of the form: `list_1 EXCEPT list_2'; this construct
 250.407 - matches anything that matches \fIlist_1\fR unless it matches
 250.408 - \fIlist_2\fR.  The EXCEPT operator can be used in daemon_lists and in
 250.409 - client_lists. The EXCEPT operator can be nested: if the control
 250.410 --language would permit the use of parentheses, `a EXCEPT b EXCEPT c\'
 250.411 --would parse as `(a EXCEPT (b EXCEPT c))\'.
 250.412 -+language would permit the use of parentheses, `a EXCEPT b EXCEPT c'
 250.413 -+would parse as `(a EXCEPT (b EXCEPT c))'.
 250.414 - .br
 250.415 - .ne 6
 250.416 - .SH SHELL COMMANDS
 250.417 - If the first-matched access control rule contains a shell command, that
 250.418 - command is subjected to %<letter> substitutions (see next section).
 250.419 - The result is executed by a \fI/bin/sh\fR child process with standard
 250.420 --input, output and error connected to \fI/dev/null\fR.  Specify an `&\'
 250.421 -+input, output and error connected to \fI/dev/null\fR.  Specify an `&'
 250.422 - at the end of the command if you do not want to wait until it has
 250.423 - completed.
 250.424 - .PP
 250.425 -@@ -159,7 +166,7 @@
 250.426 - .IP %u
 250.427 - The client user name (or "unknown").
 250.428 - .IP %%
 250.429 --Expands to a single `%\' character.
 250.430 -+Expands to a single `%' character.
 250.431 - .PP
 250.432 - Characters in % expansions that may confuse the shell are replaced by
 250.433 - underscores.
 250.434 -@@ -243,9 +250,9 @@
 250.435 - less trustworthy. It is possible for an intruder to spoof both the
 250.436 - client connection and the IDENT lookup, although doing so is much
 250.437 - harder than spoofing just a client connection. It may also be that
 250.438 --the client\'s IDENT server is lying.
 250.439 -+the client's IDENT server is lying.
 250.440 - .PP
 250.441 --Note: IDENT lookups don\'t work with UDP services. 
 250.442 -+Note: IDENT lookups don't work with UDP services. 
 250.443 - .SH EXAMPLES
 250.444 - The language is flexible enough that different types of access control
 250.445 - policy can be expressed with a minimum of fuss. Although the language
 250.446 -@@ -285,7 +292,7 @@
 250.447 - .br
 250.448 - ALL: .foobar.edu EXCEPT terminalserver.foobar.edu
 250.449 - .PP
 250.450 --The first rule permits access from hosts in the local domain (no `.\'
 250.451 -+The first rule permits access from hosts in the local domain (no `.'
 250.452 - in the host name) and from members of the \fIsome_netgroup\fP
 250.453 - netgroup.  The second rule permits access from all hosts in the
 250.454 - \fIfoobar.edu\fP domain (notice the leading dot), with the exception of
 250.455 -@@ -322,8 +329,8 @@
 250.456 - /etc/hosts.deny:
 250.457 - .in +3
 250.458 - .nf
 250.459 --in.tftpd: ALL: (/some/where/safe_finger -l @%h | \\
 250.460 --	/usr/ucb/mail -s %d-%h root) &
 250.461 -+in.tftpd: ALL: (/usr/sbin/safe_finger -l @%h | \\
 250.462 -+	/usr/bin/mail -s %d-%h root) &
 250.463 - .fi
 250.464 - .PP
 250.465 - The safe_finger command comes with the tcpd wrapper and should be
 250.466 -@@ -349,7 +356,7 @@
 250.467 - capacity of an internal buffer; when an access control rule is not
 250.468 - terminated by a newline character; when the result of %<letter>
 250.469 - expansion would overflow an internal buffer; when a system call fails
 250.470 --that shouldn\'t.  All problems are reported via the syslog daemon.
 250.471 -+that shouldn't.  All problems are reported via the syslog daemon.
 250.472 - .SH FILES
 250.473 - .na
 250.474 - .nf
 250.475 -diff -Naur tcp_wrappers_7.6/hosts_access.c tcp_wrappers_7.6.gimli/hosts_access.c
 250.476 ---- tcp_wrappers_7.6/hosts_access.c	1997-02-11 19:13:23.000000000 -0600
 250.477 -+++ tcp_wrappers_7.6.gimli/hosts_access.c	2002-01-07 08:50:19.000000000 -0600
 250.478 -@@ -240,6 +240,26 @@
 250.479 -     }
 250.480 - }
 250.481 - 
 250.482 -+/* hostfile_match - look up host patterns from file */
 250.483 -+
 250.484 -+static int hostfile_match(path, host)
 250.485 -+char   *path;
 250.486 -+struct hosts_info *host;
 250.487 -+{
 250.488 -+    char    tok[BUFSIZ];
 250.489 -+    int     match = NO;
 250.490 -+    FILE   *fp;
 250.491 -+
 250.492 -+    if ((fp = fopen(path, "r")) != 0) {
 250.493 -+        while (fscanf(fp, "%s", tok) == 1 && !(match = host_match(tok, host)))
 250.494 -+            /* void */ ;
 250.495 -+        fclose(fp);
 250.496 -+    } else if (errno != ENOENT) {
 250.497 -+        tcpd_warn("open %s: %m", path);
 250.498 -+    }
 250.499 -+    return (match);
 250.500 -+}
 250.501 -+
 250.502 - /* host_match - match host name and/or address against pattern */
 250.503 - 
 250.504 - static int host_match(tok, host)
 250.505 -@@ -267,6 +287,8 @@
 250.506 - 	tcpd_warn("netgroup support is disabled");	/* not tcpd_jump() */
 250.507 - 	return (NO);
 250.508 - #endif
 250.509 -+    } else if (tok[0] == '/') {                         /* /file hack */
 250.510 -+        return (hostfile_match(tok, host));
 250.511 -     } else if (STR_EQ(tok, "KNOWN")) {		/* check address and name */
 250.512 - 	char   *name = eval_hostname(host);
 250.513 - 	return (STR_NE(eval_hostaddr(host), unknown) && HOSTNAME_KNOWN(name));
 250.514 -diff -Naur tcp_wrappers_7.6/hosts_options.5 tcp_wrappers_7.6.gimli/hosts_options.5
 250.515 ---- tcp_wrappers_7.6/hosts_options.5	1994-12-28 10:42:29.000000000 -0600
 250.516 -+++ tcp_wrappers_7.6.gimli/hosts_options.5	2002-01-07 08:50:19.000000000 -0600
 250.517 -@@ -58,12 +58,12 @@
 250.518 - Execute, in a child process, the specified shell command, after
 250.519 - performing the %<letter> expansions described in the hosts_access(5)
 250.520 - manual page.  The command is executed with stdin, stdout and stderr
 250.521 --connected to the null device, so that it won\'t mess up the
 250.522 -+connected to the null device, so that it won't mess up the
 250.523 - conversation with the client host. Example:
 250.524 - .sp
 250.525 - .nf
 250.526 - .ti +3
 250.527 --spawn (/some/where/safe_finger -l @%h | /usr/ucb/mail root) &
 250.528 -+spawn (/usr/sbin/safe_finger -l @%h | /usr/bin/mail root) &
 250.529 - .fi
 250.530 - .sp
 250.531 - executes, in a background child process, the shell command "safe_finger
 250.532 -diff -Naur tcp_wrappers_7.6/options.c tcp_wrappers_7.6.gimli/options.c
 250.533 ---- tcp_wrappers_7.6/options.c	1996-02-11 10:01:32.000000000 -0600
 250.534 -+++ tcp_wrappers_7.6.gimli/options.c	2002-01-07 08:50:19.000000000 -0600
 250.535 -@@ -473,6 +473,9 @@
 250.536 - #ifdef LOG_CRON
 250.537 -     "cron", LOG_CRON,
 250.538 - #endif
 250.539 -+#ifdef LOG_FTP
 250.540 -+    "ftp", LOG_FTP,
 250.541 -+#endif
 250.542 - #ifdef LOG_LOCAL0
 250.543 -     "local0", LOG_LOCAL0,
 250.544 - #endif
 250.545 -diff -Naur tcp_wrappers_7.6/percent_m.c tcp_wrappers_7.6.gimli/percent_m.c
 250.546 ---- tcp_wrappers_7.6/percent_m.c	1994-12-28 10:42:37.000000000 -0600
 250.547 -+++ tcp_wrappers_7.6.gimli/percent_m.c	2002-01-07 08:50:19.000000000 -0600
 250.548 -@@ -13,7 +13,7 @@
 250.549 - #include <string.h>
 250.550 - 
 250.551 - extern int errno;
 250.552 --#ifndef SYS_ERRLIST_DEFINED
 250.553 -+#if !defined(SYS_ERRLIST_DEFINED) && !defined(HAVE_STRERROR)
 250.554 - extern char *sys_errlist[];
 250.555 - extern int sys_nerr;
 250.556 - #endif
 250.557 -@@ -29,11 +29,15 @@
 250.558 - 
 250.559 -     while (*bp = *cp)
 250.560 - 	if (*cp == '%' && cp[1] == 'm') {
 250.561 -+#ifdef HAVE_STRERROR
 250.562 -+            strcpy(bp, strerror(errno));
 250.563 -+#else
 250.564 - 	    if (errno < sys_nerr && errno > 0) {
 250.565 - 		strcpy(bp, sys_errlist[errno]);
 250.566 - 	    } else {
 250.567 - 		sprintf(bp, "Unknown error %d", errno);
 250.568 - 	    }
 250.569 -+#endif
 250.570 - 	    bp += strlen(bp);
 250.571 - 	    cp += 2;
 250.572 - 	} else {
 250.573 -diff -Naur tcp_wrappers_7.6/rfc931.c tcp_wrappers_7.6.gimli/rfc931.c
 250.574 ---- tcp_wrappers_7.6/rfc931.c	1995-01-02 09:11:34.000000000 -0600
 250.575 -+++ tcp_wrappers_7.6.gimli/rfc931.c	2002-01-07 08:50:19.000000000 -0600
 250.576 -@@ -33,7 +33,7 @@
 250.577 - 
 250.578 - int     rfc931_timeout = RFC931_TIMEOUT;/* Global so it can be changed */
 250.579 - 
 250.580 --static jmp_buf timebuf;
 250.581 -+static sigjmp_buf timebuf;
 250.582 - 
 250.583 - /* fsocket - open stdio stream on top of socket */
 250.584 - 
 250.585 -@@ -62,7 +62,7 @@
 250.586 - static void timeout(sig)
 250.587 - int     sig;
 250.588 - {
 250.589 --    longjmp(timebuf, sig);
 250.590 -+    siglongjmp(timebuf, sig);
 250.591 - }
 250.592 - 
 250.593 - /* rfc931 - return remote user name, given socket structures */
 250.594 -@@ -99,7 +99,7 @@
 250.595 - 	 * Set up a timer so we won't get stuck while waiting for the server.
 250.596 - 	 */
 250.597 - 
 250.598 --	if (setjmp(timebuf) == 0) {
 250.599 -+	if (sigsetjmp(timebuf,1) == 0) {
 250.600 - 	    signal(SIGALRM, timeout);
 250.601 - 	    alarm(rfc931_timeout);
 250.602 - 
 250.603 -diff -Naur tcp_wrappers_7.6/safe_finger.8 tcp_wrappers_7.6.gimli/safe_finger.8
 250.604 ---- tcp_wrappers_7.6/safe_finger.8	1969-12-31 18:00:00.000000000 -0600
 250.605 -+++ tcp_wrappers_7.6.gimli/safe_finger.8	2002-01-07 08:50:19.000000000 -0600
 250.606 -@@ -0,0 +1,34 @@
 250.607 -+.TH SAFE_FINGER 8 "21th June 1997" Linux "Linux Programmer's Manual"
 250.608 -+.SH NAME
 250.609 -+safe_finger \- finger client wrapper that protects against nasty stuff
 250.610 -+from finger servers
 250.611 -+.SH SYNOPSIS
 250.612 -+.B safe_finger [finger_options]
 250.613 -+.SH DESCRIPTION
 250.614 -+The
 250.615 -+.B safe_finger
 250.616 -+command protects against nasty stuff from finger servers. Use this
 250.617 -+program for automatic reverse finger probes from the
 250.618 -+.B tcp_wrapper
 250.619 -+.B (tcpd)
 250.620 -+, not the raw finger command. The
 250.621 -+.B safe_finger
 250.622 -+command makes sure that the finger client is not run with root
 250.623 -+privileges. It also runs the finger client with a defined PATH
 250.624 -+environment.
 250.625 -+.B safe_finger
 250.626 -+will also protect you from problems caused by the output of some
 250.627 -+finger servers. The problem: some programs may react to stuff in
 250.628 -+the first column. Other programs may get upset by thrash anywhere
 250.629 -+on a line. File systems may fill up as the finger server keeps
 250.630 -+sending data. Text editors may bomb out on extremely long lines.
 250.631 -+The finger server may take forever because it is somehow wedged.
 250.632 -+.B safe_finger
 250.633 -+takes care of all this badness.
 250.634 -+.SH SEE ALSO
 250.635 -+.BR hosts_access (5),
 250.636 -+.BR hosts_options (5),
 250.637 -+.BR tcpd (8)
 250.638 -+.SH AUTHOR
 250.639 -+Wietse Venema, Eindhoven University of Technology, The Netherlands.
 250.640 -+
 250.641 -diff -Naur tcp_wrappers_7.6/safe_finger.c tcp_wrappers_7.6.gimli/safe_finger.c
 250.642 ---- tcp_wrappers_7.6/safe_finger.c	1994-12-28 10:42:42.000000000 -0600
 250.643 -+++ tcp_wrappers_7.6.gimli/safe_finger.c	2002-01-07 08:50:19.000000000 -0600
 250.644 -@@ -26,21 +26,24 @@
 250.645 - #include <stdio.h>
 250.646 - #include <ctype.h>
 250.647 - #include <pwd.h>
 250.648 -+#include <syslog.h>
 250.649 - 
 250.650 - extern void exit();
 250.651 - 
 250.652 - /* Local stuff */
 250.653 - 
 250.654 --char    path[] = "PATH=/bin:/usr/bin:/usr/ucb:/usr/bsd:/etc:/usr/etc:/usr/sbin";
 250.655 -+char    path[] = "PATH=/bin:/usr/bin:/sbin:/usr/sbin";
 250.656 - 
 250.657 - #define	TIME_LIMIT	60		/* Do not keep listinging forever */
 250.658 - #define	INPUT_LENGTH	100000		/* Do not keep listinging forever */
 250.659 - #define	LINE_LENGTH	128		/* Editors can choke on long lines */
 250.660 - #define	FINGER_PROGRAM	"finger"	/* Most, if not all, UNIX systems */
 250.661 - #define	UNPRIV_NAME	"nobody"	/* Preferred privilege level */
 250.662 --#define	UNPRIV_UGID	32767		/* Default uid and gid */
 250.663 -+#define	UNPRIV_UGID	65534		/* Default uid and gid */
 250.664 - 
 250.665 - int     finger_pid;
 250.666 -+int	allow_severity = SEVERITY;
 250.667 -+int	deny_severity = LOG_WARNING;
 250.668 - 
 250.669 - void    cleanup(sig)
 250.670 - int     sig;
 250.671 -diff -Naur tcp_wrappers_7.6/scaffold.c tcp_wrappers_7.6.gimli/scaffold.c
 250.672 ---- tcp_wrappers_7.6/scaffold.c	1997-03-21 12:27:24.000000000 -0600
 250.673 -+++ tcp_wrappers_7.6.gimli/scaffold.c	2002-01-07 08:50:19.000000000 -0600
 250.674 -@@ -180,10 +180,12 @@
 250.675 - 
 250.676 - /* ARGSUSED */
 250.677 - 
 250.678 --void    rfc931(request)
 250.679 --struct request_info *request;
 250.680 -+void    rfc931(rmt_sin, our_sin, dest)
 250.681 -+struct sockaddr_in *rmt_sin;
 250.682 -+struct sockaddr_in *our_sin;
 250.683 -+char   *dest;
 250.684 - {
 250.685 --    strcpy(request->user, unknown);
 250.686 -+    strcpy(dest, unknown);
 250.687 - }
 250.688 - 
 250.689 - /* check_path - examine accessibility */
 250.690 -diff -Naur tcp_wrappers_7.6/socket.c tcp_wrappers_7.6.gimli/socket.c
 250.691 ---- tcp_wrappers_7.6/socket.c	1997-03-21 12:27:25.000000000 -0600
 250.692 -+++ tcp_wrappers_7.6.gimli/socket.c	2002-01-07 08:50:19.000000000 -0600
 250.693 -@@ -76,7 +76,11 @@
 250.694 - {
 250.695 -     static struct sockaddr_in client;
 250.696 -     static struct sockaddr_in server;
 250.697 -+#if !defined (__GLIBC__)
 250.698 -     int     len;
 250.699 -+#else /* __GLIBC__ */
 250.700 -+    size_t  len;
 250.701 -+#endif /* __GLIBC__ */
 250.702 -     char    buf[BUFSIZ];
 250.703 -     int     fd = request->fd;
 250.704 - 
 250.705 -@@ -224,7 +228,11 @@
 250.706 - {
 250.707 -     char    buf[BUFSIZ];
 250.708 -     struct sockaddr_in sin;
 250.709 -+#if !defined(__GLIBC__)
 250.710 -     int     size = sizeof(sin);
 250.711 -+#else /* __GLIBC__ */
 250.712 -+    size_t  size = sizeof(sin);
 250.713 -+#endif /* __GLIBC__ */
 250.714 - 
 250.715 -     /*
 250.716 -      * Eat up the not-yet received datagram. Some systems insist on a
 250.717 -diff -Naur tcp_wrappers_7.6/tcpd.8 tcp_wrappers_7.6.gimli/tcpd.8
 250.718 ---- tcp_wrappers_7.6/tcpd.8	1996-02-21 09:39:16.000000000 -0600
 250.719 -+++ tcp_wrappers_7.6.gimli/tcpd.8	2002-01-07 08:50:19.000000000 -0600
 250.720 -@@ -94,7 +94,7 @@
 250.721 - .PP
 250.722 - The example assumes that the network daemons live in /usr/etc. On some
 250.723 - systems, network daemons live in /usr/sbin or in /usr/libexec, or have
 250.724 --no `in.\' prefix to their name.
 250.725 -+no `in.' prefix to their name.
 250.726 - .SH EXAMPLE 2
 250.727 - This example applies when \fItcpd\fR expects that the network daemons
 250.728 - are left in their original place.
 250.729 -@@ -110,26 +110,26 @@
 250.730 - becomes:
 250.731 - .sp
 250.732 - .ti +5
 250.733 --finger  stream  tcp  nowait  nobody  /some/where/tcpd     in.fingerd
 250.734 -+finger  stream  tcp  nowait  nobody  /usr/sbin/tcpd       in.fingerd
 250.735 - .sp
 250.736 - .fi
 250.737 - .PP
 250.738 - The example assumes that the network daemons live in /usr/etc. On some
 250.739 - systems, network daemons live in /usr/sbin or in /usr/libexec, the
 250.740 --daemons have no `in.\' prefix to their name, or there is no userid
 250.741 -+daemons have no `in.' prefix to their name, or there is no userid
 250.742 - field in the inetd configuration file.
 250.743 - .PP
 250.744 - Similar changes will be needed for the other services that are to be
 250.745 --covered by \fItcpd\fR.  Send a `kill -HUP\' to the \fIinetd\fR(8)
 250.746 -+covered by \fItcpd\fR.  Send a `kill -HUP' to the \fIinetd\fR(8)
 250.747 - process to make the changes effective. AIX users may also have to
 250.748 --execute the `inetimp\' command.
 250.749 -+execute the `inetimp' command.
 250.750 - .SH EXAMPLE 3
 250.751 - In the case of daemons that do not live in a common directory ("secret"
 250.752 - or otherwise), edit the \fIinetd\fR configuration file so that it
 250.753 - specifies an absolute path name for the process name field. For example:
 250.754 - .nf
 250.755 - .sp
 250.756 --    ntalk  dgram  udp  wait  root  /some/where/tcpd  /usr/local/lib/ntalkd
 250.757 -+    ntalk  dgram  udp  wait  root  /usr/sbin/tcpd  /usr/sbin/in.ntalkd
 250.758 - .sp
 250.759 - .fi
 250.760 - .PP
 250.761 -diff -Naur tcp_wrappers_7.6/tcpd.h tcp_wrappers_7.6.gimli/tcpd.h
 250.762 ---- tcp_wrappers_7.6/tcpd.h	1996-03-19 09:22:25.000000000 -0600
 250.763 -+++ tcp_wrappers_7.6.gimli/tcpd.h	2002-01-07 08:50:19.000000000 -0600
 250.764 -@@ -4,6 +4,25 @@
 250.765 -   * Author: Wietse Venema, Eindhoven University of Technology, The Netherlands.
 250.766 -   */
 250.767 - 
 250.768 -+#ifndef _TCPWRAPPERS_TCPD_H
 250.769 -+#define _TCPWRAPPERS_TCPD_H
 250.770 -+
 250.771 -+/* someone else may have defined this */
 250.772 -+#undef  __P
 250.773 -+
 250.774 -+/* use prototypes if we have an ANSI C compiler or are using C++ */
 250.775 -+#if defined(__STDC__) || defined(__cplusplus)
 250.776 -+#define __P(args)       args
 250.777 -+#else
 250.778 -+#define __P(args)       ()
 250.779 -+#endif
 250.780 -+
 250.781 -+/* Need definitions of struct sockaddr_in and FILE. */
 250.782 -+#include <netinet/in.h>
 250.783 -+#include <stdio.h>
 250.784 -+
 250.785 -+__BEGIN_DECLS
 250.786 -+
 250.787 - /* Structure to describe one communications endpoint. */
 250.788 - 
 250.789 - #define STRING_LENGTH	128		/* hosts, users, processes */
 250.790 -@@ -25,10 +44,10 @@
 250.791 -     char    pid[10];			/* access via eval_pid(request) */
 250.792 -     struct host_info client[1];		/* client endpoint info */
 250.793 -     struct host_info server[1];		/* server endpoint info */
 250.794 --    void  (*sink) ();			/* datagram sink function or 0 */
 250.795 --    void  (*hostname) ();		/* address to printable hostname */
 250.796 --    void  (*hostaddr) ();		/* address to printable address */
 250.797 --    void  (*cleanup) ();		/* cleanup function or 0 */
 250.798 -+    void  (*sink) __P((int));		/* datagram sink function or 0 */
 250.799 -+    void  (*hostname) __P((struct host_info *)); /* address to printable hostname */
 250.800 -+    void  (*hostaddr) __P((struct host_info *)); /* address to printable address */
 250.801 -+    void  (*cleanup) __P((struct request_info *)); /* cleanup function or 0 */
 250.802 -     struct netconfig *config;		/* netdir handle */
 250.803 - };
 250.804 - 
 250.805 -@@ -61,25 +80,30 @@
 250.806 - /* Global functions. */
 250.807 - 
 250.808 - #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 250.809 --extern void fromhost();			/* get/validate client host info */
 250.810 -+extern void fromhost __P((struct request_info *));	/* get/validate client host info */
 250.811 - #else
 250.812 - #define fromhost sock_host		/* no TLI support needed */
 250.813 - #endif
 250.814 - 
 250.815 --extern int hosts_access();		/* access control */
 250.816 --extern void shell_cmd();		/* execute shell command */
 250.817 --extern char *percent_x();		/* do %<char> expansion */
 250.818 --extern void rfc931();			/* client name from RFC 931 daemon */
 250.819 --extern void clean_exit();		/* clean up and exit */
 250.820 --extern void refuse();			/* clean up and exit */
 250.821 --extern char *xgets();			/* fgets() on steroids */
 250.822 --extern char *split_at();		/* strchr() and split */
 250.823 --extern unsigned long dot_quad_addr();	/* restricted inet_addr() */
 250.824 -+extern void shell_cmd __P((char *));	/* execute shell command */
 250.825 -+extern char *percent_x __P((char *, int, char *, struct request_info *)); /* do %<char> expansion */
 250.826 -+extern void rfc931 __P((struct sockaddr_in *, struct sockaddr_in *, char *)); /* client name from RFC 931 daemon */
 250.827 -+extern void clean_exit __P((struct request_info *)); /* clean up and exit */
 250.828 -+extern void refuse __P((struct request_info *));	/* clean up and exit */
 250.829 -+extern char *xgets __P((char *, int, FILE *));	/* fgets() on steroids */
 250.830 -+extern char *split_at __P((char *, int));	/* strchr() and split */
 250.831 -+extern unsigned long dot_quad_addr __P((char *)); /* restricted inet_addr() */
 250.832 - 
 250.833 - /* Global variables. */
 250.834 - 
 250.835 -+#ifdef HAVE_WEAKSYMS
 250.836 -+extern int allow_severity __attribute__ ((weak)); /* for connection logging */
 250.837 -+extern int deny_severity __attribute__ ((weak)); /* for connection logging */
 250.838 -+#else
 250.839 - extern int allow_severity;		/* for connection logging */
 250.840 - extern int deny_severity;		/* for connection logging */
 250.841 -+#endif
 250.842 -+
 250.843 - extern char *hosts_allow_table;		/* for verification mode redirection */
 250.844 - extern char *hosts_deny_table;		/* for verification mode redirection */
 250.845 - extern int hosts_access_verbose;	/* for verbose matching mode */
 250.846 -@@ -92,9 +116,14 @@
 250.847 -   */
 250.848 - 
 250.849 - #ifdef __STDC__
 250.850 -+extern int hosts_access(struct request_info *request);
 250.851 -+extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, 
 250.852 -+                     char *client_user);
 250.853 - extern struct request_info *request_init(struct request_info *,...);
 250.854 - extern struct request_info *request_set(struct request_info *,...);
 250.855 - #else
 250.856 -+extern int hosts_access();
 250.857 -+extern int hosts_ctl();
 250.858 - extern struct request_info *request_init();	/* initialize request */
 250.859 - extern struct request_info *request_set();	/* update request structure */
 250.860 - #endif
 250.861 -@@ -117,27 +146,31 @@
 250.862 -   * host_info structures serve as caches for the lookup results.
 250.863 -   */
 250.864 - 
 250.865 --extern char *eval_user();		/* client user */
 250.866 --extern char *eval_hostname();		/* printable hostname */
 250.867 --extern char *eval_hostaddr();		/* printable host address */
 250.868 --extern char *eval_hostinfo();		/* host name or address */
 250.869 --extern char *eval_client();		/* whatever is available */
 250.870 --extern char *eval_server();		/* whatever is available */
 250.871 -+extern char *eval_user __P((struct request_info *));	/* client user */
 250.872 -+extern char *eval_hostname __P((struct host_info *));	/* printable hostname */
 250.873 -+extern char *eval_hostaddr __P((struct host_info *));	/* printable host address */
 250.874 -+extern char *eval_hostinfo __P((struct host_info *));	/* host name or address */
 250.875 -+extern char *eval_client __P((struct request_info *));	/* whatever is available */
 250.876 -+extern char *eval_server __P((struct request_info *));	/* whatever is available */
 250.877 - #define eval_daemon(r)	((r)->daemon)	/* daemon process name */
 250.878 - #define eval_pid(r)	((r)->pid)	/* process id */
 250.879 - 
 250.880 - /* Socket-specific methods, including DNS hostname lookups. */
 250.881 - 
 250.882 --extern void sock_host();		/* look up endpoint addresses */
 250.883 --extern void sock_hostname();		/* translate address to hostname */
 250.884 --extern void sock_hostaddr();		/* address to printable address */
 250.885 -+/* look up endpoint addresses */
 250.886 -+extern void sock_host __P((struct request_info *));
 250.887 -+/* translate address to hostname */
 250.888 -+extern void sock_hostname __P((struct host_info *));
 250.889 -+/* address to printable address */
 250.890 -+extern void sock_hostaddr __P((struct host_info *));
 250.891 -+
 250.892 - #define sock_methods(r) \
 250.893 - 	{ (r)->hostname = sock_hostname; (r)->hostaddr = sock_hostaddr; }
 250.894 - 
 250.895 - /* The System V Transport-Level Interface (TLI) interface. */
 250.896 - 
 250.897 - #if defined(TLI) || defined(PTX) || defined(TLI_SEQUENT)
 250.898 --extern void tli_host();			/* look up endpoint addresses etc. */
 250.899 -+extern void tli_host __P((struct request_info *));	/* look up endpoint addresses etc. */
 250.900 - #endif
 250.901 - 
 250.902 -  /*
 250.903 -@@ -178,7 +211,7 @@
 250.904 -   * behavior.
 250.905 -   */
 250.906 - 
 250.907 --extern void process_options();		/* execute options */
 250.908 -+extern void process_options __P((char *, struct request_info *)); /* execute options */
 250.909 - extern int dry_run;			/* verification flag */
 250.910 - 
 250.911 - /* Bug workarounds. */
 250.912 -@@ -217,3 +250,7 @@
 250.913 - #define strtok	my_strtok
 250.914 - extern char *my_strtok();
 250.915 - #endif
 250.916 -+
 250.917 -+__END_DECLS
 250.918 -+
 250.919 -+#endif /* tcpd.h */
 250.920 -diff -Naur tcp_wrappers_7.6/tcpdchk.c tcp_wrappers_7.6.gimli/tcpdchk.c
 250.921 ---- tcp_wrappers_7.6/tcpdchk.c	1997-02-11 19:13:25.000000000 -0600
 250.922 -+++ tcp_wrappers_7.6.gimli/tcpdchk.c	2002-01-07 08:50:19.000000000 -0600
 250.923 -@@ -350,6 +350,8 @@
 250.924 - {
 250.925 -     if (pat[0] == '@') {
 250.926 - 	tcpd_warn("%s: daemon name begins with \"@\"", pat);
 250.927 -+    } else if (pat[0] == '/') {
 250.928 -+        tcpd_warn("%s: daemon name begins with \"/\"", pat);
 250.929 -     } else if (pat[0] == '.') {
 250.930 - 	tcpd_warn("%s: daemon name begins with dot", pat);
 250.931 -     } else if (pat[strlen(pat) - 1] == '.') {
 250.932 -@@ -382,6 +384,8 @@
 250.933 - {
 250.934 -     if (pat[0] == '@') {			/* @netgroup */
 250.935 - 	tcpd_warn("%s: user name begins with \"@\"", pat);
 250.936 -+    } else if (pat[0] == '/') {
 250.937 -+        tcpd_warn("%s: user name begins with \"/\"", pat);
 250.938 -     } else if (pat[0] == '.') {
 250.939 - 	tcpd_warn("%s: user name begins with dot", pat);
 250.940 -     } else if (pat[strlen(pat) - 1] == '.') {
 250.941 -@@ -402,8 +406,13 @@
 250.942 - static int check_host(pat)
 250.943 - char   *pat;
 250.944 - {
 250.945 -+    char    buf[BUFSIZ];
 250.946 -     char   *mask;
 250.947 -     int     addr_count = 1;
 250.948 -+    FILE   *fp;
 250.949 -+    struct tcpd_context saved_context;
 250.950 -+    char   *cp;
 250.951 -+    char   *wsp = " \t\r\n";
 250.952 - 
 250.953 -     if (pat[0] == '@') {			/* @netgroup */
 250.954 - #ifdef NO_NETGRENT
 250.955 -@@ -422,6 +431,21 @@
 250.956 - 	tcpd_warn("netgroup support disabled");
 250.957 - #endif
 250.958 - #endif
 250.959 -+    } else if (pat[0] == '/') {                 /* /path/name */
 250.960 -+        if ((fp = fopen(pat, "r")) != 0) {
 250.961 -+            saved_context = tcpd_context;
 250.962 -+            tcpd_context.file = pat;
 250.963 -+            tcpd_context.line = 0;
 250.964 -+            while (fgets(buf, sizeof(buf), fp)) {
 250.965 -+                tcpd_context.line++;
 250.966 -+                for (cp = strtok(buf, wsp); cp; cp = strtok((char *) 0, wsp))
 250.967 -+                    check_host(cp);
 250.968 -+            }
 250.969 -+            tcpd_context = saved_context;
 250.970 -+            fclose(fp);
 250.971 -+        } else if (errno != ENOENT) {
 250.972 -+            tcpd_warn("open %s: %m", pat);
 250.973 -+        }
 250.974 -     } else if (mask = split_at(pat, '/')) {	/* network/netmask */
 250.975 - 	if (dot_quad_addr(pat) == INADDR_NONE
 250.976 - 	    || dot_quad_addr(mask) == INADDR_NONE)
 250.977 -diff -Naur tcp_wrappers_7.6/try-from.8 tcp_wrappers_7.6.gimli/try-from.8
 250.978 ---- tcp_wrappers_7.6/try-from.8	1969-12-31 18:00:00.000000000 -0600
 250.979 -+++ tcp_wrappers_7.6.gimli/try-from.8	2002-01-07 08:50:19.000000000 -0600
 250.980 -@@ -0,0 +1,28 @@
 250.981 -+.TH TRY-FROM 8 "21th June 1997" Linux "Linux Programmer's Manual"
 250.982 -+.SH NAME
 250.983 -+try-from \- test program for the tcp_wrapper
 250.984 -+.SH SYNOPSIS
 250.985 -+.B try-from
 250.986 -+.SH DESCRIPTION
 250.987 -+The
 250.988 -+.B try-from
 250.989 -+command can be called via a remote shell command to find out
 250.990 -+if the hostname and address are properly recognized
 250.991 -+by the
 250.992 -+.B tcp_wrapper
 250.993 -+library, if username lookup works, and (SysV only) if the TLI
 250.994 -+on top of IP heuristics work. Diagnostics are reported through
 250.995 -+.BR syslog (3)
 250.996 -+and redirected to stderr.
 250.997 -+
 250.998 -+Example:
 250.999 -+
250.1000 -+rsh host /some/where/try-from
250.1001 -+
250.1002 -+.SH SEE ALSO
250.1003 -+.BR hosts_access (5),
250.1004 -+.BR hosts_options (5),
250.1005 -+.BR tcpd (8)
250.1006 -+.SH AUTHOR
250.1007 -+Wietse Venema, Eindhoven University of Technology, The Netherlands.
250.1008 -+
250.1009 -diff -Naur tcp_wrappers_7.6/weak_symbols.c tcp_wrappers_7.6.gimli/weak_symbols.c
250.1010 ---- tcp_wrappers_7.6/weak_symbols.c	1969-12-31 18:00:00.000000000 -0600
250.1011 -+++ tcp_wrappers_7.6.gimli/weak_symbols.c	2002-01-07 08:50:19.000000000 -0600
250.1012 -@@ -0,0 +1,11 @@
250.1013 -+ /*
250.1014 -+  * @(#) weak_symbols.h 1.5 99/12/29 23:50
250.1015 -+  * 
250.1016 -+  * Author: Anthony Towns <ajt@debian.org>
250.1017 -+  */
250.1018 -+
250.1019 -+#ifdef HAVE_WEAKSYMS
250.1020 -+#include <syslog.h>
250.1021 -+int deny_severity = LOG_WARNING;
250.1022 -+int allow_severity = SEVERITY; 
250.1023 -+#endif
250.1024 -diff -Naur tcp_wrappers_7.6/workarounds.c tcp_wrappers_7.6.gimli/workarounds.c
250.1025 ---- tcp_wrappers_7.6/workarounds.c	1996-03-19 09:22:26.000000000 -0600
250.1026 -+++ tcp_wrappers_7.6.gimli/workarounds.c	2002-01-07 08:50:19.000000000 -0600
250.1027 -@@ -163,7 +163,11 @@
250.1028 - int     fix_getpeername(sock, sa, len)
250.1029 - int     sock;
250.1030 - struct sockaddr *sa;
250.1031 -+#if !defined(__GLIBC__)
250.1032 - int    *len;
250.1033 -+#else /* __GLIBC__ */
250.1034 -+size_t *len;
250.1035 -+#endif /* __GLIBC__ */
250.1036 - {
250.1037 -     int     ret;
250.1038 -     struct sockaddr_in *sin = (struct sockaddr_in *) sa;
   251.1 --- a/lite/receipt	Wed May 09 17:03:28 2018 +0300
   251.2 +++ b/lite/receipt	Thu May 10 21:12:00 2018 +0300
   251.3 @@ -21,9 +21,6 @@
   251.4  			export CPPFLAGS="$CPPFLAGS -I/cross/arm/sysroot/usr/include/directfb" ;;
   251.5  	esac
   251.6  
   251.7 -	patch -Np1 -i ${stuff}/lite_fix_stat_naming.patch || return 1
   251.8 -	patch -Np1 -i ${stuff}/lite_fix_pkgconfig.patch || return 1
   251.9 -
  251.10  	./configure $CONFIGURE_ARGS &&
  251.11  	fix libtool &&
  251.12  	make &&
   252.1 --- a/lite/stuff/lite_fix_pkgconfig.patch	Wed May 09 17:03:28 2018 +0300
   252.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   252.3 @@ -1,9 +0,0 @@
   252.4 -diff -upr LiTE-0.8.10.orig/lite.pc.in LiTE-0.8.10/lite.pc.in
   252.5 ---- LiTE-0.8.10.orig/lite.pc.in	2008-06-20 23:34:10.000000000 +0200
   252.6 -+++ LiTE-0.8.10/lite.pc.in	2013-06-29 09:56:37.910000014 +0200
   252.7 -@@ -9,4 +9,4 @@ Description: "LiTE" is a Toolkit Engine
   252.8 - Requires: directfb >= @DFB_REQUIRED_VERSION@
   252.9 - Version: @VERSION@
  252.10 - Libs: -L${libdir} -llite
  252.11 --Cflags: -I${includedir} -DLITEFONTDIR=\\\"@LITEFONTDIR@\\\"
  252.12 -+Cflags: -I${includedir} -DLITEFONTDIR=\"@LITEFONTDIR@\"
   253.1 --- a/lite/stuff/lite_fix_stat_naming.patch	Wed May 09 17:03:28 2018 +0300
   253.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   253.3 @@ -1,12 +0,0 @@
   253.4 -diff -upr LiTE-0.8.10.orig/examples/dfbspy.c LiTE-0.8.10/examples/dfbspy.c
   253.5 ---- LiTE-0.8.10.orig/examples/dfbspy.c	2013-06-23 17:01:22.360000002 +0200
   253.6 -+++ LiTE-0.8.10/examples/dfbspy.c	2013-06-23 17:07:03.370000001 +0200
   253.7 -@@ -45,6 +45,8 @@
   253.8 - #include <leck/label.h>
   253.9 - #include <leck/textline.h>
  253.10 - 
  253.11 -+#define stat cur_stat
  253.12 -+
  253.13 - /**************************************************************************************************/
  253.14 - 
  253.15 - typedef struct {
   254.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   254.2 +++ b/lite/stuff/patches/lite_fix_pkgconfig.patch	Thu May 10 21:12:00 2018 +0300
   254.3 @@ -0,0 +1,9 @@
   254.4 +diff -upr LiTE-0.8.10.orig/lite.pc.in LiTE-0.8.10/lite.pc.in
   254.5 +--- LiTE-0.8.10.orig/lite.pc.in	2008-06-20 23:34:10.000000000 +0200
   254.6 ++++ LiTE-0.8.10/lite.pc.in	2013-06-29 09:56:37.910000014 +0200
   254.7 +@@ -9,4 +9,4 @@ Description: "LiTE" is a Toolkit Engine
   254.8 + Requires: directfb >= @DFB_REQUIRED_VERSION@
   254.9 + Version: @VERSION@
  254.10 + Libs: -L${libdir} -llite
  254.11 +-Cflags: -I${includedir} -DLITEFONTDIR=\\\"@LITEFONTDIR@\\\"
  254.12 ++Cflags: -I${includedir} -DLITEFONTDIR=\"@LITEFONTDIR@\"
   255.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   255.2 +++ b/lite/stuff/patches/lite_fix_stat_naming.patch	Thu May 10 21:12:00 2018 +0300
   255.3 @@ -0,0 +1,12 @@
   255.4 +diff -upr LiTE-0.8.10.orig/examples/dfbspy.c LiTE-0.8.10/examples/dfbspy.c
   255.5 +--- LiTE-0.8.10.orig/examples/dfbspy.c	2013-06-23 17:01:22.360000002 +0200
   255.6 ++++ LiTE-0.8.10/examples/dfbspy.c	2013-06-23 17:07:03.370000001 +0200
   255.7 +@@ -45,6 +45,8 @@
   255.8 + #include <leck/label.h>
   255.9 + #include <leck/textline.h>
  255.10 + 
  255.11 ++#define stat cur_stat
  255.12 ++
  255.13 + /**************************************************************************************************/
  255.14 + 
  255.15 + typedef struct {
   256.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   256.2 +++ b/lite/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   256.3 @@ -0,0 +1,2 @@
   256.4 +lite_fix_stat_naming.patch
   256.5 +lite_fix_pkgconfig.patch
   257.1 --- a/loderunner/receipt	Wed May 09 17:03:28 2018 +0300
   257.2 +++ b/loderunner/receipt	Thu May 10 21:12:00 2018 +0300
   257.3 @@ -1,31 +1,28 @@
   257.4 -# SliTaz package receipt.
   257.5 +# SliTaz package receipt v2.
   257.6  
   257.7  PACKAGE="loderunner"
   257.8  VERSION="2.01c.3"
   257.9  CATEGORY="games"
  257.10 -SHORT_DESC="Lode runner game clone in html5."
  257.11 +SHORT_DESC="Lode runner game clone in HTML5"
  257.12  MAINTAINER="pascal.bellard@slitaz.org"
  257.13  LICENSE="unknown"
  257.14 +WEB_SITE="http://loderunnerwebgame.com/LodeRunner/"
  257.15 +
  257.16  TARBALL="$PACKAGE-$VERSION.tar.gz"
  257.17 -WEB_SITE="http://loderunnerwebgame.com/LodeRunner/"
  257.18  WGET_URL="https://github.com/SimonHung/LodeRunner_TotalRecall/archive/v$VERSION.tar.gz"
  257.19 -DEPENDS="browser-html5"
  257.20  
  257.21 -# Rules to gen a SliTaz package suitable for Tazpkg.
  257.22 -genpkg_rules()
  257.23 -{
  257.24 -	mkdir -p $fs/var/www $fs/usr/share/applications
  257.25 -	cp -a $src $fs/var/www/loderunner
  257.26 -	ln -s lodeRunner.html $fs/var/www/loderunner/index.html
  257.27 -	rm -rf $fs/var/www/loderunner/tools $fs/var/www/loderunner/README.md
  257.28 -	cat > $fs/usr/share/applications/loderunner.desktop <<EOT
  257.29 -[Desktop Entry]
  257.30 -Type=Application
  257.31 -Name=Lode Runner
  257.32 -Comment=Plateform game
  257.33 -Exec=browser-html5 file:///var/www/loderunner/lodeRunner.html
  257.34 -Icon=/var/www/loderunner/lodeRunner.ico
  257.35 -Terminal=false
  257.36 -Categories=Game
  257.37 -EOT
  257.38 +compile_rules() {
  257.39 +	mkdir -p \
  257.40 +		$install/var/www \
  257.41 +		$install/usr/share/applications
  257.42 +	cp -a $src $install/var/www/loderunner/
  257.43 +	ln -s lodeRunner.html $install/var/www/loderunner/index.html
  257.44 +	rm -rf \
  257.45 +		$install/var/www/loderunner/tools \
  257.46 +		$install/var/www/loderunner/README.md
  257.47  }
  257.48 +
  257.49 +genpkg_rules() {
  257.50 +	copy @std
  257.51 +	DEPENDS="browser-html5"
  257.52 +}
   258.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   258.2 +++ b/loderunner/stuff/loderunner.desktop	Thu May 10 21:12:00 2018 +0300
   258.3 @@ -0,0 +1,8 @@
   258.4 +[Desktop Entry]
   258.5 +Type=Application
   258.6 +Name=Lode Runner
   258.7 +Comment=Plateform game
   258.8 +Exec=browser-html5 file:///var/www/loderunner/lodeRunner.html
   258.9 +Icon=/var/www/loderunner/lodeRunner.ico
  258.10 +Terminal=false
  258.11 +Categories=Game
   259.1 --- a/lostirc/receipt	Wed May 09 17:03:28 2018 +0300
   259.2 +++ b/lostirc/receipt	Thu May 10 21:12:00 2018 +0300
   259.3 @@ -14,8 +14,6 @@
   259.4  BUILD_DEPENDS="glibmm-dev cairomm-dev gtkmm-dev libsigc++-dev gtk+-dev"
   259.5  
   259.6  compile_rules() {
   259.7 -	busybox patch -p1 -i $stuff/gcc.u
   259.8 -
   259.9  	./configure $CONFIGURE_ARGS &&
  259.10  	fix libtool &&
  259.11  	make &&
   260.1 --- a/lostirc/stuff/gcc.u	Wed May 09 17:03:28 2018 +0300
   260.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   260.3 @@ -1,39 +0,0 @@
   260.4 ---- lostirc-0.4.6/src/libirc/Parser.cpp
   260.5 -+++ lostirc-0.4.6/src/libirc/Parser.cpp
   260.6 -@@ -21,6 +21,7 @@
   260.7 - #include <vector>
   260.8 - #include <algorithm>
   260.9 - #include <cassert>
  260.10 -+#include <ctime>
  260.11 - #include "Parser.h"
  260.12 - #include "Utils.h"
  260.13 - #include "Channel.h"
  260.14 -
  260.15 ---- lostirc-0.4.6/src/libirc/Socket.cpp
  260.16 -+++ lostirc-0.4.6/src/libirc/Socket.cpp
  260.17 -@@ -27,6 +27,7 @@
  260.18 - 
  260.19 - #include <iostream>
  260.20 - #include <string>
  260.21 -+#include <cstring>
  260.22 - #include <cerrno>
  260.23 - #include <cstdio>
  260.24 - #include <glibmm/main.h>
  260.25 -
  260.26 ---- lostirc-0.4.6/src/gtkmm/TextWidget.cpp
  260.27 -+++ lostirc-0.4.6/src/gtkmm/TextWidget.cpp
  260.28 -@@ -210,11 +210,11 @@
  260.29 -     std::vector< Glib::RefPtr<Gtk::TextTag> > tags;
  260.30 - 
  260.31 -     Glib::RefPtr<Gtk::TextTag> fg = buffer->get_tag_table()->lookup(Glib::ustring("f")+crop(tp.fgnumber));
  260.32 --    if (fg == 0)
  260.33 -+    if (!fg)
  260.34 -           fg = buffer->get_tag_table()->lookup("f0");
  260.35 - 
  260.36 -     Glib::RefPtr<Gtk::TextTag> bg = buffer->get_tag_table()->lookup(Glib::ustring("b")+crop(tp.bgnumber));
  260.37 --    if (bg == 0)
  260.38 -+    if (!bg)
  260.39 -           bg = buffer->get_tag_table()->lookup("b0");
  260.40 - 
  260.41 -     tags.push_back(fg);
  260.42 -
   261.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   261.2 +++ b/lostirc/stuff/patches/gcc.u	Thu May 10 21:12:00 2018 +0300
   261.3 @@ -0,0 +1,39 @@
   261.4 +--- lostirc-0.4.6/src/libirc/Parser.cpp
   261.5 ++++ lostirc-0.4.6/src/libirc/Parser.cpp
   261.6 +@@ -21,6 +21,7 @@
   261.7 + #include <vector>
   261.8 + #include <algorithm>
   261.9 + #include <cassert>
  261.10 ++#include <ctime>
  261.11 + #include "Parser.h"
  261.12 + #include "Utils.h"
  261.13 + #include "Channel.h"
  261.14 +
  261.15 +--- lostirc-0.4.6/src/libirc/Socket.cpp
  261.16 ++++ lostirc-0.4.6/src/libirc/Socket.cpp
  261.17 +@@ -27,6 +27,7 @@
  261.18 + 
  261.19 + #include <iostream>
  261.20 + #include <string>
  261.21 ++#include <cstring>
  261.22 + #include <cerrno>
  261.23 + #include <cstdio>
  261.24 + #include <glibmm/main.h>
  261.25 +
  261.26 +--- lostirc-0.4.6/src/gtkmm/TextWidget.cpp
  261.27 ++++ lostirc-0.4.6/src/gtkmm/TextWidget.cpp
  261.28 +@@ -210,11 +210,11 @@
  261.29 +     std::vector< Glib::RefPtr<Gtk::TextTag> > tags;
  261.30 + 
  261.31 +     Glib::RefPtr<Gtk::TextTag> fg = buffer->get_tag_table()->lookup(Glib::ustring("f")+crop(tp.fgnumber));
  261.32 +-    if (fg == 0)
  261.33 ++    if (!fg)
  261.34 +           fg = buffer->get_tag_table()->lookup("f0");
  261.35 + 
  261.36 +     Glib::RefPtr<Gtk::TextTag> bg = buffer->get_tag_table()->lookup(Glib::ustring("b")+crop(tp.bgnumber));
  261.37 +-    if (bg == 0)
  261.38 ++    if (!bg)
  261.39 +           bg = buffer->get_tag_table()->lookup("b0");
  261.40 + 
  261.41 +     tags.push_back(fg);
  261.42 +
   262.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   262.2 +++ b/lostirc/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   262.3 @@ -0,0 +1,1 @@
   262.4 +-p1|gcc.u
   263.1 --- a/lsdvd/receipt	Wed May 09 17:03:28 2018 +0300
   263.2 +++ b/lsdvd/receipt	Thu May 10 21:12:00 2018 +0300
   263.3 @@ -16,10 +16,6 @@
   263.4  # Rules to configure and make the package.
   263.5  compile_rules()
   263.6  {
   263.7 -	cd $src
   263.8 -	[ -f done.lsdvd-0.16-configure.patch ] ||
   263.9 -		patch -p1 -i $stuff/lsdvd-0.16-configure.patch
  263.10 -	touch done.lsdvd-0.16-configure.patch
  263.11  	./configure $CONFIGURE_ARGS &&
  263.12  	make &&	make install
  263.13  }
   264.1 --- a/lsdvd/stuff/lsdvd-0.16-configure.patch	Wed May 09 17:03:28 2018 +0300
   264.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   264.3 @@ -1,43 +0,0 @@
   264.4 ---- lsdvd-0.16-ori/configure	Mon Dec 12 21:22:45 2005
   264.5 -+++ lsdvd-0.16/configure	Sat Apr 19 17:20:11 2008
   264.6 -@@ -2887,8 +2887,9 @@
   264.7 - cat confdefs.h >>conftest.$ac_ext
   264.8 - cat >>conftest.$ac_ext <<_ACEOF
   264.9 - /* end confdefs.h.  */
  264.10 -+#include <stdint.h>
  264.11 - #include <dvdread/ifo_read.h>
  264.12 --		#include <stdint.h>
  264.13 -+		
  264.14 - int
  264.15 - main ()
  264.16 - {
  264.17 ---- lsdvd-0.16-ori/configure.in	Mon Dec 12 21:11:01 2005
  264.18 -+++ lsdvd-0.16/configure.in	Sat Apr 19 17:19:36 2008
  264.19 -@@ -10,8 +10,8 @@
  264.20 - 
  264.21 - AC_CHECK_LIB(dvdread, DVDOpen, , AC_MSG_ERROR([libdvdread not found!]))
  264.22 - AC_MSG_CHECKING([for dvdread/ifo_read.h])
  264.23 --AC_TRY_COMPILE([#include <dvdread/ifo_read.h>
  264.24 --		#include <stdint.h>], ,
  264.25 -+AC_TRY_COMPILE([#include <stdint.h>
  264.26 -+		#include <dvdread/ifo_read.h>], ,
  264.27 - 	AC_MSG_RESULT([yes]), 
  264.28 - 	AC_MSG_RESULT([no]) 
  264.29 - 	AC_MSG_ERROR([Header files for dvdread not found]))
  264.30 ---- lsdvd-0.16-ori/lsdvd.c	Thu Mar  2 14:48:11 2006
  264.31 -+++ lsdvd-0.16/lsdvd.c	Sat Apr 19 17:26:06 2008
  264.32 -@@ -13,13 +13,13 @@
  264.33 -  *  2003-04-19  Cleanups get_title_name, added dvdtime2msec, added helper macros,
  264.34 -  *			  output info structures in form of a Perl module, by Henk Vergonet.
  264.35 -  */
  264.36 --#include <dvdread/ifo_read.h>
  264.37 - #include <string.h>
  264.38 - #include <sys/stat.h>
  264.39 - #include <stdio.h>
  264.40 - #include <stdlib.h>
  264.41 - #include <unistd.h>
  264.42 - #include <stdint.h>
  264.43 -+#include <dvdread/ifo_read.h>
  264.44 - #include "lsdvd.h"
  264.45 - #include "ocode.h"
  264.46 - 
   265.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   265.2 +++ b/lsdvd/stuff/patches/lsdvd-0.16-configure.patch	Thu May 10 21:12:00 2018 +0300
   265.3 @@ -0,0 +1,43 @@
   265.4 +--- lsdvd-0.16-ori/configure	Mon Dec 12 21:22:45 2005
   265.5 ++++ lsdvd-0.16/configure	Sat Apr 19 17:20:11 2008
   265.6 +@@ -2887,8 +2887,9 @@
   265.7 + cat confdefs.h >>conftest.$ac_ext
   265.8 + cat >>conftest.$ac_ext <<_ACEOF
   265.9 + /* end confdefs.h.  */
  265.10 ++#include <stdint.h>
  265.11 + #include <dvdread/ifo_read.h>
  265.12 +-		#include <stdint.h>
  265.13 ++		
  265.14 + int
  265.15 + main ()
  265.16 + {
  265.17 +--- lsdvd-0.16-ori/configure.in	Mon Dec 12 21:11:01 2005
  265.18 ++++ lsdvd-0.16/configure.in	Sat Apr 19 17:19:36 2008
  265.19 +@@ -10,8 +10,8 @@
  265.20 + 
  265.21 + AC_CHECK_LIB(dvdread, DVDOpen, , AC_MSG_ERROR([libdvdread not found!]))
  265.22 + AC_MSG_CHECKING([for dvdread/ifo_read.h])
  265.23 +-AC_TRY_COMPILE([#include <dvdread/ifo_read.h>
  265.24 +-		#include <stdint.h>], ,
  265.25 ++AC_TRY_COMPILE([#include <stdint.h>
  265.26 ++		#include <dvdread/ifo_read.h>], ,
  265.27 + 	AC_MSG_RESULT([yes]), 
  265.28 + 	AC_MSG_RESULT([no]) 
  265.29 + 	AC_MSG_ERROR([Header files for dvdread not found]))
  265.30 +--- lsdvd-0.16-ori/lsdvd.c	Thu Mar  2 14:48:11 2006
  265.31 ++++ lsdvd-0.16/lsdvd.c	Sat Apr 19 17:26:06 2008
  265.32 +@@ -13,13 +13,13 @@
  265.33 +  *  2003-04-19  Cleanups get_title_name, added dvdtime2msec, added helper macros,
  265.34 +  *			  output info structures in form of a Perl module, by Henk Vergonet.
  265.35 +  */
  265.36 +-#include <dvdread/ifo_read.h>
  265.37 + #include <string.h>
  265.38 + #include <sys/stat.h>
  265.39 + #include <stdio.h>
  265.40 + #include <stdlib.h>
  265.41 + #include <unistd.h>
  265.42 + #include <stdint.h>
  265.43 ++#include <dvdread/ifo_read.h>
  265.44 + #include "lsdvd.h"
  265.45 + #include "ocode.h"
  265.46 + 
   266.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   266.2 +++ b/lsdvd/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   266.3 @@ -0,0 +1,1 @@
   266.4 +-p1|lsdvd-0.16-configure.patch
   267.1 --- a/luasocket/receipt	Wed May 09 17:03:28 2018 +0300
   267.2 +++ b/luasocket/receipt	Thu May 10 21:12:00 2018 +0300
   267.3 @@ -16,16 +16,6 @@
   267.4  # Rules to configure and make the package.
   267.5  compile_rules()
   267.6  {
   267.7 -        echo $src
   267.8 -	cd $src
   267.9 -	while read file; do
  267.10 -		[ -f done.$file ] && continue
  267.11 -		echo "Apply $file..."
  267.12 -		patch -p1 < $stuff/$file || return 1
  267.13 -		touch done.$file
  267.14 -	done <<EOT
  267.15 -patch.diff
  267.16 -EOT
  267.17  	make CFLAGS="$CFLAGS -I/usr/include/lua/5.1" && make DESTDIR=$DESTDIR install
  267.18  }
  267.19  
   268.1 --- a/luasocket/stuff/patch.diff	Wed May 09 17:03:28 2018 +0300
   268.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   268.3 @@ -1,14 +0,0 @@
   268.4 -diff -wbBur luasocket-2.0.2/config luasocket-2.0.2.my/config
   268.5 ---- luasocket-2.0.2/config      2007-10-15 08:21:05.000000000 +0400
   268.6 -+++ luasocket-2.0.2.my/config   2007-10-15 12:22:16.000000000 +0400
   268.7 -@@ -30,8 +30,8 @@
   268.8 - #
   268.9 - #INSTALL_TOP_SHARE=/usr/local/share/lua/5.0
  268.10 - #INSTALL_TOP_LIB=/usr/local/lib/lua/5.0
  268.11 --INSTALL_TOP_SHARE=/usr/local/share/lua/5.1
  268.12 --INSTALL_TOP_LIB=/usr/local/lib/lua/5.1
  268.13 -+INSTALL_TOP_SHARE=$(DESTDIR)/usr/share/lua/5.1
  268.14 -+INSTALL_TOP_LIB=$(DESTDIR)/usr/lib/lua/5.1
  268.15 - 
  268.16 - INSTALL_DATA=cp
  268.17 - INSTALL_EXEC=cp
   269.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   269.2 +++ b/luasocket/stuff/patches/patch.diff	Thu May 10 21:12:00 2018 +0300
   269.3 @@ -0,0 +1,14 @@
   269.4 +diff -wbBur luasocket-2.0.2/config luasocket-2.0.2.my/config
   269.5 +--- luasocket-2.0.2/config      2007-10-15 08:21:05.000000000 +0400
   269.6 ++++ luasocket-2.0.2.my/config   2007-10-15 12:22:16.000000000 +0400
   269.7 +@@ -30,8 +30,8 @@
   269.8 + #
   269.9 + #INSTALL_TOP_SHARE=/usr/local/share/lua/5.0
  269.10 + #INSTALL_TOP_LIB=/usr/local/lib/lua/5.0
  269.11 +-INSTALL_TOP_SHARE=/usr/local/share/lua/5.1
  269.12 +-INSTALL_TOP_LIB=/usr/local/lib/lua/5.1
  269.13 ++INSTALL_TOP_SHARE=$(DESTDIR)/usr/share/lua/5.1
  269.14 ++INSTALL_TOP_LIB=$(DESTDIR)/usr/lib/lua/5.1
  269.15 + 
  269.16 + INSTALL_DATA=cp
  269.17 + INSTALL_EXEC=cp
   270.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   270.2 +++ b/luasocket/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   270.3 @@ -0,0 +1,1 @@
   270.4 +-p1|patch.diff
   271.1 --- a/lzop/receipt	Wed May 09 17:03:28 2018 +0300
   271.2 +++ b/lzop/receipt	Thu May 10 21:12:00 2018 +0300
   271.3 @@ -17,8 +17,6 @@
   271.4  # Rules to configure and make the package.
   271.5  compile_rules()
   271.6  {
   271.7 -	patch -p1 -i $stuff/lzop-gcc6.patch
   271.8 -
   271.9  	./configure $CONFIGURE_ARGS && make && make install
  271.10  }
  271.11  
   272.1 --- a/lzop/stuff/lzop-gcc6.patch	Wed May 09 17:03:28 2018 +0300
   272.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   272.3 @@ -1,39 +0,0 @@
   272.4 -Origin: vendor, https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch
   272.5 -Description: Compatibility with gcc6
   272.6 - gcc-6 has additional errors e.g.
   272.7 - .
   272.8 - ./test.c:1:12: error: variably modified '__acc_cta' at file scope
   272.9 -  extern int __acc_cta[1-2*!((1l << (8*8 -1)) < 0)];
  272.10 -             ^~~~~~~~~
  272.11 - .
  272.12 - This is rightly pointed out since that index is undefined
  272.13 -Signed-off-by: Khem Raj <raj.khem@gmail.com>
  272.14 -Upstream-Status: Pending
  272.15 -Bug-Debian: https://bugs.debian.org/812054
  272.16 -
  272.17 ---- a/src/miniacc.h
  272.18 -+++ b/src/miniacc.h
  272.19 -@@ -4461,12 +4461,12 @@
  272.20 - #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
  272.21 - #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
  272.22 - #else
  272.23 --    ACCCHK_ASSERT((1   << (8*SIZEOF_INT-1)) < 0)
  272.24 -+    ACCCHK_ASSERT((int)(1u   << (8*SIZEOF_INT-1)) < 0)
  272.25 - #endif
  272.26 -     ACCCHK_ASSERT((1u  << (8*SIZEOF_INT-1)) > 0)
  272.27 - #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
  272.28 - #else
  272.29 --    ACCCHK_ASSERT((1l  << (8*SIZEOF_LONG-1)) < 0)
  272.30 -+    ACCCHK_ASSERT((long)(1ul  << (8*SIZEOF_LONG-1)) < 0)
  272.31 - #endif
  272.32 -     ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
  272.33 - #if defined(acc_int16e_t)
  272.34 -@@ -4695,7 +4695,7 @@
  272.35 - #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
  272.36 - #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
  272.37 - #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
  272.38 --    ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
  272.39 -+    ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
  272.40 - #endif
  272.41 - #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
  272.42 - #  pragma option pop
   273.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   273.2 +++ b/lzop/stuff/patches/lzop-gcc6.patch	Thu May 10 21:12:00 2018 +0300
   273.3 @@ -0,0 +1,39 @@
   273.4 +Origin: vendor, https://github.com/openembedded/openembedded-core/blob/master/meta/recipes-support/lzop/lzop/lzop-1.03-gcc6.patch
   273.5 +Description: Compatibility with gcc6
   273.6 + gcc-6 has additional errors e.g.
   273.7 + .
   273.8 + ./test.c:1:12: error: variably modified '__acc_cta' at file scope
   273.9 +  extern int __acc_cta[1-2*!((1l << (8*8 -1)) < 0)];
  273.10 +             ^~~~~~~~~
  273.11 + .
  273.12 + This is rightly pointed out since that index is undefined
  273.13 +Signed-off-by: Khem Raj <raj.khem@gmail.com>
  273.14 +Upstream-Status: Pending
  273.15 +Bug-Debian: https://bugs.debian.org/812054
  273.16 +
  273.17 +--- a/src/miniacc.h
  273.18 ++++ b/src/miniacc.h
  273.19 +@@ -4461,12 +4461,12 @@
  273.20 + #if defined(__MSDOS__) && defined(__TURBOC__) && (__TURBOC__ < 0x0150)
  273.21 + #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
  273.22 + #else
  273.23 +-    ACCCHK_ASSERT((1   << (8*SIZEOF_INT-1)) < 0)
  273.24 ++    ACCCHK_ASSERT((int)(1u   << (8*SIZEOF_INT-1)) < 0)
  273.25 + #endif
  273.26 +     ACCCHK_ASSERT((1u  << (8*SIZEOF_INT-1)) > 0)
  273.27 + #if 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
  273.28 + #else
  273.29 +-    ACCCHK_ASSERT((1l  << (8*SIZEOF_LONG-1)) < 0)
  273.30 ++    ACCCHK_ASSERT((long)(1ul  << (8*SIZEOF_LONG-1)) < 0)
  273.31 + #endif
  273.32 +     ACCCHK_ASSERT((1ul << (8*SIZEOF_LONG-1)) > 0)
  273.33 + #if defined(acc_int16e_t)
  273.34 +@@ -4695,7 +4695,7 @@
  273.35 + #elif 1 && (ACC_CC_LCC || ACC_CC_LCCWIN32) && !defined(ACCCHK_CFG_PEDANTIC)
  273.36 + #elif 1 && (ACC_CC_SUNPROC) && !defined(ACCCHK_CFG_PEDANTIC)
  273.37 + #elif !(ACC_BROKEN_INTEGRAL_PROMOTION) && (SIZEOF_INT > 1)
  273.38 +-    ACCCHK_ASSERT( (((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
  273.39 ++    ACCCHK_ASSERT( (int)((unsigned int)((unsigned char)128) << (int)(8*sizeof(int)-8)) < 0)
  273.40 + #endif
  273.41 + #if (ACC_CC_BORLANDC && (__BORLANDC__ >= 0x0530) && (__BORLANDC__ < 0x0560))
  273.42 + #  pragma option pop
   274.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   274.2 +++ b/lzop/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   274.3 @@ -0,0 +1,1 @@
   274.4 +-p1|lzop-gcc6.patch
   275.1 --- a/man2html/receipt	Wed May 09 17:03:28 2018 +0300
   275.2 +++ b/man2html/receipt	Thu May 10 21:12:00 2018 +0300
   275.3 @@ -16,7 +16,6 @@
   275.4  # Rules to configure and make the package.
   275.5  compile_rules()
   275.6  {
   275.7 -	patch -p1 -i $stuff/man2html-slitaz.diff
   275.8  	make && make install
   275.9  
  275.10  	# translations
   276.1 --- a/man2html/stuff/man2html-slitaz.diff	Wed May 09 17:03:28 2018 +0300
   276.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   276.3 @@ -1,2357 +0,0 @@
   276.4 ---- /dev/null
   276.5 -+++ b/Makefile
   276.6 -@@ -0,0 +1,89 @@
   276.7 -+CFLAGS  += -Wall -Wstrict-prototypes -Wmissing-prototypes -DGUNZIP='"gunzip"' `pkg-config --cflags --libs glib-2.0`
   276.8 -+# -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0
   276.9 -+OBJECTS  = man2html.o cgibase.o abbrev.o strdefs.o
  276.10 -+bindir   = $(DESTDIR)$(PREFIX)/usr/bin
  276.11 -+mandir   = $(DESTDIR)$(PREFIX)/usr/share/man
  276.12 -+vardir   = $(DESTDIR)$(PREFIX)/var
  276.13 -+httpdir  = $(DESTDIR)$(PREFIX)/home/httpd
  276.14 -+cgidir   = $(DESTDIR)$(PREFIX)/var/www
  276.15 -+sharedir = $(DESTDIR)$(PREFIX)/usr/share/man2html
  276.16 -+cgiowner = www
  276.17 -+cgigroup = www
  276.18 -+CC ?= gcc
  276.19 -+
  276.20 -+all: man2html hman
  276.21 -+
  276.22 -+man2html:	$(OBJECTS)
  276.23 -+	$(CC) -o man2html $(OBJECTS) $(CFLAGS)
  276.24 -+
  276.25 -+pot:
  276.26 -+	mkdir -p po
  276.27 -+	xgettext -o po/man2html.pot -k_ -kN_ \
  276.28 -+		--package-name="man2html" \
  276.29 -+		--from-code="UTF-8" \
  276.30 -+		cgibase.c man2html.c hman.sh man.sh
  276.31 -+
  276.32 -+msgmerge:
  276.33 -+	@for l in $(LINGUAS); do \
  276.34 -+		echo -n "Updating $$l po file."; \
  276.35 -+		msgmerge -U po/$$l.po po/man2html.pot; \
  276.36 -+	done;
  276.37 -+
  276.38 -+msgfmt:
  276.39 -+	@for l in $(LINGUAS); do \
  276.40 -+		echo "Compiling $$l mo file..."; \
  276.41 -+		mkdir -p po/mo/$$l/LC_MESSAGES; \
  276.42 -+		msgfmt -o po/mo/$$l/LC_MESSAGES/man2html.mo po/$$l.po; \
  276.43 -+	done;
  276.44 -+
  276.45 -+
  276.46 -+# man2html:	../src/version.h
  276.47 -+
  276.48 -+# This installs the man2html utility
  276.49 -+install:	man2html
  276.50 -+	mkdir -p $(bindir)
  276.51 -+	install -m 755 man2html $(bindir)
  276.52 -+	mkdir -p $(mandir)/man1
  276.53 -+	install -m 644 man2html.1 $(mandir)/man1/man2html.1
  276.54 -+
  276.55 -+install-scripts: install-man-scripts install-glimpse-stuff install-hman
  276.56 -+
  276.57 -+# These are the scripts that allow pointing a browser at
  276.58 -+#   http://localhost/cgi-bin/man/man2html
  276.59 -+# to work.
  276.60 -+install-man-scripts:
  276.61 -+	mkdir -p $(cgidir)
  276.62 -+	mkdir -p $(sharedir)
  276.63 -+	install -m 755 scripts/cgi-bin/man/* $(cgidir)
  276.64 -+	install -m 644 scripts/cgi-aux/man/* $(sharedir)
  276.65 -+	install -d -o $(cgiowner) -g $(cgigroup) -m 775 $(vardir)/man2html
  276.66 -+# (aux was renamed to cgi-aux since aux causes problems under DOS)
  276.67 -+
  276.68 -+# If you have installed glimpse, and have compressed man pages,
  276.69 -+# then perhaps you also want these filters.
  276.70 -+install-glimpse-stuff:
  276.71 -+	install -m 644 glimpse_filters $(vardir)/man2html/.glimpse_filters
  276.72 -+
  276.73 -+# In order not to have to type a long command like
  276.74 -+#   netscape http://localhost/cgi-bin/man/man2html?section+topic
  276.75 -+# or
  276.76 -+#   lynx lynxcgi:/home/httpd/cgi-bin/man/man2html?section+topic
  276.77 -+# it is convenient to have some shell script as a wrapper.
  276.78 -+# The script hman can be aliased to man. It uses an environment
  276.79 -+# variable MANHTMLPAGER to find out which browser you use, and
  276.80 -+# you can set MANHTMLHOST if the pages are not on localhost.
  276.81 -+hman: hman.sh
  276.82 -+	rm -f hman
  276.83 -+	sed -e 's,%version%,1.6g-7,' hman.sh > hman
  276.84 -+
  276.85 -+install-hman: hman
  276.86 -+	install -m 555 hman $(bindir)/hman
  276.87 -+	install -m 644 hman.1 $(mandir)/man1/hman.1
  276.88 -+
  276.89 -+clean:
  276.90 -+	rm -f core hman man2html $(OBJECTS) *~
  276.91 -+
  276.92 -+spotless:	clean
  276.93 -+	rm -f Makefile
  276.94 -+
  276.95 -+$(OBJECTS): defs.h
  276.96 ---- a/abbrev.c
  276.97 -+++ b/abbrev.c
  276.98 -@@ -27,7 +27,7 @@
  276.99 -     "SSO", "System Services Overview",
 276.100 -     "TEXT", "Editing Text Files",
 276.101 -     "DOCS", "Formatting Documents",
 276.102 --    "TROFF", "Using <B>nroff</B> and <B>troff</B>",
 276.103 -+    "TROFF", "Using <b>nroff</b> and <b>troff</b>",
 276.104 -     "INDEX", "Global Index",
 276.105 -     "CPG", "C Programmer's Guide",
 276.106 -     "CREF", "C Reference Manual",
 276.107 -@@ -46,7 +46,7 @@
 276.108 -     "CGI", "SunCGI Reference Manual",
 276.109 -     "CORE", "SunCore Reference Manual",
 276.110 -     "4ASSY", "Sun-4 Assembly Language Reference",
 276.111 --    "SARCH", "<FONT SIZE=\"-1\">SPARC</FONT> Architecture Manual",
 276.112 -+    "SARCH", "SPARC Architecture Manual",
 276.113 -     "KR", "The C Programming Language",
 276.114 -     0, 0 };
 276.115 - 
 276.116 ---- a/cgibase.c
 276.117 -+++ b/cgibase.c
 276.118 -@@ -8,6 +8,8 @@
 276.119 - #include <ctype.h>		/* tolower() */
 276.120 - #include <string.h>		/* strlen() */
 276.121 - #include "defs.h"
 276.122 -+#include <glib.h>
 276.123 -+#include <glib/gi18n.h>
 276.124 - 
 276.125 - /*
 276.126 -  * The default is to use cgibase. With relative html style
 276.127 -@@ -21,8 +23,8 @@
 276.128 -  * and uses lynx, and we use lynxcgi:/usr/lib/cgi-bin.
 276.129 -  */
 276.130 - 
 276.131 --static char *man2htmlpath = "/cgi-bin/man/man2html"; 	/* default */
 276.132 --static char *cgibase_format = "http://%s"; 		/* host.domain:port */
 276.133 -+static char *man2htmlpath = ""; 	/* default */
 276.134 -+static char *cgibase_format = "%s"; 		/* host.domain:port */
 276.135 - static char *cgibase_ll_format = "lynxcgi:%s"; 		/* directory */
 276.136 - static char *cgibase = "";				/* default */
 276.137 - 
 276.138 -@@ -68,76 +70,46 @@
 276.139 -      relat_html_style = 1;
 276.140 - }
 276.141 - 
 276.142 --/* What shall we say in case of relat_html_style? */
 276.143 --static char *signature = "<HR>\n"
 276.144 --"This document was created by\n"
 276.145 --"<A HREF=\"%s%s\">man2html</A>,\n"
 276.146 --"using the manual pages.<BR>\n"
 276.147 --"%s\n";
 276.148 --
 276.149 --#define TIMEFORMAT "%T GMT, %B %d, %Y"
 276.150 --#define TIMEBUFSZ	500
 276.151 --
 276.152 - void print_sig()
 276.153 - {
 276.154 --    char timebuf[TIMEBUFSZ];
 276.155 --    struct tm *timetm;
 276.156 --    time_t now;
 276.157 --
 276.158 --    timebuf[0] = 0;
 276.159 --#ifdef TIMEFORMAT
 276.160 --    sprintf(timebuf, "Time: ");
 276.161 --    now=time(NULL);
 276.162 --    timetm=gmtime(&now);
 276.163 --    strftime(timebuf+6, TIMEBUFSZ-6, TIMEFORMAT, timetm);
 276.164 --    timebuf[TIMEBUFSZ-1] = 0;
 276.165 --#endif
 276.166 --    printf(signature, cgibase, man2htmlpath, timebuf);
 276.167 -+	printf("</section>\n<footer>\n<p>%s</p>\n</footer>\n",
 276.168 -+		_("This document was created by <b>man2html</b> using the manual pages."));
 276.169 - }
 276.170 - 
 276.171 - void
 276.172 - include_file_html(char *g) {
 276.173 --     printf("<A HREF=\"file:///usr/include/%s\">%s</A>&gt;", g,g);
 276.174 -+     printf("<a href=\"file:///usr/include/%s\">%s</a>&gt;", g,g);
 276.175 - }
 276.176 - 
 276.177 - void
 276.178 - man_page_html(char *sec, char *h) {
 276.179 --	if (relat_html_style) {
 276.180 --		if (!h)
 276.181 --			printf("<A HREF=\"../index.html\">"
 276.182 --			       "Return to Main Contents</A>");
 276.183 --		else
 276.184 --			printf("<A HREF=\"../man%s/%s.%s.html\">%s</A>",
 276.185 --			       sec, h, sec, h);
 276.186 --	} else {
 276.187 --		if (!h)
 276.188 --			printf("<A HREF=\"%s%s\">Return to Main Contents</A>",
 276.189 --			       cgibase, man2htmlpath);
 276.190 --		else if (!sec)
 276.191 --			printf("<A HREF=\"%s%s%c%s\">%s</A>",
 276.192 --			       cgibase, man2htmlpath, sep, h, h);
 276.193 --		else
 276.194 --			printf("<A HREF=\"%s%s%c%s+%s\">%s</A>",
 276.195 --			       cgibase, man2htmlpath, sep, sec, h, h);
 276.196 --	}
 276.197 -+	if (!h)
 276.198 -+		printf("<a href=\"?\">%s</a>",
 276.199 -+			_("Return to Main Contents"));
 276.200 -+	else if (!sec)
 276.201 -+		printf("<a href=\"?%s\">%s</a>",
 276.202 -+			h, h);
 276.203 -+	else
 276.204 -+		printf("<a href=\"?%s+%s\">%s</a>",
 276.205 -+			sec, h, h);
 276.206 - }
 276.207 - 
 276.208 - void
 276.209 - ftp_html(char *f) {
 276.210 --     printf("<A HREF=\"ftp://%s\">%s</A>", f, f);
 276.211 -+     printf("<a href=\"ftp://%s\">%s</a>", f, f);
 276.212 - }
 276.213 - 
 276.214 - void
 276.215 - www_html(char *f) {
 276.216 --     printf("<A HREF=\"http://%s\">%s</A>", f, f);
 276.217 -+     printf("<a href=\"http://%s\">%s</a>", f, f);
 276.218 - }
 276.219 - 
 276.220 - void
 276.221 - mailto_html(char *g) {
 276.222 --     printf("<A HREF=\"mailto:%s\">%s</A>", g, g);
 276.223 -+     printf("<a href=\"mailto:%s\">%s</a>", g, g);
 276.224 - }
 276.225 - 
 276.226 - void
 276.227 - url_html(char *g) {
 276.228 --     printf("<A HREF=\"%s\">%s</A>", g, g);
 276.229 -+     printf("<a href=\"%s\">%s</a>", g, g);
 276.230 - }
 276.231 ---- a/hman.sh
 276.232 -+++ b/hman.sh
 276.233 -@@ -8,99 +8,83 @@
 276.234 - # Usage examples:
 276.235 - #        hman                    - get start page
 276.236 - #        hman man2html           - get man page for man2html
 276.237 --#        hman 7 locale           - get section 7 man page for locale 
 276.238 -+#        hman 7 locale           - get section 7 man page for locale
 276.239 - #        hman 1                  - section 1 index of names only
 276.240 - #        hman 3 index            - section 3 index names+descriptions
 276.241 - #        hman -k editor          - search all man pages for some string
 276.242 --#	 hman -P arena ./twm.man - specify browser; specify man page
 276.243 -+#        hman -P arena ./twm.man - specify browser; specify man page
 276.244 - #
 276.245 --# hman from %version%
 276.246 -+# hman from 1.6g-7
 276.247 - #
 276.248 - 
 276.249 --if [ x"$1" = x"-v" ] || [ x"$1" = x"-V" ]; then
 276.250 --	echo "`basename $0` from %version%"
 276.251 -+. /usr/lib/slitaz/httphelper.sh
 276.252 -+. /lib/libtaz.sh
 276.253 -+
 276.254 -+# Internationalization
 276.255 -+export TEXTDOMAIN='man2html'
 276.256 -+_()  { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
 276.257 -+
 276.258 -+
 276.259 -+if [ "$1" == '-v' ] || [ "$1" == '-V' ]; then
 276.260 -+	echo "$(basename $0) v. 1.6g-slitaz"
 276.261 - 	exit 0
 276.262 - fi
 276.263 - 
 276.264 - # The user has to set MANHTMLPAGER (or he will get httpd-free lynx).
 276.265 - # Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ...
 276.266 --if [ x"$MANHTMLPAGER" = x ]  && ! which lynx > /dev/null ; then
 276.267 --	HMAN_BROWSER=sensible-browser
 276.268 --else
 276.269 --	HMAN_BROWSER=${MANHTMLPAGER-lynxcgi}
 276.270 --fi
 276.271 -+HMAN_BROWSER="${MANHTMLPAGER:-tazweb}"
 276.272 - 
 276.273 --#
 276.274 - # If the man pages are on a remote host, specify it in MANHTMLHOST.
 276.275 --HOST=${MANHTMLHOST-localhost}
 276.276 -+HOST=${MANHTMLHOST:-localhost}
 276.277 - 
 276.278 - # Perhaps the browser was specified on the command line?
 276.279 --if [ "$#" -gt 1 ] && [ x"$1" = x"-P" ]; then
 276.280 --    HMAN_BROWSER="$2"
 276.281 --    shift; shift
 276.282 -+if [ "$#" -gt 1 ] && [ "$1" == '-P' ]; then
 276.283 -+	HMAN_BROWSER="$2"
 276.284 -+	shift; shift
 276.285 - fi
 276.286 - 
 276.287 - # Perhaps the host was specified on the command line?
 276.288 --if [ "$#" -gt 1 ] && [ x"$1" = x"-H" ]; then
 276.289 --    HOST="$2"
 276.290 --    shift; shift
 276.291 -+if [ "$#" -gt 1 ] && [ "$1" == '-H' ]; then
 276.292 -+	HOST="$2"
 276.293 -+	shift; shift
 276.294 - fi
 276.295 - 
 276.296 --# Interface to a live (already running) netscape browser.
 276.297 --nsfunc () {
 276.298 --	if ( /bin/ps xc | grep -q 'netscape$' ) ; then
 276.299 --		if [ -x  netscape-remote ] ; then
 276.300 --			exec netscape-remote  -remote "openURL($1,new_window)"
 276.301 --		else
 276.302 --			exec netscape -remote "openURL($1,new_window)"
 276.303 --		fi
 276.304 --	else
 276.305 --		netscape $1 &
 276.306 --	fi
 276.307 --}
 276.308 -+CGI="http://$HOST/man.cgi"
 276.309 - 
 276.310 --urlencode() {
 276.311 --	echo "$@" | perl -pe 'chomp(); s/([^A-Za-z0-9\ \_\-\.\/])/"%" . unpack("H*", $1)/eg; tr/ /+/;'
 276.312 -+enc() {
 276.313 -+	echo "$@" | sed -e 's|+|%2B|g; s| |+|g';
 276.314 - }
 276.315 - 
 276.316 --
 276.317 --case "$HMAN_BROWSER" in
 276.318 --     lynxcgi)
 276.319 --	HMAN_BROWSER=lynx
 276.320 --	CG="lynxcgi:/usr/lib/cgi-bin/man"
 276.321 --	;;
 276.322 --     netscape)
 276.323 --        HMAN_BROWSER=nsfunc
 276.324 --        CG="http://$HOST/cgi-bin/man"
 276.325 --	;;
 276.326 --     *)
 276.327 --	CG="http://$HOST/cgi-bin/man"
 276.328 --	;;
 276.329 -+case "$#" in
 276.330 -+	0)
 276.331 -+		$HMAN_BROWSER "$CGI";;
 276.332 -+	1)
 276.333 -+		case "$1" in
 276.334 -+			1|2|3|4|5|6|7|8|l|n)
 276.335 -+				$HMAN_BROWSER "$CGI?$1";;
 276.336 -+			/*)
 276.337 -+				$HMAN_BROWSER "$CGI?$(enc "$1")";;
 276.338 -+			*/*)
 276.339 -+				$HMAN_BROWSER "$CGI?$(enc "$(realpath "$PWD/$1")")";;
 276.340 -+			*)
 276.341 -+				$HMAN_BROWSER "$CGI?$(enc "$1")";;
 276.342 -+		esac
 276.343 -+		;;
 276.344 -+	2)
 276.345 -+#		case "$1" in
 276.346 -+#			-k)
 276.347 -+#				$HMAN_BROWSER "$CGI?search=$(enc "$2")";;
 276.348 -+#			*)
 276.349 -+#				if [ "$2" == 'index' ]; then
 276.350 -+#					$HMAN_BROWSER "$CGI?whatis=$(enc "$1")"
 276.351 -+#				else
 276.352 -+					$HMAN_BROWSER "$CGI?$(enc "$1 $2")"
 276.353 -+#				fi
 276.354 -+#				;;
 276.355 -+#		esac
 276.356 -+		;;
 276.357 -+	*)
 276.358 -+		_ 'bad number of args';;
 276.359 - esac
 276.360 --
 276.361 --  case "$#" in
 276.362 --     0)   $HMAN_BROWSER "$CG/man2html" ;;
 276.363 --     1)   case "$1" in
 276.364 --	    1|2|3|4|5|6|7|8|l|n)
 276.365 --		$HMAN_BROWSER "$CG/mansec?query=$1" ;;
 276.366 --	    /*)
 276.367 --		$HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;;
 276.368 --	    */*)
 276.369 --		$HMAN_BROWSER "$CG/man2html?query=`urlencode "$PWD/$1"`" ;;
 276.370 --	    *)
 276.371 --		$HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;;
 276.372 --          esac ;;
 276.373 --     2)   case "$1" in
 276.374 --            -k)
 276.375 --                $HMAN_BROWSER "$CG/mansearch?query=`urlencode "$2"`" ;;
 276.376 --            *)
 276.377 --		if [ "$2" = index ]; then
 276.378 --		    $HMAN_BROWSER "$CG/manwhatis?query=`urlencode "$1"`"
 276.379 --                else
 276.380 --		    $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1 $2"`"
 276.381 --                fi ;;
 276.382 --          esac ;;
 276.383 --     *)   echo "bad number of args" ;;
 276.384 --  esac
 276.385 - 
 276.386 - exit 0
 276.387 ---- /dev/null
 276.388 -+++ b/man.sh
 276.389 -@@ -0,0 +1,292 @@
 276.390 -+#!/bin/sh
 276.391 -+# man2html cgi script - uses /usr/bin/man2html to format man pages
 276.392 -+# aeb@cwi.nl - 980109
 276.393 -+# Aleksej Bobylev <al.bobylev@gmail.com>, 2015-2016
 276.394 -+
 276.395 -+. /usr/lib/slitaz/httphelper.sh
 276.396 -+. /lib/libtaz.sh
 276.397 -+
 276.398 -+# Internationalization.
 276.399 -+[ -e /etc/locale.conf ] && . /etc/locale.conf
 276.400 -+export TEXTDOMAIN='man2html'
 276.401 -+export LANG LC_ALL
 276.402 -+_()  { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
 276.403 -+
 276.404 -+
 276.405 -+SECTIONS="$(_ 'User Commands'):$(_ 'System Calls'):$(_ 'C Library Functions'):\
 276.406 -+$(_ 'Devices and Network Interfaces'):$(_ 'File Formats'):\
 276.407 -+$(_ 'Games and Demos'):$(_ 'Environments, Tables, and Troff Macros'):\
 276.408 -+$(_ 'Maintenance Commands'):$(_ 'All available manual pages')"
 276.409 -+
 276.410 -+query="$(GET query)"
 276.411 -+if [ -z "$query" ]; then
 276.412 -+	set -- $(echo $(GET) | tr '+' ' ')
 276.413 -+else
 276.414 -+	set -- $(echo $(GET query) | tr '+' ' ')
 276.415 -+fi
 276.416 -+
 276.417 -+
 276.418 -+if [ $1 == 'css' ]; then
 276.419 -+	# post css file on query
 276.420 -+	header 'Content-Type: text/css'
 276.421 -+	cat /usr/share/doc/slitaz-doc.css
 276.422 -+fi
 276.423 -+
 276.424 -+if [ $# -eq 1 ]; then
 276.425 -+	case $1 in
 276.426 -+		1|2|3|4|5|6|7|8|all)
 276.427 -+			if [ "$1" == 'all' ]; then
 276.428 -+				sec_n='9'; sec_folder='man?'
 276.429 -+			else
 276.430 -+				sec_n="$1"; sec_folder="man$1"
 276.431 -+			fi
 276.432 -+			sec_desc=$(echo "$SECTIONS" | cut -d':' -f $sec_n)
 276.433 -+			header
 276.434 -+			cat <<EOT
 276.435 -+<!DOCTYPE html>
 276.436 -+<html>
 276.437 -+<head>
 276.438 -+	<title>$1. $sec_desc</title>
 276.439 -+	<link rel="stylesheet" href="?css">
 276.440 -+</head>
 276.441 -+<body><header><h1>$(_ 'Section %s: %s' $1 "$sec_desc")</h1></header>
 276.442 -+	<section><header>$(_ 'Manual Pages')</header>
 276.443 -+	<p>
 276.444 -+EOT
 276.445 -+
 276.446 -+			case $1 in
 276.447 -+				1) _ "Section 1 of the manual describes user commands and tools, for example, file \
 276.448 -+manipulation tools, shells, compilers, web browsers, file and image viewers and editors, and so \
 276.449 -+on.";;
 276.450 -+				2) _ "Section 2 of the manual describes the Linux system calls. A system call is \
 276.451 -+an entry point into the Linux kernel.";;
 276.452 -+				3) _ "Section 3 of the manual describes all library functions excluding the \
 276.453 -+library functions (system call wrappers) described in Section 2, which implement system calls.";;
 276.454 -+				4) _ "Section 4 of the manual describes special files (devices).";;
 276.455 -+				5) _ "Section 5 of the manual describes various file formats, as well as the \
 276.456 -+corresponding C structures, if any.";;
 276.457 -+				6) _ "Section 6 of the manual describes all the games and funny little programs \
 276.458 -+available on the system.";;
 276.459 -+				7) _ "Section 7 of the manual provides overviews on various topics, and describes \
 276.460 -+conventions and protocols, character set standards, the standard filesystem layout, and \
 276.461 -+miscellaneous other things.";;
 276.462 -+				8) _ "Section 8 of the manual describes commands which either can be or are used \
 276.463 -+only by the superuser, like system-administration commands, daemons, and hardware-related \
 276.464 -+commands.";;
 276.465 -+			esac
 276.466 -+
 276.467 -+			[ "$1" != 'all' ] && echo "<b><a href=\"?intro.$1\">intro</a></b>($1)"
 276.468 -+			echo '</p>'
 276.469 -+
 276.470 -+			temp="$(mktemp)"; temp2="$(mktemp)"
 276.471 -+			for dir in $(find /usr/share/man -type d -name "$sec_folder"); do
 276.472 -+				ls $dir | sed 's|\.\([0-9]\)\.*[bgx]*z*2*$|:\1|'
 276.473 -+				# fix sorting 'feature': leading '_' always ignored by `sort`
 276.474 -+			done | sed 's|_|zzzzzzzz|g' | sort -fu | sed 's|zzzzzzzz|_|g' | \
 276.475 -+			awk -F' ' -vtemp="$temp" -vtemp2="$temp2" '
 276.476 -+			{
 276.477 -+				split($1, man, ":");
 276.478 -+
 276.479 -+				letter = tolower(substr(man[1], 1, 1));
 276.480 -+				if (letter != last_letter) {
 276.481 -+					last_letter = letter;
 276.482 -+					letter_index[++num_letters] = letter;
 276.483 -+					print "<h3 id=\"l" letter "\">" toupper(letter) "</h3>" > temp;
 276.484 -+				}
 276.485 -+				lnk = man[1]; gsub("+", "%2b", lnk);
 276.486 -+				printf "<b><a href=\"?%s.%s\">%s</a></b>(%s) ", lnk, man[2], man[1], man[2] > temp;
 276.487 -+			}
 276.488 -+			END {
 276.489 -+				# Print out alphabetic quick index and other links
 276.490 -+				for (i = 1; i <= num_letters; i++) {
 276.491 -+					print "<a href=\"#l" letter_index[i] section "\">" toupper(letter_index[i]) "</a>" > temp2;
 276.492 -+				}
 276.493 -+			}
 276.494 -+			'
 276.495 -+			if [ -s "$temp" ]; then
 276.496 -+				echo '<hr>'; cat "$temp2"; echo '<hr>'
 276.497 -+				cat "$temp"
 276.498 -+				echo '<hr>'; cat "$temp2"; echo '<hr>'
 276.499 -+			fi
 276.500 -+
 276.501 -+			rm -f "$temp" "$temp2"
 276.502 -+
 276.503 -+			cat <<EOT
 276.504 -+	</section>
 276.505 -+	<section><header>$(_ 'Sections')</header>
 276.506 -+		<ol>
 276.507 -+EOT
 276.508 -+			for i in $(seq 8); do
 276.509 -+				sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i)
 276.510 -+				echo "<li><a href=\"?$i\">$sec_desc</a></li>"
 276.511 -+			done
 276.512 -+			cat <<EOT
 276.513 -+	</ol>
 276.514 -+	<p><a href="?all">$(_ 'All Sections')</a></p>
 276.515 -+</section>
 276.516 -+
 276.517 -+</body>
 276.518 -+</html>
 276.519 -+EOT
 276.520 -+			exit 0
 276.521 -+			;;
 276.522 -+	esac
 276.523 -+fi
 276.524 -+
 276.525 -+# Find the required page - expect to be called with "man2html [sec] page".
 276.526 -+# There may a prefixed "-M manpath" option.
 276.527 -+
 276.528 -+if [ $# -ge 2 -a "$1" == '-M' ]; then
 276.529 -+	MANPATH="$2"
 276.530 -+	export MANPATH
 276.531 -+	shift; shift
 276.532 -+	MP=' using the given MANPATH'
 276.533 -+else
 276.534 -+	MP=''
 276.535 -+fi
 276.536 -+
 276.537 -+
 276.538 -+# If no arguments given, show a start page.
 276.539 -+
 276.540 -+if [ $# -eq 0 ]; then
 276.541 -+	header
 276.542 -+	cat <<EOT
 276.543 -+<!DOCTYPE html>
 276.544 -+<html>
 276.545 -+<head>
 276.546 -+	<meta charset="UTF-8">
 276.547 -+	<title>$(_ 'Manual Pages - Main Contents')</title>
 276.548 -+	<link rel="stylesheet" href="?css">
 276.549 -+</head>
 276.550 -+<body>
 276.551 -+<header><h1>$(_ 'Manual Pages - Main Contents')</h1></header>
 276.552 -+<section><header>$(_ 'Name and Section lookup')</header>
 276.553 -+	<form method="GET">
 276.554 -+		<input name="query" size="40">
 276.555 -+		<button type="submit">$(_ 'Search')</button>
 276.556 -+	</form>
 276.557 -+	<p>$(_ "You can enter a program name, possibly preceded by the section, the directories to search \
 276.558 -+(with -M) or a full name. For example:")</p>
 276.559 -+
 276.560 -+	<ul>
 276.561 -+		<li><tt>find</tt></li>
 276.562 -+		<li><tt>1 find</tt></li>
 276.563 -+		<li><tt>-M /usr/share/man:/opt/man:/usr/local/share/man find</tt></li>
 276.564 -+		<li><tt>/usr/share/man/man1/gperf.1</tt></li>
 276.565 -+	</ul>
 276.566 -+</section>
 276.567 -+
 276.568 -+<section><header>$(_ 'Index of pages')</header>
 276.569 -+
 276.570 -+	<ol>
 276.571 -+EOT
 276.572 -+	for i in $(seq 8); do
 276.573 -+		sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i)
 276.574 -+		echo "<li><a href=\"?$i\">$sec_desc</a></li>"
 276.575 -+	done
 276.576 -+	cat <<EOT
 276.577 -+	</ol>
 276.578 -+	<p><a href="?all">$(_ 'All Sections')</a></p>
 276.579 -+</section>
 276.580 -+
 276.581 -+<footer>
 276.582 -+	<p>$(_ 'The original man2html program and scripts are due to %s and %s.' \
 276.583 -+	'<a href="http://wsinwp01.win.tue.nl:1234/index.html">Richard Verhoeven</a>' \
 276.584 -+	'<a href="mailto:michael@actrix.gen.nz">Michael Hamilton</a>')
 276.585 -+	$(_ 'This version is from %s maintained by %s.' 'man-1.6g' \
 276.586 -+	'<a href="mailto:flucifredi@acm.org">Federico Lucifredi</a>')</p>
 276.587 -+</footer>
 276.588 -+</body>
 276.589 -+</html>
 276.590 -+EOT
 276.591 -+	exit 0
 276.592 -+fi
 276.593 -+
 276.594 -+if [ $# -gt 2 ]; then
 276.595 -+	man2html -E "man2html: bad invocation: too many arguments"
 276.596 -+	exit 0
 276.597 -+fi
 276.598 -+
 276.599 -+# A single argument may be an explicitly give path name
 276.600 -+# Otherwise, find it
 276.601 -+
 276.602 -+if [ $# -eq 1 ]; then
 276.603 -+	arg=${1//%2b/+}
 276.604 -+	case "$arg" in
 276.605 -+		/*)  PAGE="$arg";;
 276.606 -+		*.*) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg"   -o -name "$arg.gz"   -o -name "$arg.bz2"   -o -name "$arg.xz" \));;
 276.607 -+		*)   PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg.*" -o -name "$arg.*.gz" -o -name "$arg.*.bz2" -o -name "$arg.*.xz" \));;
 276.608 -+	esac
 276.609 -+else
 276.610 -+	arg=${2//%2b/+}
 276.611 -+	PAGE="$(
 276.612 -+		for dir in $(find /usr/share/man -type d -name man$1); do
 276.613 -+			find $dir \( -type f -o -type l \) -name "$arg.$1*"
 276.614 -+		done)"
 276.615 -+fi
 276.616 -+
 276.617 -+if [ -z "$PAGE" ]; then
 276.618 -+	complaint="$(_ 'Cannot find a page')"
 276.619 -+	if [ $# -eq 1 ]; then
 276.620 -+		complaint="$(_ 'Cannot find a page for <b>%s</b> %s' $1 $MP)"
 276.621 -+	else
 276.622 -+		complaint="$(_ 'Cannot find a page for <b>%s</b> in section <b>%s</b> %s') $2 $1 $MP"
 276.623 -+	fi
 276.624 -+	man2html -E "<p>$complaint</p>"
 276.625 -+	exit 0
 276.626 -+fi
 276.627 -+
 276.628 -+if [ "$(echo "$PAGE" | wc -l)" -gt 1 ]; then
 276.629 -+	header
 276.630 -+	cat <<EOT
 276.631 -+<!DOCTYPE html>
 276.632 -+<html><head><title>$(_ 'Multiple pages')</title>
 276.633 -+<link rel="stylesheet" href="?css"></link></head>
 276.634 -+<body><header><h1>$(_ 'Multiple pages found')</h1></header>
 276.635 -+	<section>
 276.636 -+	<ul>
 276.637 -+EOT
 276.638 -+	echo "$PAGE" | awk -F'/' '{
 276.639 -+		if ($5 ~ "man") {
 276.640 -+			split($6, man, ".");
 276.641 -+			printf "<li><a href=\"?%s\">%s</a> (%s)</li>\n", $0, man[1], man[2];
 276.642 -+		} else {
 276.643 -+			split($7, man, ".");
 276.644 -+			printf "<li><a href=\"?%s\">%s</a> (%s) — %s</li>\n", $0, man[1], man[2], $5;
 276.645 -+		}
 276.646 -+	}'
 276.647 -+	sed 's|^.*$|<li><a href="?&">&</a></li>|'
 276.648 -+	echo '</ul></section></body></html>'
 276.649 -+	exit 0
 276.650 -+fi
 276.651 -+
 276.652 -+if [ -r "$PAGE" ]; then
 276.653 -+	tmpman="$(mktemp)"
 276.654 -+	# Unpack man page
 276.655 -+	case "$PAGE" in
 276.656 -+		*.gz)   zcat "$PAGE" > "$tmpman";;
 276.657 -+		*.bz2) bzcat "$PAGE" > "$tmpman";;
 276.658 -+		*.xz)  xzcat "$PAGE" > "$tmpman";;
 276.659 -+		*)        cp "$PAGE"   "$tmpman";;
 276.660 -+	esac
 276.661 -+
 276.662 -+	# Check for link
 276.663 -+	line="$(fgrep -v '.\"' "$tmpman" | head -n1)"
 276.664 -+	case "$line" in
 276.665 -+		.so*)
 276.666 -+			link="$(echo "$line" | cut -d'/' -f2)"
 276.667 -+			header	"HTTP/1.1 301 Moved Permanently" \
 276.668 -+					"Location: ?$link"
 276.669 -+			;;
 276.670 -+		*)
 276.671 -+			# Convert page to HTML
 276.672 -+			man2html "$tmpman"
 276.673 -+			;;
 276.674 -+	esac
 276.675 -+
 276.676 -+	# Clean
 276.677 -+	rm "$tmpman"
 276.678 -+else
 276.679 -+	man2html -E "Strange... Cannot find (or read) $PAGE."
 276.680 -+fi
 276.681 -+exit 0
 276.682 ---- a/man2html.c
 276.683 -+++ b/man2html.c
 276.684 -@@ -21,14 +21,17 @@
 276.685 - #include <ctype.h>
 276.686 - #include <sys/stat.h>
 276.687 - #include "defs.h"
 276.688 --#include "../src/version.h"
 276.689 -+#include "version.h"
 276.690 -+#include <glib.h>
 276.691 -+#include <glib/gi18n.h>
 276.692 -+#define GETTEXT_PACKAGE "man2html"
 276.693 - 
 276.694 - /* BSD mandoc Bd/Ed example(?) blocks */
 276.695 - #define BD_LITERAL  1
 276.696 - #define BD_INDENT   2
 276.697 - 
 276.698 - #define SIZE(a)	(sizeof(a)/sizeof(*a))
 276.699 --#define DOCTYPE "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
 276.700 -+#define DOCTYPE "<!DOCTYPE html>\n"
 276.701 - #define CONTENTTYPE "Content-type: text/html; charset=UTF-8\n\n"
 276.702 - 
 276.703 - static char NEWLINE[2]="\n";
 276.704 -@@ -58,28 +61,13 @@
 276.705 - 
 276.706 - static char charb[3];
 276.707 - 
 276.708 --#ifdef GUNZIP
 276.709 --/* from src/utils.c */
 276.710 --static int
 276.711 --is_shell_safe(const char *ss, int quoted) {
 276.712 --	char *bad = " ;'\\\"<>|";
 276.713 --	char *p;
 276.714 - 
 276.715 --	if (quoted)
 276.716 --		bad++;			/* allow a space inside quotes */
 276.717 --	for (p = bad; *p; p++)
 276.718 --		if (strchr(ss, *p))
 276.719 --			return 0;
 276.720 --	return 1;
 276.721 --}
 276.722 --#endif
 276.723 --
 276.724 - /* reads the entire manpage into buffer *buf and returns number of chars read */
 276.725 - static int
 276.726 - read_manpage_into_buffer(char *path, char **buf) {
 276.727 - 	int compressed = 0;
 276.728 - 	FILE * f = NULL;
 276.729 --	char * ext;
 276.730 -+	/* char * ext; */
 276.731 - 	int l = 0;
 276.732 - 	struct stat stbuf;
 276.733 - 
 276.734 -@@ -94,26 +82,6 @@
 276.735 - 		char * tmp = NULL;
 276.736 - 		char * command = NULL;
 276.737 - 		char * openpath = path;
 276.738 --#ifdef GUNZIP
 276.739 --
 276.740 --		if (is_shell_safe(openpath, 1)) {
 276.741 --			ext = strrchr(openpath, '.');
 276.742 --			compressed = (ext && !strcmp(ext, ".gz"));
 276.743 --
 276.744 --			if (!compressed && stat(openpath, &stbuf)) {
 276.745 --				tmp = (char*) xmalloc(strlen(path) + 4);
 276.746 --				sprintf(tmp, "%s.gz", path);
 276.747 --				if ((compressed = !stat(tmp, &stbuf)))
 276.748 --					openpath = tmp;
 276.749 --			}
 276.750 --		}
 276.751 --
 276.752 --		if (compressed) {
 276.753 --			command = (char*) xmalloc(strlen(openpath) + sizeof(GUNZIP) + 4);
 276.754 --			sprintf(command, GUNZIP " '%s'", openpath);
 276.755 --			f = popen(command, "r");
 276.756 --		} else
 276.757 --#endif
 276.758 - 			f = fopen(openpath, "r");
 276.759 - 
 276.760 - 		if (tmp) free(tmp);
 276.761 -@@ -170,7 +138,7 @@
 276.762 - 
 276.763 - 	h = chardef;
 276.764 - 	if (h->nr != V('*','*')) {
 276.765 --		printf("chardef corrupted\n");
 276.766 -+		printf("%s\n", _("chardef corrupted"));
 276.767 - 		exit(1);
 276.768 - 	}
 276.769 - 
 276.770 -@@ -216,7 +184,7 @@
 276.771 -     ** Add the links to the output.
 276.772 -     ** At the moment the following are recognized:
 276.773 -     **
 276.774 --    ** name(*)                 -> ../man?/name.*
 276.775 -+    ** name(*)                 -> ?name.*
 276.776 -     ** method://string         -> method://string
 276.777 -     ** www.host.name           -> http://www.host.name
 276.778 -     ** ftp.host.name           -> ftp://ftp.host.name
 276.779 -@@ -453,8 +421,8 @@
 276.780 - #define DL	1
 276.781 - #define	UL	2
 276.782 - #define	OL	3
 276.783 --static char *dl_open[4] = { "", "<DL COMPACT>\n", "<UL>", "<OL>" };
 276.784 --static char *dl_close[4] = { "", "</DL>\n", "</UL>", "</OL>" };
 276.785 -+static char *dl_open[4] = { "", "<dl compact>\n", "<ul>", "<ol>" };
 276.786 -+static char *dl_close[4] = { "", "</dl>\n", "</ul>", "</ol>" };
 276.787 - 
 276.788 - static inline void
 276.789 - dl_begin(void) {
 276.790 -@@ -462,7 +430,7 @@
 276.791 - 	  out_html(dl_open[DL]);
 276.792 - 	  dl_set[itemdepth]=DL;
 276.793 -      }
 276.794 --     out_html("<DT>");
 276.795 -+     out_html("<dt>");
 276.796 - }
 276.797 - 
 276.798 - static inline void
 276.799 -@@ -481,14 +449,14 @@
 276.800 -      itemdepth++;
 276.801 -      if (itemdepth < SIZE(dl_set))
 276.802 - 	  dl_set[itemdepth]=noDL;
 276.803 --     out_html("<DL COMPACT><DT><DD>");
 276.804 -+     out_html("<dl compact><dt><dd>");
 276.805 - }
 276.806 - 
 276.807 - static inline void
 276.808 - dl_endlevel(void) {
 276.809 -      if (itemdepth) {
 276.810 - 	  dl_end();
 276.811 --	  out_html("</DL>\n");
 276.812 -+	  out_html("</dl>\n");
 276.813 - 	  itemdepth--;
 276.814 -      }
 276.815 - }
 276.816 -@@ -538,12 +506,12 @@
 276.817 - 
 276.818 - #define FO0 ""
 276.819 - #define FC0 ""
 276.820 --#define FO1 "<I>"
 276.821 --#define FC1 "</I>"
 276.822 --#define FO2 "<B>"
 276.823 --#define FC2 "</B>"
 276.824 --#define FO3 "<TT>"
 276.825 --#define FC3 "</TT>"
 276.826 -+#define FO1 "<i>"
 276.827 -+#define FC1 "</i>"
 276.828 -+#define FO2 "<b>"
 276.829 -+#define FC2 "</b>"
 276.830 -+#define FO3 "<tt>"
 276.831 -+#define FC3 "</tt>"
 276.832 - 
 276.833 - char *switchfont[16] = { ""     , FC0 FO1, FC0 FO2, FC0 FO3,
 276.834 - 			 FC1 FO0, ""     , FC1 FO2, FC1 FO3,
 276.835 -@@ -588,14 +556,16 @@
 276.836 -   i=current_font;
 276.837 -   sizebuf[0]=0;
 276.838 -   strcat(sizebuf, change_to_font(0));
 276.839 --  if (current_size) strcat(sizebuf, "</FONT>");
 276.840 -+  if (current_size) strcat(sizebuf, "</span>");
 276.841 -   current_size=nr;
 276.842 -   if (nr) {
 276.843 -     int l;
 276.844 --    strcat(sizebuf, "<FONT SIZE=\"");
 276.845 -+    strcat(sizebuf, "<span style=\"font-size: ");
 276.846 -     l=strlen(sizebuf);
 276.847 -     if (nr>0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr;
 276.848 -     sizebuf[l++]=nr+'0';
 276.849 -+    sizebuf[l++]='p';
 276.850 -+    sizebuf[l++]='t';
 276.851 -     sizebuf[l++]='"';
 276.852 -     sizebuf[l++]='>';
 276.853 -     sizebuf[l]=0;
 276.854 -@@ -775,7 +745,7 @@
 276.855 - 	skip_escape=exskipescape;
 276.856 - 	intresult=j;
 276.857 - 	break;
 276.858 --    case 'l': h="<HR>"; curpos=0;
 276.859 -+    case 'l': h="<hr>"; curpos=0;
 276.860 -     case 'b':
 276.861 -     case 'v':
 276.862 -     case 'x':
 276.863 -@@ -812,7 +782,7 @@
 276.864 -     case 'c': no_newline_output=1; break;
 276.865 -     case '{': newline_for_fun++; h="";break;
 276.866 -     case '}': if (newline_for_fun) newline_for_fun--; h="";break;
 276.867 --    case 'p': h="<BR>\n";curpos=0; break;
 276.868 -+    case 'p': h="<br>\n";curpos=0; break;
 276.869 -     case 't': h="\t";curpos=(curpos+8)&0xfff8; break;
 276.870 -     case '<': h="&lt;";curpos++; break;
 276.871 -     case '>': h="&gt;";curpos++; break;
 276.872 -@@ -1021,7 +991,7 @@
 276.873 -     out_html(change_to_size(0));
 276.874 -     if (!fillout) {
 276.875 - 	fillout=1;
 276.876 --	out_html("</PRE>");
 276.877 -+	out_html("</pre>");
 276.878 -     }
 276.879 -     while (*h && *h!='\n') h++;
 276.880 -     if (h[-1]==';') {
 276.881 -@@ -1197,45 +1167,45 @@
 276.882 - 	currow=currow->prev;
 276.883 -     }
 276.884 -     /* produce html output */
 276.885 --    if (center) out_html("<CENTER>");
 276.886 --    if (box==2) out_html("<TABLE BORDER><TR><TD>");
 276.887 --    out_html("<TABLE");
 276.888 -+    if (center) out_html("<div style=\"margin: 0 auto\">");
 276.889 -+    if (box==2) out_html("<table border><tr><td>");
 276.890 -+    out_html("<table");
 276.891 -     if (box || border) {
 276.892 --	out_html(" BORDER");
 276.893 --	if (!border) out_html("><TR><TD><TABLE");
 276.894 --	if (expand) out_html(" WIDTH=100%");
 276.895 -+	out_html(" border");
 276.896 -+	if (!border) out_html("><tr><td><table");
 276.897 -+	if (expand) out_html(" width=100%");
 276.898 -     }
 276.899 -     out_html(">\n");
 276.900 -     currow=layout;
 276.901 -     while (currow) {
 276.902 - 	j=0;
 276.903 --	out_html("<TR VALIGN=top>");
 276.904 -+	out_html("<tr style=\"vertical-align: top\">");
 276.905 - 	curfield=currow->first;
 276.906 - 	while (curfield) {
 276.907 - 	    if (curfield->align!='S' && curfield->align!='^') {
 276.908 --		out_html("<TD");
 276.909 -+		out_html("<td");
 276.910 - 		switch (curfield->align) {
 276.911 - 		case 'N':
 276.912 - 		    curfield->space+=4;
 276.913 - 		case 'R':
 276.914 --		    out_html(" ALIGN=right");
 276.915 -+		    out_html(" style=\"text-align: right\"");
 276.916 - 		    break;
 276.917 - 		case 'C':
 276.918 --		    out_html(" ALIGN=center");
 276.919 -+		    out_html(" style=\"text-align: center\"");
 276.920 - 		default:
 276.921 - 		    break;
 276.922 - 		}
 276.923 - 		if (!curfield->valign && curfield->rowspan>1)
 276.924 --		    out_html(" VALIGN=center");
 276.925 -+		    out_html(" style=\"vertical-align: center\"");
 276.926 - 		if (curfield->colspan>1) {
 276.927 - 		    char buf[5];
 276.928 --		    out_html(" COLSPAN=");
 276.929 -+		    out_html(" colspan=");
 276.930 - 		    sprintf(buf, "%i", curfield->colspan);
 276.931 - 		    out_html(buf);
 276.932 - 		}
 276.933 - 		if (curfield->rowspan>1) {
 276.934 - 		    char buf[5];
 276.935 --		    out_html(" ROWSPAN=");
 276.936 -+		    out_html(" rowspan=");
 276.937 - 		    sprintf(buf, "%i", curfield->rowspan);
 276.938 - 		    out_html(buf);
 276.939 - 		}
 276.940 -@@ -1244,8 +1214,8 @@
 276.941 - 		if (curfield->size) out_html(change_to_size(curfield->size));
 276.942 - 		if (curfield->font) out_html(change_to_font(curfield->font));
 276.943 - 		switch (curfield->align) {
 276.944 --		case '=': out_html("<HR><HR>"); break;
 276.945 --		case '_': out_html("<HR>"); break;
 276.946 -+		case '=': out_html("<hr><hr>"); break;
 276.947 -+		case '_': out_html("<hr>"); break;
 276.948 - 		default:
 276.949 - 		    if (curfield->contents) out_html(curfield->contents);
 276.950 - 		    break;
 276.951 -@@ -1255,20 +1225,20 @@
 276.952 - 		if (curfield->font) out_html(change_to_font(0));
 276.953 - 		if (curfield->size) out_html(change_to_size(0));
 276.954 - 		if (j>=maxcol && curfield->align>'@' && curfield->align!='_')
 276.955 --		    out_html("<BR>");
 276.956 --		out_html("</TD>");
 276.957 -+		    out_html("<br>");
 276.958 -+		out_html("</td>");
 276.959 - 	    }
 276.960 - 	    curfield=curfield->next;
 276.961 - 	}
 276.962 --	out_html("</TR>\n");
 276.963 -+	out_html("</tr>\n");
 276.964 - 	currow=currow->next;
 276.965 -     }
 276.966 --    if (box && !border) out_html("</TABLE>");
 276.967 --    out_html("</TABLE>");
 276.968 --    if (box==2) out_html("</TABLE>");
 276.969 --    if (center) out_html("</CENTER>\n");
 276.970 -+    if (box && !border) out_html("</table>");
 276.971 -+    out_html("</table>");
 276.972 -+    if (box==2) out_html("</table>");
 276.973 -+    if (center) out_html("</div>\n");
 276.974 -     else out_html("\n");
 276.975 --    if (!oldfillout) out_html("<PRE>");
 276.976 -+    if (!oldfillout) out_html("<pre>");
 276.977 -     fillout=oldfillout;
 276.978 -     out_html(change_to_size(oldsize));
 276.979 -     out_html(change_to_font(oldfont));
 276.980 -@@ -1401,7 +1371,7 @@
 276.981 - 		case '&': value = (value && value2); break;
 276.982 - 		case ':': value = (value || value2); break;
 276.983 - 		default: fprintf(stderr,
 276.984 --				 "man2html: Unknown operator %c.\n", oper);
 276.985 -+				_("man2html: Unknown operator %c.\n"), oper);
 276.986 - 		}
 276.987 - 		oper=0;
 276.988 - 	    }
 276.989 -@@ -1489,42 +1459,42 @@
 276.990 - 
 276.991 - 
 276.992 - char *section_list[] = {
 276.993 --    "1", "User Commands ",
 276.994 --    "1C", "User Commands",
 276.995 --    "1G", "User Commands",
 276.996 --    "1S", "User Commands",
 276.997 --    "1V", "User Commands ",
 276.998 --    "2", "System Calls",
 276.999 --    "2V", "System Calls",
276.1000 --    "3", "C Library Functions",
276.1001 --    "3C", "Compatibility Functions",
276.1002 --    "3F", "Fortran Library Routines",
276.1003 --    "3K", "Kernel VM Library Functions",
276.1004 --    "3L", "Lightweight Processes Library",
276.1005 --    "3M", "Mathematical Library",
276.1006 --    "3N", "Network Functions",
276.1007 --    "3R", "RPC Services Library",
276.1008 --    "3S", "Standard I/O Functions",
276.1009 --    "3V", "C Library Functions",
276.1010 --    "3X", "Miscellaneous Library Functions",
276.1011 --    "4", "Devices and Network Interfaces",
276.1012 --    "4F", "Protocol Families",
276.1013 --    "4I", "Devices and Network Interfaces",
276.1014 --    "4M", "Devices and Network Interfaces",
276.1015 --    "4N", "Devices and Network Interfaces",
276.1016 --    "4P", "Protocols",
276.1017 --    "4S", "Devices and Network Interfaces",
276.1018 --    "4V", "Devices and Network Interfaces",
276.1019 --    "5", "File Formats",
276.1020 --    "5V", "File Formats",
276.1021 --    "6", "Games and Demos",
276.1022 --    "7", "Environments, Tables, and Troff Macros",
276.1023 --    "7V", "Environments, Tables, and Troff Macros",
276.1024 --    "8", "Maintenance Commands",
276.1025 --    "8C", "Maintenance Commands",
276.1026 --    "8S", "Maintenance Commands",
276.1027 --    "8V", "Maintenance Commands",
276.1028 --    "L", "Local Commands",
276.1029 -+    "1",  N_("User Commands"),
276.1030 -+    "1C", N_("User Commands"),
276.1031 -+    "1G", N_("User Commands"),
276.1032 -+    "1S", N_("User Commands"),
276.1033 -+    "1V", N_("User Commands"),
276.1034 -+    "2",  N_("System Calls"),
276.1035 -+    "2V", N_("System Calls"),
276.1036 -+    "3",  N_("C Library Functions"),
276.1037 -+    "3C", N_("Compatibility Functions"),
276.1038 -+    "3F", N_("Fortran Library Routines"),
276.1039 -+    "3K", N_("Kernel VM Library Functions"),
276.1040 -+    "3L", N_("Lightweight Processes Library"),
276.1041 -+    "3M", N_("Mathematical Library"),
276.1042 -+    "3N", N_("Network Functions"),
276.1043 -+    "3R", N_("RPC Services Library"),
276.1044 -+    "3S", N_("Standard I/O Functions"),
276.1045 -+    "3V", N_("C Library Functions"),
276.1046 -+    "3X", N_("Miscellaneous Library Functions"),
276.1047 -+    "4",  N_("Devices and Network Interfaces"),
276.1048 -+    "4F", N_("Protocol Families"),
276.1049 -+    "4I", N_("Devices and Network Interfaces"),
276.1050 -+    "4M", N_("Devices and Network Interfaces"),
276.1051 -+    "4N", N_("Devices and Network Interfaces"),
276.1052 -+    "4P", N_("Protocols"),
276.1053 -+    "4S", N_("Devices and Network Interfaces"),
276.1054 -+    "4V", N_("Devices and Network Interfaces"),
276.1055 -+    "5",  N_("File Formats"),
276.1056 -+    "5V", N_("File Formats"),
276.1057 -+    "6",  N_("Games and Demos"),
276.1058 -+    "7",  N_("Environments, Tables, and Troff Macros"),
276.1059 -+    "7V", N_("Environments, Tables, and Troff Macros"),
276.1060 -+    "8",  N_("Maintenance Commands"),
276.1061 -+    "8C", N_("Maintenance Commands"),
276.1062 -+    "8S", N_("Maintenance Commands"),
276.1063 -+    "8V", N_("Maintenance Commands"),
276.1064 -+    "L",  N_("Local Commands"),
276.1065 - /* for Solaris: 
276.1066 -     "1", "User Commands",
276.1067 -     "1B", "SunOS/BSD Compatibility Package Commands",
276.1068 -@@ -1593,7 +1563,7 @@
276.1069 -     "9s", "DDI and DKI Data Structures",
276.1070 -     "L", "Local Commands",
276.1071 - */
276.1072 --    NULL, "Misc. Reference Manual Pages",
276.1073 -+    NULL, N_("Misc. Reference Manual Pages"),
276.1074 -     NULL, NULL
276.1075 - };
276.1076 - 
276.1077 -@@ -1604,7 +1574,7 @@
276.1078 - 
276.1079 -     if (!c) return "";
276.1080 -     while (section_list[i] && strcmp(c,section_list[i])) i=i+2;
276.1081 --    if (section_list[i+1]) return section_list[i+1];
276.1082 -+    if (section_list[i+1]) return _(section_list[i+1]);
276.1083 -     else return c;
276.1084 - }
276.1085 - 
276.1086 -@@ -1636,10 +1606,10 @@
276.1087 -     if (level != subs) {
276.1088 - 	manidx_need(6);
276.1089 - 	if (subs) {
276.1090 --	    strcpy(manidx+mip, "</DL>\n");
276.1091 -+	    strcpy(manidx+mip, "</dl>\n");
276.1092 - 	    mip += 6;
276.1093 - 	} else {
276.1094 --	    strcpy(manidx+mip, "<DL>\n");
276.1095 -+	    strcpy(manidx+mip, "<dl>\n");
276.1096 - 	    mip += 5;
276.1097 - 	}
276.1098 -     }
276.1099 -@@ -1647,7 +1617,7 @@
276.1100 - 
276.1101 -     scan_troff(item, 1, &c);
276.1102 -     manidx_need(100 + strlen(c));
276.1103 --    sprintf(manidx+mip, "<DT><A HREF=\"#%s\">%s</A><DD>\n", label, c);
276.1104 -+    sprintf(manidx+mip, "<dt><a href=\"#%s\">%s</a></dt><dd>\n", label, c);
276.1105 -     if (c) free(c);
276.1106 -     while (manidx[mip]) mip++;
276.1107 - }
276.1108 -@@ -1834,8 +1804,8 @@
276.1109 - 	    }
276.1110 - 	    break;
276.1111 - 	case V('b','r'):
276.1112 --	    if (still_dd) out_html("<DD>");
276.1113 --	    else out_html("<BR>\n");
276.1114 -+	    if (still_dd) out_html("<dd>");
276.1115 -+	    else out_html("<br>\n");
276.1116 - 	    curpos=0;
276.1117 - 	    c=c+j;
276.1118 - 	    if (c[0] == escapesym) { c=scan_escape(c+1); }
276.1119 -@@ -1865,17 +1835,17 @@
276.1120 - 	    c=skip_till_newline(c);
276.1121 - 	    /* center next i lines */
276.1122 - 	    if (i>0) {
276.1123 --		out_html("<CENTER>\n");
276.1124 -+		out_html("<div style=\"margin: 0 auto\">\n");
276.1125 - 		while (i && *c) {
276.1126 - 		    char *line=NULL;
276.1127 - 		    c=scan_troff(c,1, &line);
276.1128 --		    if (line && strncmp(line, "<BR>", 4)) {
276.1129 -+		    if (line && strncmp(line, "<br>", 4)) {
276.1130 - 			out_html(line);
276.1131 --			out_html("<BR>\n");
276.1132 -+			out_html("<br>\n");
276.1133 - 			i--;
276.1134 - 		    }
276.1135 - 		}
276.1136 --		out_html("</CENTER>\n");
276.1137 -+		out_html("</div>\n");
276.1138 - 		curpos=0;
276.1139 - 	    }
276.1140 - 	    break;
276.1141 -@@ -1906,7 +1876,7 @@
276.1142 - 	    if (!fillout) {
276.1143 - 		out_html(change_to_font(0));
276.1144 - 		out_html(change_to_size('0'));
276.1145 --		out_html("</PRE>\n");
276.1146 -+		out_html("</pre>\n");
276.1147 - 	    }
276.1148 - 	    curpos=0;
276.1149 - 	    fillout=1;
276.1150 -@@ -1981,7 +1951,7 @@
276.1151 - 	    if (fillout) {
276.1152 - 		out_html(change_to_font(0));
276.1153 - 		out_html(change_to_size('0'));
276.1154 --		out_html("<PRE>\n");
276.1155 -+		out_html("<pre>\n");
276.1156 - 	    }
276.1157 - 	    curpos=0;
276.1158 - 	    fillout=0;
276.1159 -@@ -2002,7 +1972,7 @@
276.1160 - 	    break;
276.1161 - 	case V('s','p'):
276.1162 - 	    c=c+j;
276.1163 --	    if (fillout) out_html("<P>"); else {
276.1164 -+	    if (fillout) out_html("<p>"); else {
276.1165 - 		out_html(NEWLINE);
276.1166 - 		NEWLINE[0]='\n';
276.1167 - 	    }
276.1168 -@@ -2033,30 +2003,15 @@
276.1169 - 		*c = 0;
276.1170 - 		scan_troff(h,1, &name);
276.1171 - 		if (name[3] == '/') h=name+3; else h=name;
276.1172 --#if NOCGI
276.1173 --                if (!out_length) {
276.1174 --		    char *t,*s;
276.1175 --		    t=strrchr(fname, '/');
276.1176 --		    if (!t) t=fname;
276.1177 --		    fprintf(stderr, "ln -s %s.html %s.html\n", h, t);
276.1178 --		    s=strrchr(t, '.');if (!s) s=t;
276.1179 --		    printf(CONTENTTYPE DOCTYPE);
276.1180 --		    printf("<HTML><HEAD><TITLE> Man page of %s</TITLE>\n"
276.1181 --			   "</HEAD><BODY>\n"
276.1182 --			   "See the man page for <A HREF=\"%s.html\">%s</A>.\n"
276.1183 --			   "</BODY></HTML>\n",
276.1184 --			   s, h, h);
276.1185 --		} else
276.1186 --#endif
276.1187 -                 {
276.1188 - 		    /* this works alright, except for section 3 */
276.1189 - 		    if ((l = read_manpage_into_buffer(h, &buf)) < 0) {
276.1190 - 			 fprintf(stderr,
276.1191 --				"man2html: unable to open or read file %s\n", h);
276.1192 --			 out_html("<BLOCKQUOTE>"
276.1193 --				  "man2html: unable to open or read file\n");
276.1194 -+				_("man2html: unable to open or read file %s\n"), h);
276.1195 -+			 out_html("<blockquote>");
276.1196 -+			 out_html(_("man2html: unable to open or read file\n"));
276.1197 - 			 out_html(h);
276.1198 --			 out_html("</BLOCKQUOTE>\n");
276.1199 -+			 out_html("</blockquote>\n");
276.1200 - 		    } else {
276.1201 - 			buf[0]=buf[l]='\n';
276.1202 - 			buf[l+1]=buf[l+2]=0;
276.1203 -@@ -2085,7 +2040,7 @@
276.1204 - #if 0
276.1205 - 	    dl_down();
276.1206 - #endif
276.1207 --	    out_html("<BR>\n");
276.1208 -+	    out_html("<br>\n");
276.1209 - 	    c=c+j;
276.1210 - 	    c=scan_expression(c, &j);
276.1211 - 	    for (i=0; i<j; i++) out_html("&nbsp;");
276.1212 -@@ -2163,7 +2118,7 @@
276.1213 -             if (words) {
276.1214 - 		scan_troff(wordlist[0], 1,NULL);
276.1215 - 	    }
276.1216 --	    out_html("<DD>");
276.1217 -+	    out_html("<dd>");
276.1218 - 	    curpos = 0;
276.1219 - 	    break;
276.1220 - 	case V('T','P'):
276.1221 -@@ -2172,7 +2127,7 @@
276.1222 - 	    /* somewhere a definition ends with '.TP' */
276.1223 - 	    if (!*c) still_dd=1; else {
276.1224 - 		c=scan_troff(c,1,NULL);
276.1225 --		out_html("<DD>");
276.1226 -+		out_html("<dd>");
276.1227 - 	    }
276.1228 - 	    curpos=0;
276.1229 - 	    break;
276.1230 -@@ -2195,20 +2150,20 @@
276.1231 - 		 fprintf(idxfile,"\n");
276.1232 - 	    }
276.1233 - #endif
276.1234 --            out_html("<A NAME=\"");
276.1235 -+            out_html("<span id=\"");
276.1236 - 	    out_html(idxlabel);
276.1237 - 	    /* this will not work in mosaic (due to a bug).
276.1238 - 	    ** Adding '&nbsp;' between '>' and '<' solves it, but creates
276.1239 - 	    ** some space. A normal space does not work.
276.1240 - 	    */
276.1241 --	    out_html("\"></A>");
276.1242 -+	    out_html("\"></span>");
276.1243 - 	    break;
276.1244 - 	case V('P',' '):
276.1245 - 	case V('P','\n'):
276.1246 - 	case V('L','P'):
276.1247 - 	case V('P','P'):
276.1248 - 	    dl_end();
276.1249 --	    if (fillout) out_html("<P>\n"); else {
276.1250 -+	    if (fillout) out_html("<p>\n"); else {
276.1251 - 		out_html(NEWLINE);
276.1252 - 		NEWLINE[0]='\n';
276.1253 - 	    }
276.1254 -@@ -2272,19 +2227,29 @@
276.1255 - 	    out_html(change_to_size(0));
276.1256 - 	    if (!fillout) {
276.1257 - 		fillout=1;
276.1258 --		out_html("</PRE>");
276.1259 -+		out_html("</pre>");
276.1260 - 	    }
276.1261 - 	    trans_char(c,'"', '\a');
276.1262 - 	    add_to_index(mode, c);
276.1263 --	    out_html("<A NAME=\"");
276.1264 --	    out_html(label);
276.1265 --	    /* &nbsp; for mosaic users */
276.1266 --	    if (mode) out_html("\">&nbsp;</A>\n<H3>");
276.1267 --	    else out_html("\">&nbsp;</A>\n<H2>");
276.1268 -+
276.1269 -+		if (mode) {
276.1270 -+			out_html("<h3 id=\"");
276.1271 -+			out_html(label);
276.1272 -+			out_html("\">");
276.1273 -+		} else {
276.1274 -+			out_html("</section>\n\n<section id=\"");
276.1275 -+			out_html(label);
276.1276 -+			out_html("\">\n<h2>");
276.1277 -+		}
276.1278 -+
276.1279 - 	    mandoc_synopsis = (strncmp(c, "SYNOPSIS", 8) == 0);
276.1280 - 	    c = (mandoc_command ? scan_troff_mandoc : scan_troff)(c,1,NULL);
276.1281 --	    if (mode) out_html("</H3>\n");
276.1282 --	    else out_html("</H2>\n");
276.1283 -+
276.1284 -+		if (mode)
276.1285 -+			out_html("</h3>\n");
276.1286 -+		else
276.1287 -+			out_html("</h2>\n");
276.1288 -+
276.1289 - 	    curpos=0;
276.1290 - 	    break;
276.1291 - 	case V('T','S'):
276.1292 -@@ -2315,7 +2280,7 @@
276.1293 - 		    int skip=0;
276.1294 - 		    output_possible=1;
276.1295 - 		    printf(CONTENTTYPE DOCTYPE);
276.1296 --		    out_html("<HTML><HEAD><TITLE>Man page of ");
276.1297 -+		    out_html("<html><head>\n<meta charset=\"UTF-8\">\n<title>");
276.1298 - 		    scan_troff(wordlist[0], 0, &t);
276.1299 - 		    /* we need to remove all html tags */
276.1300 - 		    for (s=q=t; *s; s++) {
276.1301 -@@ -2324,11 +2289,14 @@
276.1302 - 		      else if (!skip) *q++ = *s;
276.1303 - 		    }
276.1304 - 		    *q = '\0';
276.1305 --		    out_html(t);
276.1306 -+		    char buff[256];
276.1307 -+		    sprintf(buff, _("Man page of %s"), t);
276.1308 -+		    out_html(buff);
276.1309 - 		    free(t);
276.1310 --		    out_html("</TITLE>\n</HEAD><BODY>\n<H1>");
276.1311 -+		    out_html("</title>\n<link rel=\"stylesheet\" href=\"?css\">\n</head><body>\n<header><h1>");
276.1312 - 		    scan_troff(wordlist[0], 0, NULL);
276.1313 --		    out_html("</H1>\nSection: ");
276.1314 -+		    out_html("</h1></header>\n<section>\n");
276.1315 -+		    out_html(_("Section: "));
276.1316 - 		    if (words>4)
276.1317 - 		    	scan_troff(wordlist[4], 0, NULL);
276.1318 - 		    else
276.1319 -@@ -2336,14 +2304,17 @@
276.1320 - 		    out_html(" (");
276.1321 - 		    scan_troff(wordlist[1], 0, NULL);
276.1322 - 		    if (words>2) {
276.1323 --			out_html(")<BR>Updated: ");
276.1324 -+			out_html(")<br>");
276.1325 -+			out_html(_("Updated: "));
276.1326 - 			scan_troff(wordlist[2], 1, NULL);
276.1327 - 		    } else out_html(")");
276.1328 --		    out_html("<BR><A HREF=\"#index\">Index</A>\n");
276.1329 -+		    out_html("<br><a href=\"#index\">");
276.1330 -+		    out_html(_("Index"));
276.1331 -+		    out_html("</a>\n");
276.1332 - 		    man_page_html(0,0);	/* Return to Main Contents */
276.1333 - 		    *sl='\n';
276.1334 --		    out_html("<HR>\n");
276.1335 --		    if (mandoc_command) out_html("<BR>BSD mandoc<BR>");
276.1336 -+		    out_html("<hr>\n");
276.1337 -+		    if (mandoc_command) out_html("<br>\nBSD mandoc<br>");
276.1338 - 		}
276.1339 - 		c = sl+1;
276.1340 - 	    } else
276.1341 -@@ -2507,7 +2478,7 @@
276.1342 - 		 dl_newlevel_type(DL);
276.1343 - 	    if (nl)
276.1344 - 		 *nl = t;
276.1345 --	    if (fillout) out_html("<P>\n"); else {
276.1346 -+	    if (fillout) out_html("<p>\n"); else {
276.1347 - 		 out_html(NEWLINE);
276.1348 - 		 NEWLINE[0]='\n';
276.1349 - 	    }
276.1350 -@@ -2518,7 +2489,7 @@
276.1351 - 	case V('E','l'):	/* BSD mandoc */
276.1352 - 	     c=c+j;
276.1353 - 	     dl_endlevel_type();
276.1354 --	     if (fillout) out_html("<P>\n"); else {
276.1355 -+	     if (fillout) out_html("<p>\n"); else {
276.1356 - 		  out_html(NEWLINE);
276.1357 - 		  NEWLINE[0]='\n';
276.1358 - 	     }
276.1359 -@@ -2528,7 +2499,7 @@
276.1360 - 	case V('I','t'):	/* BSD mandoc */
276.1361 - 	     c=c+j;
276.1362 - 	     if (dl_type(DL)) {
276.1363 --		  out_html("<DT>");
276.1364 -+		  out_html("<dt>");
276.1365 - 		  out_html(change_to_font('B'));
276.1366 - 		  if (*c == '\n') {
276.1367 - 		       /* Don't allow embedded comms after a newline */
276.1368 -@@ -2543,9 +2514,9 @@
276.1369 - 		  if (inXo)
276.1370 - 		       still_dd = 1;
276.1371 - 		  else
276.1372 --		       out_html("<DD>");
276.1373 -+		       out_html("<dd>");
276.1374 - 	     } else if (dl_type(UL) || dl_type(OL)) {
276.1375 --		  out_html("<LI>");
276.1376 -+		  out_html("<li>");
276.1377 - 		  c=scan_troff_mandoc(c,1,NULL);
276.1378 - 		  out_html(NEWLINE);
276.1379 - 	     }
276.1380 -@@ -2559,7 +2530,7 @@
276.1381 - 	     c=c+j;
276.1382 - 	     if (inXo) {
276.1383 - 		  if (still_dd)
276.1384 --		       out_html("<DD>");
276.1385 -+		       out_html("<dd>");
276.1386 - 		  inXo = 0;
276.1387 - 	     }
276.1388 - 	     break;
276.1389 -@@ -2594,12 +2565,12 @@
276.1390 - 	case V('D','l'):	/* BSD mandoc */
276.1391 - 	     c=c+j;
276.1392 - 	     out_html(NEWLINE);
276.1393 --	     out_html("<BLOCKQUOTE>");	    
276.1394 -+	     out_html("<blockquote>");	    
276.1395 - 	     out_html(change_to_font('L'));
276.1396 - 	     if (*c == '\n') c++;
276.1397 - 	     c=scan_troff_mandoc(c, 1, NULL);	    
276.1398 - 	     out_html(change_to_font('R'));
276.1399 --	     out_html("</BLOCKQUOTE>");	    
276.1400 -+	     out_html("</blockquote>");	    
276.1401 - 	     if (fillout) curpos++; else curpos=0;
276.1402 - 	     break;
276.1403 - 	case V('B','d'):	/* BSD mandoc */
276.1404 -@@ -2615,14 +2586,14 @@
276.1405 - 	     mandoc_bd_options = 0; /* Remember options for terminating Bl */
276.1406 - 	     if (strstr(c, "-offset indent")) {
276.1407 - 		  mandoc_bd_options |= BD_INDENT;
276.1408 --		  out_html("<BLOCKQUOTE>\n");
276.1409 -+		  out_html("<blockquote>\n");
276.1410 - 	     }
276.1411 - 	     if (strstr(c, "-literal") || strstr(c, "-unfilled")) {
276.1412 - 		  if (fillout) {
276.1413 - 		       mandoc_bd_options |= BD_LITERAL;
276.1414 - 		       out_html(change_to_font(0));
276.1415 - 		       out_html(change_to_size('0'));
276.1416 --		       out_html("<PRE>\n");
276.1417 -+		       out_html("<pre>\n");
276.1418 - 		  }
276.1419 - 		  curpos=0;
276.1420 - 		  fillout=0;
276.1421 -@@ -2637,18 +2608,18 @@
276.1422 - 		  if (!fillout) {
276.1423 - 		       out_html(change_to_font(0));
276.1424 - 		       out_html(change_to_size('0'));
276.1425 --		       out_html("</PRE>\n");
276.1426 -+		       out_html("</pre>\n");
276.1427 - 		  }
276.1428 - 	     }
276.1429 - 	     if (mandoc_bd_options & BD_INDENT)
276.1430 --		  out_html("</BLOCKQUOTE>\n");
276.1431 -+		  out_html("</blockquote>\n");
276.1432 - 	     curpos=0;
276.1433 - 	     fillout=1;
276.1434 - 	     c=skip_till_newline(c);
276.1435 - 	     break;
276.1436 - 	case V('B','e'):	/* BSD mandoc */
276.1437 - 	     c=c+j;
276.1438 --	     if (fillout) out_html("<P>"); else {
276.1439 -+	     if (fillout) out_html("<p>"); else {
276.1440 - 		  out_html(NEWLINE);
276.1441 - 		  NEWLINE[0]='\n';
276.1442 - 	     }
276.1443 -@@ -2715,7 +2686,7 @@
276.1444 - 	     if (fillout) curpos++; else curpos=0;
276.1445 - 	     break;
276.1446 - 	case V('P','p'):	/* BSD mandoc */
276.1447 --	     if (fillout) out_html("<P>\n"); else {
276.1448 -+	     if (fillout) out_html("<p>\n"); else {
276.1449 - 		  out_html(NEWLINE);
276.1450 - 		  NEWLINE[0]='\n';
276.1451 - 	     }
276.1452 -@@ -2726,9 +2697,9 @@
276.1453 - 	     trans_char(c,'"','\a');
276.1454 - 	     c=c+j;
276.1455 - 	     if (*c == '\n') c++;
276.1456 --	     out_html("``");
276.1457 -+	     out_html("“");
276.1458 - 	     c=scan_troff_mandoc(c, 1, NULL);
276.1459 --	     out_html("''");
276.1460 -+	     out_html("”");
276.1461 - 	     out_html(NEWLINE);
276.1462 - 	     if (fillout) curpos++; else curpos=0;
276.1463 - 	     break;
276.1464 -@@ -2800,12 +2771,22 @@
276.1465 - 	     trans_char(c,'"','\a');
276.1466 - 	     c=c+j;
276.1467 - 	     if (*c == '\n') c++;
276.1468 --	     out_html("`");
276.1469 -+	     out_html("‘");
276.1470 - 	     c=scan_troff_mandoc(c, 1, NULL);
276.1471 --	     out_html("'");
276.1472 -+	     out_html("’");
276.1473 - 	     out_html(NEWLINE);
276.1474 - 	     if (fillout) curpos++; else curpos=0;
276.1475 - 	     break;
276.1476 -+	case V('A','q'):	/* BSD mandoc */
276.1477 -+	     trans_char(c,'"','\a');
276.1478 -+	     c=c+j;
276.1479 -+	     if (*c == '\n') c++;
276.1480 -+	     out_html("⟨");
276.1481 -+	     c=scan_troff_mandoc(c, 1, NULL);
276.1482 -+	     out_html("⟩");
276.1483 -+	     out_html(NEWLINE);
276.1484 -+	     if (fillout) curpos++; else curpos=0;
276.1485 -+	     break;
276.1486 - 	case V('A','r'):	/* BSD mandoc */
276.1487 - 	     /* parse one line in italics */
276.1488 - 	     out_html(change_to_font('I'));
276.1489 -@@ -2855,7 +2836,7 @@
276.1490 - 		   */
276.1491 - 		  static int count = 0; /* Don't break on the first Nm */
276.1492 - 		  if (count) {
276.1493 --		       out_html("<BR>");
276.1494 -+		       out_html("<br>");
276.1495 - 		  } else {
276.1496 - 		       char *end, t=0 /* just for gcc */;
276.1497 - 		       end = strchr(c, '\n');
276.1498 -@@ -3038,7 +3019,7 @@
276.1499 - 	    if (h[-1] == '\n' && still_dd && isalnum(*h)) {
276.1500 - 		/* sometimes a .HP request is not followed by a .br request */
276.1501 - 		FLUSHIBP;
276.1502 --		out_html("<DD>");
276.1503 -+		out_html("<dd>");
276.1504 - 		curpos=0;
276.1505 - 		still_dd=0;
276.1506 - 	    }
276.1507 -@@ -3108,12 +3089,12 @@
276.1508 - 				curpos++;
276.1509 - 			    }
276.1510 - 			} else {
276.1511 --			    out_html("<TT>");
276.1512 -+			    out_html("<tt>");
276.1513 - 			    while (curpos < tabstops[curtab]) {
276.1514 - 				out_html("&nbsp;");
276.1515 - 				curpos++;
276.1516 - 			    }
276.1517 --			    out_html("</TT>");
276.1518 -+			    out_html("</tt>");
276.1519 - 			}
276.1520 - 		    }
276.1521 - 		}
276.1522 -@@ -3122,7 +3103,7 @@
276.1523 - 		if (*h == ' ' && (h[-1] == '\n' || usenbsp)) {
276.1524 - 		    FLUSHIBP;
276.1525 - 		    if (!usenbsp && fillout) {
276.1526 --			out_html("<BR>");
276.1527 -+			out_html("<br>");
276.1528 - 			curpos=0;
276.1529 - 		    }
276.1530 - 		    usenbsp=fillout;
276.1531 -@@ -3196,13 +3177,13 @@
276.1532 - 
276.1533 -      switch(status) {
276.1534 - 	case 403:
276.1535 --		printf("Status: 403 Forbidden\n");
276.1536 -+		printf("HTTP/1.1 403 Forbidden\n");
276.1537 - 		break;
276.1538 - 	case 404:
276.1539 --		printf("Status: 404 Not Found\n");
276.1540 -+		printf("HTTP/1.1 404 Not Found\n");
276.1541 - 		break;
276.1542 - 	case 500:
276.1543 --		printf("Status: 500 Internal Server Error\n");
276.1544 -+		printf("HTTP/1.1 500 Internal Server Error\n");
276.1545 - 		break;
276.1546 - 	case 0:
276.1547 - 	default:
276.1548 -@@ -3210,12 +3191,13 @@
276.1549 -      }
276.1550 - 	     
276.1551 -      printf(CONTENTTYPE DOCTYPE);
276.1552 --     printf("<HTML><HEAD><TITLE>%s</TITLE></HEAD>\n"
276.1553 --	    "<BODY>\n<H1>%s</H1>\n", s, s);
276.1554 -+     printf("<html>\n<head>\n<meta charset=\"UTF-8\">\n<title>%s</title>\n"
276.1555 -+     	"<link rel=\"stylesheet\" href=\"?css\">\n</head>\n"
276.1556 -+	    "<body>\n<header><h1>%s</h1></header>\n<section>\n", s, s);
276.1557 -      va_start(p, t);
276.1558 -      vfprintf(stdout, t, p);
276.1559 -      va_end(p);
276.1560 --     printf("</BODY></HTML>\n");
276.1561 -+     printf("</section>\n</body></html>\n");
276.1562 -      exit(0);
276.1563 - }
276.1564 - 
276.1565 -@@ -3223,8 +3205,8 @@
276.1566 - xstrdup(const char *s) {
276.1567 -      char *p = strdup(s);
276.1568 -      if (p == NULL)
276.1569 --	  error_page(500, "Out of memory",
276.1570 --			 "Sorry, out of memory, aborting...\n");
276.1571 -+	  error_page(500, _("Out of memory"),
276.1572 -+			_("Sorry, out of memory, aborting...\n"));
276.1573 -      return p;
276.1574 - }
276.1575 - 
276.1576 -@@ -3232,8 +3214,8 @@
276.1577 - xmalloc(size_t size) {
276.1578 -      void *p = malloc(size);
276.1579 -      if (p == NULL)
276.1580 --	  error_page(500, "Out of memory",
276.1581 --			 "Sorry, out of memory, aborting...\n");
276.1582 -+	  error_page(500, _("Out of memory"),
276.1583 -+			_("Sorry, out of memory, aborting...\n"));
276.1584 -      return p;
276.1585 - }
276.1586 - 
276.1587 -@@ -3241,16 +3223,16 @@
276.1588 - xrealloc(void *ptr, size_t size) {
276.1589 -      void *p = realloc(ptr,size);
276.1590 -      if (p == NULL)
276.1591 --	  error_page(500, "Out of memory",
276.1592 --			 "Sorry, out of memory, aborting...\n");
276.1593 -+	  error_page(500, _("Out of memory"),
276.1594 -+			_("Sorry, out of memory, aborting...\n"));
276.1595 -      return p;
276.1596 - }
276.1597 - 
276.1598 - static void
276.1599 - usage(void) {
276.1600 --     error_page(500, "man2html: bad invocation",
276.1601 --	"Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n"
276.1602 --	"or:   man2html -r [filename]\n");
276.1603 -+     error_page(500, _("man2html: bad invocation"),
276.1604 -+	_("Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n"
276.1605 -+	"or:   man2html -r [filename]\n"));
276.1606 - }
276.1607 - 
276.1608 - static void
276.1609 -@@ -3273,7 +3255,7 @@
276.1610 - 	       }
276.1611 - #if 0
276.1612 - 	       else  /* complain or not - this need not be fatal */
276.1613 --		    error_page("Error", "man2html: could not chdir to %s", s);
276.1614 -+		    error_page(_("Error"), _("man2html: could not chdir to %s"), s);
276.1615 - #endif
276.1616 - 	  }
276.1617 -      }
276.1618 -@@ -3291,6 +3273,11 @@
276.1619 -  */
276.1620 - int
276.1621 - main(int argc, char **argv) {
276.1622 -+	setlocale (LC_ALL, "");
276.1623 -+	bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale");
276.1624 -+	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
276.1625 -+	textdomain (GETTEXT_PACKAGE);
276.1626 -+
276.1627 -     int l, c;
276.1628 -     char *buf, *filename, *fnam = NULL;
276.1629 - 
276.1630 -@@ -3309,7 +3296,7 @@
276.1631 - 	 case 'D':
276.1632 - 	      goto_dir(optarg, 0, 0); break;
276.1633 - 	 case 'E':
276.1634 --	      error_page(0, "Error", "%s", optarg); break;
276.1635 -+	      error_page(0, _("Error"), "%s", optarg); break;
276.1636 - 	 case 'h':
276.1637 - 	      set_cgibase("localhost"); break;
276.1638 - 	 case 'H':
276.1639 -@@ -3362,7 +3349,7 @@
276.1640 - 
276.1641 -     l = read_manpage_into_buffer(fnam, &buf);
276.1642 -     if (l < 0)
276.1643 --    	error_page(404, "File not found", "Could not open %s\n", fname);
276.1644 -+    	error_page(404, _("File not found"), _("Could not open %s\n"), fname);
276.1645 - 
276.1646 -     buf[0] = '\n';
276.1647 -     buf[l+1] = '\n';
276.1648 -@@ -3379,34 +3366,34 @@
276.1649 -     out_html(change_to_size(0));
276.1650 -     if (!fillout) {
276.1651 - 	fillout=1;
276.1652 --	out_html("</PRE>");
276.1653 -+	out_html("</pre>");
276.1654 -     }
276.1655 -     out_html(NEWLINE);
276.1656 -     if (output_possible) {
276.1657 - 	/* &nbsp; for mosaic users */
276.1658 - 	if (manidx) {
276.1659 --	    printf("<HR>\n<A NAME=\"index\">&nbsp;</A><H2>Index</H2>\n<DL>\n");
276.1660 -+	    printf("</section>\n\n<section id=\"index\">\n<h2>%s</h2>\n\n<dl>\n", _("Index"));
276.1661 - 	    manidx[mip]=0;
276.1662 - 	    printf("%s", manidx);
276.1663 --	    if (subs) printf("</DL>\n");
276.1664 --	    printf("</DL>\n");
276.1665 -+	    if (subs) printf("</dl>\n");
276.1666 -+	    printf("</dl>\n");
276.1667 - 	}
276.1668 - 	print_sig();
276.1669 --	printf("</BODY>\n</HTML>\n");
276.1670 -+	printf("</body>\n</html>\n");
276.1671 -     } else {
276.1672 - 	if (!filename)
276.1673 - 	     filename = fname;
276.1674 - 	if (*filename == '/')
276.1675 --	     error_page(403, "Invalid Man Page",
276.1676 --		   "The requested file %s is not a valid (unformatted) "
276.1677 -+	     error_page(403, _("Invalid Man Page"),
276.1678 -+		 _("The requested file %s is not a valid (unformatted) "
276.1679 - 		   "man page.\nIf the file is a formatted man page, "
276.1680 - 		   "you could try to load the\n"
276.1681 --		   "<A HREF=\"file://%s\">plain file</A>.\n",
276.1682 -+		   "<a href=\"file://%s\">plain file</a>.\n"),
276.1683 - 		   filename, filename);
276.1684 - 	else
276.1685 --	     error_page(403, "Invalid Man Page",
276.1686 --		   "The requested file %s is not a valid (unformatted) "
276.1687 --		   "man page.", filename);
276.1688 -+	     error_page(403, _("Invalid Man Page"),
276.1689 -+		 _("The requested file %s is not a valid (unformatted) "
276.1690 -+		   "man page."), filename);
276.1691 -     }
276.1692 -     if (idxfile)
276.1693 - 	 fclose(idxfile);
276.1694 ---- a/scripts/cgi-bin/man/man2html
276.1695 -+++ b/scripts/cgi-bin/man/man2html
276.1696 -@@ -8,11 +8,11 @@
276.1697 - 
276.1698 - # Do we need lynxcgi URLs? For the moment our criterion is
276.1699 - # 1) HTTP_USER_AGENT=Lynx*  and 2) HTTP_HOST is unset.
276.1700 --AGENT="${HTTP_USER_AGENT-unknown}"
276.1701 -+AGENT="${HTTP_USER_AGENT:-unknown}"
276.1702 - 
276.1703 - case "$AGENT" in
276.1704 -     Lynx*|lynx*)
276.1705 --	HH="${HTTP_HOST-nohh}"
276.1706 -+	HH="${HTTP_HOST:-nohh}"
276.1707 - 	SED="s/%lynx //"
276.1708 - 	;;
276.1709 -     *)
276.1710 -@@ -21,7 +21,7 @@
276.1711 - 	;;
276.1712 - esac
276.1713 - 
276.1714 --SERVER="${SERVER_NAME-localhost}"
276.1715 -+SERVER="${SERVER_NAME:-localhost}"
276.1716 - case "$HH" in
276.1717 -     nohh)
276.1718 - 	LL="-l"
276.1719 ---- a/scripts/cgi-bin/man/mansearch
276.1720 -+++ b/scripts/cgi-bin/man/mansearch
276.1721 -@@ -7,11 +7,11 @@
276.1722 - 
276.1723 - # Do we need lynxcgi URLs? For the moment our criterion is
276.1724 - # 1) HTTP_USER_AGENT=Lynx*  and 2) HTTP_HOST is unset.
276.1725 --AGENT="${HTTP_USER_AGENT-unknown}"
276.1726 -+AGENT="${HTTP_USER_AGENT:-unknown}"
276.1727 - 
276.1728 - case "$AGENT" in
276.1729 -     Lynx*|lynx*)
276.1730 --	HH="${HTTP_HOST-nohh}"
276.1731 -+	HH="${HTTP_HOST:-nohh}"
276.1732 - 	SED="s/%lynx //"
276.1733 - 	;;
276.1734 -     *)
276.1735 -@@ -20,7 +20,7 @@
276.1736 - 	;;
276.1737 - esac
276.1738 - 
276.1739 --SERVER="${SERVER_NAME-localhost}"
276.1740 -+SERVER="${SERVER_NAME:-localhost}"
276.1741 - case "$HH" in
276.1742 -     nohh)
276.1743 - 	CG="lynxcgi:/usr/lib/cgi-bin/man"
276.1744 ---- a/scripts/cgi-bin/man/mansearchhelp
276.1745 -+++ b/scripts/cgi-bin/man/mansearchhelp
276.1746 -@@ -4,17 +4,17 @@
276.1747 - 
276.1748 - # Do we need lynxcgi URLs? For the moment our criterion is
276.1749 - # 1) HTTP_USER_AGENT=Lynx*  and 2) HTTP_HOST is unset.
276.1750 --AGENT="${HTTP_USER_AGENT-unknown}"
276.1751 -+AGENT="${HTTP_USER_AGENT:-unknown}"
276.1752 - case "$AGENT" in
276.1753 -     Lynx*|lynx*)
276.1754 --	HH="${HTTP_HOST-nohh}"
276.1755 -+	HH="${HTTP_HOST:-nohh}"
276.1756 - 	;;
276.1757 -     *)
276.1758 - 	HH=nolynx
276.1759 - 	;;
276.1760 - esac
276.1761 - 
276.1762 --SERVER="${SERVER_NAME-localhost}"
276.1763 -+SERVER="${SERVER_NAME:-localhost}"
276.1764 - case "$HH" in
276.1765 -     nohh)
276.1766 - 	CG="lynxcgi:/usr/lib/cgi-bin/man"
276.1767 ---- a/strdefs.c
276.1768 -+++ b/strdefs.c
276.1769 -@@ -27,266 +27,333 @@
276.1770 -     { V('.','V'), 1,     0, NULL }, /* the me package tests for this */
276.1771 -     { 0, 0, 0, NULL } };
276.1772 - 
276.1773 -+
276.1774 -+/* Characters written according to http://mdocml.bsd.lv/man/mandoc_char.7.html */
276.1775 -+
276.1776 - static STRDEF standardstring[] = {
276.1777 --    { V('<','='), 2, "&lt;=", NULL  }, /* less equal */
276.1778 --    { V('>','='), 2, "&gt=;", NULL  }, /* greather equal */
276.1779 --    { V('A','m'), 1, "&amp;", NULL  }, /* infinity */
276.1780 --    { V('B','a'), 1, "|", NULL  }, /* vartical bar */
276.1781 --    { V('G','e'), 2, "&gt=;", NULL  }, /* greather equal */
276.1782 --    { V('G','t'), 1, "&gt;", NULL  }, /* greather than */
276.1783 --    { V('I','f'), 1, "&infin;", NULL  }, /* infinity */
276.1784 --    { V('L','e'), 2, "&lt;=", NULL  }, /* less equal */
276.1785 --    { V('L','q'), 1, "&ldquo;", NULL  }, /* left double quote  */
276.1786 --    { V('L','t'), 1, "&lt;", NULL  }, /* less than */
276.1787 --    { V('N','a'), 3, "NaN", NULL  }, /* not a number */
276.1788 --    { V('N','e'), 2, "!=", NULL  }, /* not equal */
276.1789 --    { V('P','i'), 2, "Pi", NULL  }, /* pi */
276.1790 --    { V('P','m'), 1, "&plusmn;", NULL  }, /* plus minus */
276.1791 --    { V('R',' '), 1, "&#174;", NULL },
276.1792 --    { V('R','q'), 1, "&rdquo;", NULL  }, /* right double quote  */
276.1793 --    { V('a','a'), 1, "'", NULL  }, /* accute accent  */
276.1794 --    { V('g','a'), 1, "`", NULL  }, /* grave accent  */
276.1795 --    { V('l','q'), 2, "``", NULL },
276.1796 --    { V('q',' '), 1, "&quot;", NULL  }, /* straight double quote  */
276.1797 --    { V('r','q'), 2, "''", NULL },
276.1798 --    { V('u','a'), 1, "^", NULL  }, /* upwards arrow  */
276.1799 -+    { V('<','='), 1, "≤",        NULL },	/* less-than-equal */
276.1800 -+    { V('>','='), 1, "≥",        NULL },	/* greater-than-equal */
276.1801 -+    { V('A','i'), 4, "ANSI",     NULL },	/* ANSI standard name */
276.1802 -+    { V('A','m'), 1, "&amp;",    NULL },	/* ampersand */
276.1803 -+    { V('B','a'), 1, "|",        NULL },	/* vertical bar */
276.1804 -+    { V('G','e'), 1, "≥",        NULL },	/* greater-than-equal */
276.1805 -+    { V('G','t'), 1, "&gt;",     NULL },	/* greater-than */
276.1806 -+    { V('I','f'), 8, "infinity", NULL },	/* infinity */
276.1807 -+    { V('L','e'), 1, "≤",        NULL },	/* less-than-equal */
276.1808 -+    { V('L','q'), 1, "“",        NULL },	/* left-double-quote */
276.1809 -+    { V('L','t'), 1, "&lt;",     NULL },	/* less-than */
276.1810 -+    { V('N','a'), 3, "NaN",      NULL },	/* NaN  */
276.1811 -+    { V('N','e'), 1, "≠",        NULL },	/* not equal */
276.1812 -+    { V('P','i'), 2, "pi",       NULL },	/* pi */
276.1813 -+    { V('P','m'), 1, "±",        NULL },	/* plus-minus */
276.1814 -+    { V('P','x'), 5, "POSIX",    NULL },	/* POSIX standard name */
276.1815 -+    { V('R',' '), 1, "®",        NULL },	/* restricted mark */
276.1816 -+    { V('R','q'), 1, "”",        NULL },	/* right-double-quote */
276.1817 -+    { V('T','m'), 4, "(Tm)",     NULL },	/* trade mark */
276.1818 -+    { V('a','a'), 1, "´",        NULL },	/* acute */
276.1819 -+    { V('g','a'), 1, "`",        NULL },	/* grave */
276.1820 -+    { V('l','p'), 1, "(",        NULL },	/* left-parenthesis */
276.1821 -+    { V('l','q'), 1, "“",        NULL },	/* left double-quote */
276.1822 -+    { V('q',' '), 1, "&quot;",   NULL },	/* double-quote */
276.1823 -+    { V('r','p'), 1, ")",        NULL },	/* right-parenthesis */
276.1824 -+    { V('r','q'), 1, "”",        NULL },	/* right double-quote */
276.1825 -+    { V('u','a'), 1, "↑",        NULL },	/* up-arrow */
276.1826 -+    { V('v','a'), 1, "↕",        NULL },	/* up-down arrow */
276.1827 -     { 0, 0, NULL, NULL}
276.1828 - };
276.1829 - 
276.1830 - static STRDEF standardchar[] = {
276.1831 --    { V('*','*'), 1, "*", NULL  },	/* math star */
276.1832 --    { V('*','A'), 1, "&Alpha;", NULL },
276.1833 --    { V('*','B'), 1, "&Beta;", NULL },
276.1834 --    { V('*','C'), 1, "&Xi;", NULL },
276.1835 --    { V('*','D'), 1, "&Delta;", NULL },
276.1836 --    { V('*','E'), 1, "&Epsilon;", NULL },
276.1837 --    { V('*','F'), 1, "&Phi;", NULL },
276.1838 --    { V('*','G'), 1, "&Gamma;", NULL },
276.1839 --    { V('*','H'), 1, "&Theta;", NULL },
276.1840 --    { V('*','I'), 1, "&Iota;", NULL },
276.1841 --    { V('*','K'), 1, "&Kappa;", NULL },
276.1842 --    { V('*','L'), 1, "&Lambda;", NULL },
276.1843 --    { V('*','M'), 1, "&Mu;", NULL },
276.1844 --    { V('*','N'), 1, "&Nu;", NULL },
276.1845 --    { V('*','O'), 1, "&Omicron;", NULL },
276.1846 --    { V('*','P'), 1, "&Pi;", NULL },
276.1847 --    { V('*','Q'), 1, "&Psi;", NULL },
276.1848 --    { V('*','R'), 1, "&Rho;", NULL },
276.1849 --    { V('*','S'), 1, "&Sigma;", NULL },
276.1850 --    { V('*','T'), 1, "&Tau;", NULL },
276.1851 --    { V('*','U'), 1, "&Upsilon;", NULL },
276.1852 --    { V('*','W'), 1, "&Omega;", NULL },
276.1853 --    { V('*','X'), 1, "&Chi;", NULL },
276.1854 --    { V('*','Y'), 1, "&Eta;", NULL },
276.1855 --    { V('*','Z'), 1, "&Zeta;", NULL },
276.1856 --    { V('*','a'), 1, "&alpha;", NULL },
276.1857 --    { V('*','b'), 1, "&beta;", NULL },
276.1858 --    { V('*','c'), 1, "&xi;", NULL },
276.1859 --    { V('*','d'), 1, "&delta;", NULL },
276.1860 --    { V('*','e'), 1, "&epsilon;", NULL },
276.1861 --    { V('*','f'), 1, "&phi;", NULL },
276.1862 --    { V('*','g'), 1, "&gamma;", NULL },
276.1863 --    { V('*','h'), 1, "&theta;", NULL },
276.1864 --    { V('*','i'), 1, "&iota;", NULL },
276.1865 --    { V('*','k'), 1, "&kappa;", NULL },
276.1866 --    { V('*','l'), 1, "&lambda;", NULL },
276.1867 --    { V('*','m'), 1, "&mu;", NULL },
276.1868 --    { V('*','n'), 1, "&nu;", NULL },
276.1869 --    { V('*','o'), 1, "&omicron;", NULL },
276.1870 --    { V('*','p'), 1, "&pi;", NULL },
276.1871 --    { V('*','q'), 1, "&psi;", NULL },
276.1872 --    { V('*','r'), 1, "&rho;", NULL },
276.1873 --    { V('*','s'), 1, "&sigma;", NULL },
276.1874 --    { V('*','t'), 1, "&tau;", NULL },
276.1875 --    { V('*','u'), 1, "&upsilon;", NULL },
276.1876 --    { V('*','w'), 1, "&omega;", NULL },
276.1877 --    { V('*','x'), 1, "&chi;", NULL },
276.1878 --    { V('*','y'), 1, "&eta;", NULL },
276.1879 --    { V('*','z'), 1, "&zeta;", NULL },
276.1880 --    { V('\'','A'), 1, "&Aacute;", NULL },
276.1881 --    { V('\'','E'), 1, "&Eacute;", NULL },
276.1882 --    { V('\'','I'), 1, "&Iacute;", NULL },
276.1883 --    { V('\'','O'), 1, "&Oacute;", NULL },
276.1884 --    { V('\'','U'), 1, "&Uacute;", NULL },
276.1885 --    { V('\'','Y'), 1, "&Yacute;", NULL },
276.1886 --    { V('\'','a'), 1, "&aacute;", NULL },
276.1887 --    { V('\'','e'), 1, "&eacute;", NULL },
276.1888 --    { V('\'','i'), 1, "&iacute;", NULL },
276.1889 --    { V('\'','o'), 1, "&oacute;", NULL },
276.1890 --    { V('\'','u'), 1, "&uacute;", NULL },
276.1891 --    { V('\'','y'), 1, "&yacute;", NULL },
276.1892 --    { V('!','='), 1, "&ne;", NULL },
276.1893 --    { V('%','0'), 1, "&permil;", NULL },
276.1894 --    { V('+','-'), 1, "&plusmn;", NULL },
276.1895 --    { V(',','C'), 1, "&Ccedil;", NULL },
276.1896 --    { V(',','c'), 1, "&ccedil;", NULL },
276.1897 --    { V('-','>'), 1, "&rarr;", NULL },
276.1898 --    { V('-','D'), 1, "&ETH;", NULL },
276.1899 --    { V('.','i'), 1, "&#x131;", NULL },
276.1900 --    { V('/','L'), 1, "&#x141;", NULL },
276.1901 --    { V('/','O'), 1, "&Oslash;", NULL },
276.1902 --    { V('/','l'), 1, "&#x142;", NULL },
276.1903 --    { V('/','o'), 1, "&oslash;", NULL },
276.1904 --    { V('1','2'), 1, "&#189;", NULL  },
276.1905 --    { V('1','4'), 1, "&#188;", NULL  },
276.1906 --    { V('3','4'), 1, "&#190;", NULL  },
276.1907 --    { V(':','A'), 1, "&Auml;", NULL },
276.1908 --    { V(':','E'), 1, "&Euml;", NULL },
276.1909 --    { V(':','I'), 1, "&Iuml;", NULL },
276.1910 --    { V(':','O'), 1, "&Ouml;", NULL },
276.1911 --    { V(':','U'), 1, "&Uuml;", NULL },
276.1912 --    { V(':','a'), 1, "&auml;", NULL },
276.1913 --    { V(':','e'), 1, "&euml;", NULL },
276.1914 --    { V(':','i'), 1, "&iuml;", NULL },
276.1915 --    { V(':','o'), 1, "&ouml;", NULL },
276.1916 --    { V(':','u'), 1, "&uuml;", NULL },
276.1917 --    { V(':','y'), 1, "&yuml;", NULL },
276.1918 --    { V('<','-'), 1, "&larr;", NULL },
276.1919 --    { V('<','='), 1, "&le;", NULL },
276.1920 --    { V('<','>'), 1, "&harr;", NULL },
276.1921 --    { V('=','='), 1, "&equiv;", NULL },
276.1922 --    { V('=','~'), 1, "&cong;", NULL },
276.1923 --    { V('>','='), 1, "&ge;", NULL },
276.1924 --    { V('A','E'), 1, "&AElig;", NULL },
276.1925 --    { V('A','h'), 1, "&alepfsym;", NULL },
276.1926 --    { V('C','R'), 1, "&#x240d;", NULL },
276.1927 --    { V('C','s'), 1, "&curren;", NULL },
276.1928 --    { V('D','o'), 1, "$", NULL },
276.1929 --    { V('E','u'), 1, "&euro;", NULL },
276.1930 --    { V('F','c'), 1, "&raquo;", NULL  },
276.1931 --    { V('F','i'), 3, "ffi", NULL  },
276.1932 --    { V('F','l'), 3, "ffl", NULL  },
276.1933 --    { V('F','o'), 1, "&laquo;", NULL  },
276.1934 --    { V('O','E'), 1, "&OElig;", NULL },
276.1935 --    { V('P','o'), 1, "&pound;", NULL },
276.1936 --    { V('S','1'), 1, "&sup1;", NULL },
276.1937 --    { V('S','2'), 1, "&sup2;", NULL },
276.1938 --    { V('S','3'), 1, "&sup3;", NULL },
276.1939 --    { V('S','d'), 1, "&eth;", NULL },
276.1940 --    { V('T','P'), 1, "&THORN;", NULL },
276.1941 --    { V('T','p'), 1, "&thorn;", NULL },
276.1942 --    { V('Y','e'), 1, "&yen;", NULL },
276.1943 --    { V('^','A'), 1, "&Acirc;", NULL },
276.1944 --    { V('^','E'), 1, "&Ecirc;", NULL },
276.1945 --    { V('^','I'), 1, "&Icirc;", NULL },
276.1946 --    { V('^','O'), 1, "&Ocirc;", NULL },
276.1947 --    { V('^','U'), 1, "&Ucirc;", NULL },
276.1948 --    { V('^','a'), 1, "&acirc;", NULL },
276.1949 --    { V('^','e'), 1, "&ecirc;", NULL },
276.1950 --    { V('^','i'), 1, "&icirc;", NULL },
276.1951 --    { V('^','o'), 1, "&ocirc;", NULL },
276.1952 --    { V('^','u'), 1, "&ucirc;", NULL },
276.1953 --    { V('`','A'), 1, "&Agrave;", NULL },
276.1954 --    { V('`','E'), 1, "&Egrave;", NULL },
276.1955 --    { V('`','I'), 1, "&Igrave;", NULL },
276.1956 --    { V('`','O'), 1, "&Ograve;", NULL },
276.1957 --    { V('`','U'), 1, "&Ugrave;", NULL },
276.1958 --    { V('`','a'), 1, "&agrave;", NULL },
276.1959 --    { V('`','e'), 1, "&egrave;", NULL },
276.1960 --    { V('`','i'), 1, "&igrave;", NULL },
276.1961 --    { V('`','o'), 1, "&ograve;", NULL },
276.1962 --    { V('`','u'), 1, "&ugrave;", NULL },
276.1963 --    { V('a','a'), 1, "&acute;", NULL },
276.1964 --    { V('a','e'), 1, "&aelig;", NULL },
276.1965 --    { V('a','p'), 1, "&asymp;", NULL },
276.1966 --    { V('a','q'), 1, "'", NULL },
276.1967 --    { V('a','t'), 1, "@", NULL },
276.1968 --    { V('a','~'), 1, "~", NULL },
276.1969 --    { V('b','a'), 1, "|", NULL },
276.1970 --    { V('b','b'), 1, "|", NULL },
276.1971 --    { V('b','r'), 1, "|", NULL  },
276.1972 --    { V('b','r'), 1, "|", NULL },
276.1973 --    { V('b','u'), 1, "&bull;", NULL },
276.1974 --    { V('b','v'), 1, "|", NULL  },
276.1975 --    { V('c','*'), 1, "&otimes;", NULL },
276.1976 --    { V('c','+'), 1, "&oplus;", NULL },
276.1977 --    { V('c','i'), 1, "&#x25cb;", NULL },
276.1978 --    { V('c','o'), 1, "&#169;", NULL  },
276.1979 --    { V('c','q'), 1, "'", NULL },
276.1980 --    { V('c','t'), 1, "&#162;", NULL  },
276.1981 --    { V('d','A'), 1, "&dArr;", NULL },
276.1982 --    { V('d','a'), 1, "&darr;", NULL },
276.1983 --    { V('d','d'), 1, "=", NULL },
276.1984 --    { V('d','e'), 1, "&#176;", NULL  },
276.1985 --    { V('d','g'), 1, "-", NULL },
276.1986 --    { V('d','i'), 1, "&#247;", NULL  },
276.1987 --    { V('d','q'), 1, "&quot;", NULL  },
276.1988 --    { V('e','m'), 3, "---", NULL  }, 	/* em dash */
276.1989 --    { V('e','n'), 1, "-", NULL }, 	/* en dash */
276.1990 --    { V('e','q'), 1, "=", NULL },
276.1991 --    { V('e','s'), 1, "&#216;", NULL  },
276.1992 --    { V('e','u'), 1, "&euro;", NULL },
276.1993 --    { V('f','/'), 1, "&frasl;", NULL },
276.1994 --    { V('f','c'), 1, "&rsaquo;", NULL  },
276.1995 --    { V('f','f'), 2, "ff", NULL  },
276.1996 --    { V('f','i'), 2, "fi", NULL  },
276.1997 --    { V('f','l'), 2, "fl", NULL  },
276.1998 --    { V('f','m'), 1, "&#180;", NULL  },
276.1999 --    { V('f','o'), 1, "&lsaquo;", NULL  },
276.2000 --    { V('g','a'), 1, "`", NULL  },
276.2001 --    { V('h','A'), 1, "&hArr;", NULL },
276.2002 --    { V('h','y'), 1, "-", NULL  },
276.2003 --    { V('i','f'), 1, "&infin;", NULL },
276.2004 --    { V('i','s'), 8, "Integral", NULL }, /* integral sign */
276.2005 --    { V('l','A'), 1, "&lArr;", NULL },
276.2006 --    { V('l','B'), 1, "[", NULL },
276.2007 --    { V('l','C'), 1, "{", NULL },
276.2008 --    { V('l','a'), 1, "&lt;", NULL },
276.2009 --    { V('l','b'), 1, "[", NULL  },
276.2010 --    { V('l','c'), 2, "|&#175;", NULL  },
276.2011 --    { V('l','f'), 2, "|_", NULL  },
276.2012 --    { V('l','h'), 1, "&#x261a;", NULL },
276.2013 --    { V('l','k'), 1, "<FONT SIZE=\"+2\">{</FONT>", NULL  },
276.2014 --    { V('l','q'), 1, "\"", NULL },
276.2015 --    { V('l','z'), 1, "&loz;", NULL },
276.2016 --    { V('m','c'), 1, "&micro;", NULL },
276.2017 --    { V('m','i'), 1, "-", NULL  },
276.2018 --    { V('m','u'), 1, "&#215;", NULL  },
276.2019 --    { V('n','o'), 1, "&#172;", NULL  },
276.2020 --    { V('o','A'), 1, "&Aring;", NULL },
276.2021 --    { V('o','a'), 1, "&aring;", NULL },
276.2022 --    { V('o','e'), 1, "&oelig;", NULL },
276.2023 --    { V('o','q'), 1, "'", NULL },
276.2024 --    { V('o','r'), 1, "|", NULL },
276.2025 --    { V('p','d'), 1, "d", NULL }, 	/* partial derivative */
276.2026 --    { V('p','l'), 1, "+", NULL },
276.2027 --    { V('p','s'), 1, "&para;", NULL },
276.2028 --    { V('r','!'), 1, "&iexcl;", NULL },
276.2029 --    { V('r','?'), 1, "&iquest;", NULL },
276.2030 --    { V('r','A'), 1, "&rArr;", NULL },
276.2031 --    { V('r','B'), 1, "]", NULL },
276.2032 --    { V('r','C'), 1, "}", NULL },
276.2033 --    { V('r','a'), 1, "&gt;", NULL },
276.2034 --    { V('r','c'), 2, "&#175;|", NULL  },
276.2035 --    { V('r','f'), 2, "_|", NULL  },
276.2036 --    { V('r','g'), 1, "&#174;", NULL  },
276.2037 --    { V('r','h'), 1, "&#x261b;", NULL },
276.2038 --    { V('r','k'), 1, "<FONT SIZE=\"+2\">}</FONT>", NULL  },
276.2039 --    { V('r','n'), 1, "&#175;", NULL  },
276.2040 --    { V('r','q'), 1, "\"", NULL },
276.2041 --    { V('r','s'), 1, "\\", NULL },
276.2042 --    { V('r','u'), 1, "_", NULL },
276.2043 --    { V('s','c'), 1, "&#167;", NULL  },
276.2044 --    { V('s','h'), 1, "#", NULL },
276.2045 --    { V('s','l'), 1, "/", NULL },
276.2046 --    { V('s','q'), 1, "&#x25a1;", NULL },
276.2047 --    { V('s','s'), 1, "&szlig;", NULL },
276.2048 --    { V('t','f'), 1, "&there4;", NULL },
276.2049 --    { V('t','i'), 1, "~", NULL },
276.2050 --    { V('t','m'), 1, "&trade;", NULL },
276.2051 --    { V('t','s'), 1, "s", NULL }, 	/* should be terminal sigma */
276.2052 --    { V('u','A'), 1, "&uArr;", NULL },
276.2053 --    { V('u','a'), 1, "&uarr;", NULL },
276.2054 --    { V('u','l'), 1, "_", NULL },
276.2055 --    { V('~','A'), 1, "&Atilde;", NULL },
276.2056 --    { V('~','N'), 1, "&Ntilde;", NULL },
276.2057 --    { V('~','O'), 1, "&Otilde;", NULL },
276.2058 --    { V('~','a'), 1, "&atilde;", NULL },
276.2059 --    { V('~','n'), 1, "&ntilde;", NULL },
276.2060 --    { V('~','o'), 1, "&otilde;", NULL },
276.2061 -+    { V('*','*'), 1, "∗", NULL },	/* asterisk */
276.2062 -+    { V('*','A'), 1, "Α", NULL },	/* Alpha */
276.2063 -+    { V('*','B'), 1, "Β", NULL },	/* Beta */
276.2064 -+    { V('*','C'), 1, "Ξ", NULL },	/* Xi */
276.2065 -+    { V('*','D'), 1, "Δ", NULL },	/* Delta */
276.2066 -+    { V('*','E'), 1, "Ε", NULL },	/* Epsilon */
276.2067 -+    { V('*','F'), 1, "Φ", NULL },	/* Phi */
276.2068 -+    { V('*','G'), 1, "Γ", NULL },	/* Gamma */
276.2069 -+    { V('*','H'), 1, "Θ", NULL },	/* Theta */
276.2070 -+    { V('*','I'), 1, "Ι", NULL },	/* Iota */
276.2071 -+    { V('*','K'), 1, "Κ", NULL },	/* Kappa */
276.2072 -+    { V('*','L'), 1, "Λ", NULL },	/* Lambda */
276.2073 -+    { V('*','M'), 1, "Μ", NULL },	/* Mu */
276.2074 -+    { V('*','N'), 1, "Ν", NULL },	/* Nu */
276.2075 -+    { V('*','O'), 1, "Ο", NULL },	/* Omicron */
276.2076 -+    { V('*','P'), 1, "Π", NULL },	/* Pi */
276.2077 -+    { V('*','Q'), 1, "Ψ", NULL },	/* Psi */
276.2078 -+    { V('*','R'), 1, "Ρ", NULL },	/* Rho */
276.2079 -+    { V('*','S'), 1, "Σ", NULL },	/* Sigma */
276.2080 -+    { V('*','T'), 1, "Τ", NULL },	/* Tau */
276.2081 -+    { V('*','U'), 1, "Υ", NULL },	/* Upsilon */
276.2082 -+    { V('*','W'), 1, "Ω", NULL },	/* Omega */
276.2083 -+    { V('*','X'), 1, "Χ", NULL },	/* Chi */
276.2084 -+    { V('*','Y'), 1, "Η", NULL },	/* Eta */
276.2085 -+    { V('*','Z'), 1, "Ζ", NULL },	/* Zeta */
276.2086 -+    { V('*','a'), 1, "α", NULL },	/* alpha */
276.2087 -+    { V('*','b'), 1, "β", NULL },	/* beta */
276.2088 -+    { V('*','c'), 1, "ξ", NULL },	/* xi */
276.2089 -+    { V('*','d'), 1, "δ", NULL },	/* delta */
276.2090 -+    { V('*','e'), 1, "ε", NULL },	/* epsilon */
276.2091 -+    { V('*','f'), 1, "φ", NULL },	/* phi */
276.2092 -+    { V('*','g'), 1, "γ", NULL },	/* gamma */
276.2093 -+    { V('*','h'), 1, "θ", NULL },	/* theta */
276.2094 -+    { V('*','i'), 1, "ι", NULL },	/* iota */
276.2095 -+    { V('*','k'), 1, "κ", NULL },	/* kappa */
276.2096 -+    { V('*','l'), 1, "λ", NULL },	/* lambda */
276.2097 -+    { V('*','m'), 1, "μ", NULL },	/* mu */
276.2098 -+    { V('*','n'), 1, "ν", NULL },	/* nu */
276.2099 -+    { V('*','o'), 1, "ο", NULL },	/* omicron */
276.2100 -+    { V('*','p'), 1, "π", NULL },	/* pi */
276.2101 -+    { V('*','q'), 1, "ψ", NULL },	/* psi */
276.2102 -+    { V('*','r'), 1, "ρ", NULL },	/* rho */
276.2103 -+    { V('*','s'), 1, "σ", NULL },	/* sigma */
276.2104 -+    { V('*','t'), 1, "τ", NULL },	/* tau */
276.2105 -+    { V('*','u'), 1, "υ", NULL },	/* upsilon */
276.2106 -+    { V('*','w'), 1, "ω", NULL },	/* omega */
276.2107 -+    { V('*','x'), 1, "χ", NULL },	/* chi */
276.2108 -+    { V('*','y'), 1, "η", NULL },	/* eta */
276.2109 -+    { V('*','z'), 1, "ζ", NULL },	/* zeta */
276.2110 -+    { V('\'','A'), 1, "Á", NULL },	/* acute A */
276.2111 -+    { V('\'','E'), 1, "É", NULL },	/* acute E */
276.2112 -+    { V('\'','I'), 1, "Í", NULL },	/* acute I */
276.2113 -+    { V('\'','O'), 1, "Ó", NULL },	/* acute O */
276.2114 -+    { V('\'','U'), 1, "Ú", NULL },	/* acute U */
276.2115 -+    { V('\'','Y'), 1, "Ý", NULL },	/* Yacute (*) */
276.2116 -+    { V('\'','a'), 1, "á", NULL },	/* acute a */
276.2117 -+    { V('\'','e'), 1, "é", NULL },	/* acute e */
276.2118 -+    { V('\'','i'), 1, "í", NULL },	/* acute i */
276.2119 -+    { V('\'','o'), 1, "ó", NULL },	/* acute o */
276.2120 -+    { V('\'','u'), 1, "ú", NULL },	/* acute u */
276.2121 -+    { V('\'','y'), 1, "ý", NULL },	/* yacute (*) */
276.2122 -+    { V('!','='), 1, "≠", NULL },	/* not equal */
276.2123 -+    { V('%','0'), 1, "‰", NULL },	/* per-thousand */
276.2124 -+    { V('+','-'), 1, "±", NULL },	/* plus-minus */
276.2125 -+    { V('+','e'), 1, "ϵ", NULL },	/* epsilon variant */
276.2126 -+    { V('+','f'), 1, "φ", NULL },	/* phi variant */
276.2127 -+    { V('+','h'), 1, "ϑ", NULL },	/* theta variant */
276.2128 -+    { V('+','p'), 1, "ϖ", NULL },	/* pi variant */
276.2129 -+    { V(',','C'), 1, "Ç", NULL },	/* cedilla C */
276.2130 -+    { V(',','c'), 1, "ç", NULL },	/* cedilla c */
276.2131 -+    { V('-','+'), 1, "∓", NULL },	/* minus-plus */
276.2132 -+    { V('-','>'), 1, "→", NULL },	/* right arrow */
276.2133 -+    { V('-','D'), 1, "Ð", NULL },	/* Eth */
276.2134 -+    { V('-','h'), 1, "ℏ", NULL },	/* Planck constant over 2π */
276.2135 -+    { V('.','i'), 1, "ı", NULL },	/* dotless i */
276.2136 -+    { V('.','j'), 1, "ȷ", NULL },	/* dotless j */
276.2137 -+    { V('/','L'), 1, "Ł", NULL },	/* stroke L */
276.2138 -+    { V('/','O'), 1, "Ø", NULL },	/* stroke O */
276.2139 -+    { V('/','_'), 1, "∠", NULL },	/* angle */
276.2140 -+    { V('/','l'), 1, "ł", NULL },	/* stroke l */
276.2141 -+    { V('/','o'), 1, "ø", NULL },	/* stroke o */
276.2142 -+    { V('1','2'), 1, "½", NULL },	/* 1/2 (*) */
276.2143 -+    { V('1','4'), 1, "¼", NULL },	/* 1/4 (*) */
276.2144 -+    { V('3','4'), 1, "¾", NULL },	/* 3/4 (*) */
276.2145 -+    { V('3','d'), 1, "∴", NULL },	/* therefore */
276.2146 -+    { V(':','A'), 1, "Ä", NULL },	/* dieresis A */
276.2147 -+    { V(':','E'), 1, "Ë", NULL },	/* dieresis E */
276.2148 -+    { V(':','I'), 1, "Ï", NULL },	/* dieresis I */
276.2149 -+    { V(':','O'), 1, "Ö", NULL },	/* dieresis O */
276.2150 -+    { V(':','U'), 1, "Ü", NULL },	/* dieresis U */
276.2151 -+    { V(':','a'), 1, "ä", NULL },	/* dieresis a */
276.2152 -+    { V(':','e'), 1, "ë", NULL },	/* dieresis e */
276.2153 -+    { V(':','i'), 1, "ï", NULL },	/* dieresis i */
276.2154 -+    { V(':','o'), 1, "ö", NULL },	/* dieresis o */
276.2155 -+    { V(':','u'), 1, "ü", NULL },	/* dieresis u */
276.2156 -+    { V(':','y'), 1, "ÿ", NULL },	/* dieresis y */
276.2157 -+    { V('<','-'), 1, "←", NULL },	/* left arrow */
276.2158 -+    { V('<','<'), 1, "≪", NULL },	/* much less */
276.2159 -+    { V('<','='), 1, "≤", NULL },	/* less-than-equal */
276.2160 -+    { V('<','>'), 1, "↔", NULL },	/* left-right arrow */
276.2161 -+    { V('=','='), 1, "≡", NULL },	/* equivalent */
276.2162 -+    { V('=','~'), 1, "≅", NULL },	/* approximately equal */
276.2163 -+    { V('>','='), 1, "≥", NULL },	/* greater-than-equal */
276.2164 -+    { V('>','>'), 1, "≫", NULL },	/* much greater */
276.2165 -+    { V('A','E'), 1, "Æ", NULL },	/* AE ligature */
276.2166 -+    { V('A','N'), 1, "∧", NULL },	/* logical and */
276.2167 -+    { V('A','h'), 1, "ℵ", NULL },	/* aleph */
276.2168 -+    { V('B','q'), 1, "„", NULL },	/* right low double-quote */
276.2169 -+    { V('C','R'), 1, "↵", NULL },	/* carriage return */
276.2170 -+    { V('C','s'), 1, "¤", NULL },	/* Scandinavian */
276.2171 -+    { V('D','o'), 1, "$", NULL },	/* dollar */
276.2172 -+    { V('E','u'), 1, "€", NULL },	/* Euro symbol */
276.2173 -+    { V('F','c'), 1, "»", NULL },	/* right guillemet */
276.2174 -+    { V('F','i'), 1, "ffi", NULL },	/* ffi ligature */
276.2175 -+    { V('F','l'), 1, "ffl", NULL },	/* ffl ligature */
276.2176 -+    { V('F','n'), 1, "ƒ", NULL },	/* florin */
276.2177 -+    { V('F','o'), 1, "«", NULL },	/* left guillemet */
276.2178 -+    { V('I','J'), 1, "IJ", NULL },	/* IJ ligature */
276.2179 -+    { V('I','m'), 1, "ℑ", NULL },	/* imaginary */
276.2180 -+    { V('O','E'), 1, "Œ", NULL },	/* OE ligature */
276.2181 -+    { V('O','K'), 1, "✓", NULL },	/* check mark */
276.2182 -+    { V('O','R'), 1, "∨", NULL },	/* logical or */
276.2183 -+    { V('P','o'), 1, "£", NULL },	/* pound */
276.2184 -+    { V('R','e'), 1, "ℜ", NULL },	/* real */
276.2185 -+    { V('S','1'), 1, "¹", NULL },	/* sup1 (*) */
276.2186 -+    { V('S','2'), 1, "²", NULL },	/* sup2 (*) */
276.2187 -+    { V('S','3'), 1, "³", NULL },	/* sup3 (*) */
276.2188 -+    { V('S','d'), 1, "ð", NULL },	/* eth */
276.2189 -+    { V('T','P'), 1, "Þ", NULL },	/* Thorn */
276.2190 -+    { V('T','p'), 1, "þ", NULL },	/* thorn */
276.2191 -+    { V('Y','e'), 1, "¥", NULL },	/* yen */
276.2192 -+    { V('^','A'), 1, "Â", NULL },	/* circumflex A */
276.2193 -+    { V('^','E'), 1, "Ê", NULL },	/* circumflex E */
276.2194 -+    { V('^','I'), 1, "Î", NULL },	/* circumflex I */
276.2195 -+    { V('^','O'), 1, "Ô", NULL },	/* circumflex O */
276.2196 -+    { V('^','U'), 1, "Û", NULL },	/* circumflex U */
276.2197 -+    { V('^','a'), 1, "â", NULL },	/* circumflex a */
276.2198 -+    { V('^','e'), 1, "ê", NULL },	/* circumflex e */
276.2199 -+    { V('^','i'), 1, "î", NULL },	/* circumflex i */
276.2200 -+    { V('^','o'), 1, "ô", NULL },	/* circumflex o */
276.2201 -+    { V('^','u'), 1, "û", NULL },	/* circumflex u */
276.2202 -+    { V('`','A'), 1, "À", NULL },	/* grave A */
276.2203 -+    { V('`','E'), 1, "È", NULL },	/* grave E */
276.2204 -+    { V('`','I'), 1, "Ì", NULL },	/* grave I */
276.2205 -+    { V('`','O'), 1, "Ò", NULL },	/* grave O */
276.2206 -+    { V('`','U'), 1, "Ù", NULL },	/* grave U */
276.2207 -+    { V('`','a'), 1, "à", NULL },	/* grave a */
276.2208 -+    { V('`','e'), 1, "è", NULL },	/* grave e */
276.2209 -+    { V('`','i'), 1, "ì", NULL },	/* grave i */
276.2210 -+    { V('`','o'), 1, "ò", NULL },	/* grave o */
276.2211 -+    { V('`','u'), 1, "ù", NULL },	/* grave u */
276.2212 -+    { V('a','"'), 1, "˝", NULL },	/* Hungarian umlaut */
276.2213 -+    { V('a','-'), 1, "¯", NULL },	/* macron */
276.2214 -+    { V('a','.'), 1, "˙", NULL },	/* dotted */
276.2215 -+    { V('a','^'), 1, "^", NULL },	/* circumflex */
276.2216 -+    { V('a','a'), 1, "´", NULL },	/* acute */
276.2217 -+    { V('a','b'), 1, "˘", NULL },	/* breve */
276.2218 -+    { V('a','c'), 1, "¸", NULL },	/* cedilla */
276.2219 -+    { V('a','d'), 1, "¨", NULL },	/* dieresis */
276.2220 -+    { V('a','e'), 1, "æ", NULL },	/* ae ligature */
276.2221 -+    { V('a','h'), 1, "ˇ", NULL },	/* caron */
276.2222 -+    { V('a','o'), 1, "˚", NULL },	/* ring */
276.2223 -+    { V('a','p'), 1, "∼", NULL },	/* tilde operator */
276.2224 -+    { V('a','q'), 1, "'", NULL },	/* apostrophe quote (text) */
276.2225 -+    { V('a','t'), 1, "@", NULL },	/* at */
276.2226 -+    { V('a','~'), 1, "~", NULL },	/* tilde */
276.2227 -+    { V('b','a'), 1, "|", NULL },	/* bar */
276.2228 -+    { V('b','b'), 1, "¦", NULL },	/* broken bar */
276.2229 -+    { V('b','r'), 1, "│", NULL },	/* box rule */
276.2230 -+    { V('b','q'), 1, "‚", NULL },	/* right low single-quote */
276.2231 -+    { V('b','u'), 1, "•", NULL },	/* bullet */
276.2232 -+    { V('b','v'), 1, "⎪", NULL },	/* brace extension */
276.2233 -+    { V('c','*'), 1, "⊗", NULL },	/* circle-multiply */
276.2234 -+    { V('c','+'), 1, "⊕", NULL },	/* circle-plus */
276.2235 -+    { V('c','a'), 1, "∩", NULL },	/* intersection */
276.2236 -+    { V('c','i'), 1, "○", NULL },	/* circle */
276.2237 -+    { V('c','o'), 1, "©", NULL },	/* copyright */
276.2238 -+    { V('c','q'), 1, "’", NULL },	/* right single-quote */
276.2239 -+    { V('c','t'), 1, "¢", NULL },	/* cent */
276.2240 -+    { V('c','u'), 1, "∪", NULL },	/* union */
276.2241 -+    { V('d','A'), 1, "⇓", NULL },	/* down double-arrow */
276.2242 -+    { V('d','a'), 1, "↓", NULL },	/* down arrow */
276.2243 -+    { V('d','d'), 1, "‡", NULL },	/* double dagger */
276.2244 -+    { V('d','e'), 1, "°", NULL },	/* degree */
276.2245 -+    { V('d','g'), 1, "†", NULL },	/* dagger */
276.2246 -+    { V('d','i'), 1, "÷", NULL },	/* divide */
276.2247 -+    { V('d','q'), 1, "\"", NULL },	/* double quote (text) */
276.2248 -+    { V('e','m'), 1, "—", NULL },	/* em-dash */
276.2249 -+    { V('e','n'), 1, "–", NULL },	/* en-dash */
276.2250 -+    { V('e','q'), 1, "=", NULL },	/* equal */
276.2251 -+    { V('e','s'), 1, "∅", NULL },	/* empty set */
276.2252 -+    { V('e','u'), 1, "€", NULL },	/* Euro symbol */
276.2253 -+    { V('f','/'), 1, "⁄", NULL },	/* fraction */
276.2254 -+    { V('f','a'), 1, "∀", NULL },	/* universal quantifier */
276.2255 -+    { V('f','c'), 1, "›", NULL },	/* right single guillemet */
276.2256 -+    { V('f','f'), 1, "ff", NULL },	/* ff ligature */
276.2257 -+    { V('f','i'), 1, "fi", NULL },	/* fi ligature */
276.2258 -+    { V('f','l'), 1, "fl", NULL },	/* fl ligature */
276.2259 -+    { V('f','m'), 1, "′", NULL },	/* minute */
276.2260 -+    { V('f','o'), 1, "‹", NULL },	/* left single guillemet */
276.2261 -+    { V('g','a'), 1, "`", NULL },	/* grave */
276.2262 -+    { V('g','r'), 1, "∇", NULL },	/* gradient */
276.2263 -+    { V('h','A'), 1, "⇔", NULL },	/* left-right double-arrow */
276.2264 -+    { V('h','a'), 1, "^", NULL },	/* hat (text) */
276.2265 -+    { V('h','o'), 1, "˛", NULL },	/* ogonek */
276.2266 -+    { V('h','y'), 1, "‐", NULL },	/* hyphen */
276.2267 -+    { V('i','b'), 1, "⊆", NULL },	/* reflexive subset */
276.2268 -+    { V('i','f'), 1, "∞", NULL },	/* infinity */
276.2269 -+    { V('i','j'), 1, "ij", NULL },	/* ij ligature */
276.2270 -+    { V('i','p'), 1, "⊇", NULL },	/* reflexive superset */
276.2271 -+    { V('i','s'), 1, "∫", NULL },	/* integral */
276.2272 -+    { V('l','A'), 1, "⇐", NULL },	/* left double-arrow */
276.2273 -+    { V('l','B'), 1, "[", NULL },	/* left bracket */
276.2274 -+    { V('l','C'), 1, "{", NULL },	/* left brace */
276.2275 -+    { V('l','a'), 1, "⟨", NULL },	/* left angle */
276.2276 -+    { V('l','b'), 1, "⎩", NULL },	/* bottom-left hooked brace */
276.2277 -+    { V('l','c'), 1, "⌈", NULL },	/* left-ceiling */
276.2278 -+    { V('l','f'), 1, "⌊", NULL },	/* left-floor */
276.2279 -+    { V('l','h'), 1, "☜", NULL },	/* left hand */
276.2280 -+    { V('l','k'), 1, "⎨", NULL },	/* mid-left hooked brace */
276.2281 -+    { V('l','q'), 1, "“", NULL },	/* left double-quote */
276.2282 -+    { V('l','t'), 1, "⎧", NULL },	/* top-left hooked brace */
276.2283 -+    { V('l','z'), 1, "◊", NULL },	/* lozenge */
276.2284 -+    { V('m','c'), 1, "µ", NULL },	/* micro */
276.2285 -+    { V('m','i'), 1, "−", NULL },	/* minus */
276.2286 -+    { V('m','o'), 1, "∈", NULL },	/* element */
276.2287 -+    { V('m','u'), 1, "×", NULL },	/* multiply */
276.2288 -+    { V('n','b'), 1, "⊄", NULL },	/* not subset */
276.2289 -+    { V('n','c'), 1, "⊅", NULL },	/* not superset */
276.2290 -+    { V('n','e'), 1, "≢", NULL },	/* not equivalent */
276.2291 -+    { V('n','m'), 1, "∉", NULL },	/* not element */
276.2292 -+    { V('n','o'), 1, "¬", NULL },	/* logical not */
276.2293 -+    { V('o','A'), 1, "Å", NULL },	/* ring A */
276.2294 -+    { V('o','a'), 1, "å", NULL },	/* ring a */
276.2295 -+    { V('o','e'), 1, "œ", NULL },	/* oe ligature */
276.2296 -+    { V('o','q'), 1, "‘", NULL },	/* left single-quote */
276.2297 -+    { V('o','r'), 1, "|", NULL },	/* bitwise or */
276.2298 -+    { V('p','c'), 1, "·", NULL },	/* center-dot */
276.2299 -+    { V('p','d'), 1, "∂", NULL },	/* partial differential */
276.2300 -+    { V('p','l'), 1, "+", NULL },	/* plus */
276.2301 -+    { V('p','p'), 1, "⊥", NULL },	/* perpendicular */
276.2302 -+    { V('p','s'), 1, "¶", NULL },	/* paragraph */
276.2303 -+    { V('p','t'), 1, "∝", NULL },	/* proportionate */
276.2304 -+    { V('r','!'), 1, "¡", NULL },	/* upside-down exclamation */
276.2305 -+    { V('r','?'), 1, "¿", NULL },	/* upside-down question */
276.2306 -+    { V('r','A'), 1, "⇒", NULL },	/* right double-arrow */
276.2307 -+    { V('r','B'), 1, "]", NULL },	/* right bracket */
276.2308 -+    { V('r','C'), 1, "}", NULL },	/* right brace */
276.2309 -+    { V('r','a'), 1, "⟩", NULL },	/* right angle */
276.2310 -+    { V('r','b'), 1, "⎭", NULL },	/* bottom-right hooked brace */
276.2311 -+    { V('r','c'), 1, "⌉", NULL },	/* right-ceiling */
276.2312 -+    { V('r','f'), 1, "⌋", NULL },	/* right-floor */
276.2313 -+    { V('r','g'), 1, "®", NULL },	/* registered */
276.2314 -+    { V('r','h'), 1, "☞", NULL },	/* right hand */
276.2315 -+    { V('r','k'), 1, "⎬", NULL },	/* mid-right hooked brace */
276.2316 -+    { V('r','l'), 1, "‾", NULL },	/* overline */
276.2317 -+    { V('r','n'), 1, "‾", NULL },	/* overline */
276.2318 -+    { V('r','q'), 1, "”", NULL },	/* right double-quote */
276.2319 -+    { V('r','s'), 1, "\\", NULL },	/* backward slash */
276.2320 -+    { V('r','t'), 1, "⎫", NULL },	/* top-left hooked brace */
276.2321 -+    { V('r','u'), 1, "_", NULL },	/* (*) */
276.2322 -+    { V('s','b'), 1, "⊂", NULL },	/* proper subset */
276.2323 -+    { V('s','c'), 1, "§", NULL },	/* section */
276.2324 -+    { V('s','d'), 1, "″", NULL },	/* second */
276.2325 -+    { V('s','h'), 1, "#", NULL },	/* hash (pound) */
276.2326 -+    { V('s','l'), 1, "/", NULL },	/* forward slash */
276.2327 -+    { V('s','p'), 1, "⊃", NULL },	/* proper superset */
276.2328 -+    { V('s','q'), 1, "□", NULL },	/* white square */
276.2329 -+    { V('s','r'), 1, "√", NULL },	/* square root */
276.2330 -+    { V('s','s'), 1, "ß", NULL },	/* German eszett */
276.2331 -+    { V('s','t'), 1, "∋", NULL },	/* such that */
276.2332 -+    { V('t','e'), 1, "∃", NULL },	/* existential quantifier */
276.2333 -+    { V('t','f'), 1, "∴", NULL },	/* therefore */
276.2334 -+    { V('t','i'), 1, "~", NULL },	/* tilde (text) */
276.2335 -+    { V('t','m'), 1, "™", NULL },	/* trademarked */
276.2336 -+    { V('t','s'), 1, "ς", NULL },	/* sigma terminal */
276.2337 -+    { V('u','A'), 1, "⇑", NULL },	/* up double-arrow */
276.2338 -+    { V('u','a'), 1, "↑", NULL },	/* up arrow */
276.2339 -+    { V('u','l'), 1, "_", NULL },	/* underscore */
276.2340 -+    { V('v','A'), 1, "⇕", NULL },	/* up-down double-arrow */
276.2341 -+    { V('v','a'), 1, "↕", NULL },	/* up-down arrow */
276.2342 -+    { V('|','='), 1, "≃", NULL },	/* asymptotically equal */
276.2343 -+    { V('~','='), 1, "≈", NULL },	/* almost equal */
276.2344 -+    { V('~','A'), 1, "Ã", NULL },	/* tilde A */
276.2345 -+    { V('~','N'), 1, "Ñ", NULL },	/* tilde N */
276.2346 -+    { V('~','O'), 1, "Õ", NULL },	/* tilde O */
276.2347 -+    { V('~','a'), 1, "ã", NULL },	/* tilde a */
276.2348 -+    { V('~','n'), 1, "ñ", NULL },	/* tilde n */
276.2349 -+    { V('~','o'), 1, "õ", NULL },	/* tilde o */
276.2350 -+    { V('~','~'), 1, "≈", NULL },	/* almost equal */
276.2351 -     { 0, 0, NULL, NULL  }
276.2352 --
276.2353 --    
276.2354 - };
276.2355 - 
276.2356 - void stdinit(void) {
276.2357 ---- /dev/null
276.2358 -+++ b/version.h
276.2359 -@@ -0,0 +1 @@
276.2360 -+#define version "1.6g-7-slitaz"
   277.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   277.2 +++ b/man2html/stuff/patches/man2html-slitaz.diff	Thu May 10 21:12:00 2018 +0300
   277.3 @@ -0,0 +1,2357 @@
   277.4 +--- /dev/null
   277.5 ++++ b/Makefile
   277.6 +@@ -0,0 +1,89 @@
   277.7 ++CFLAGS  += -Wall -Wstrict-prototypes -Wmissing-prototypes -DGUNZIP='"gunzip"' `pkg-config --cflags --libs glib-2.0`
   277.8 ++# -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -lglib-2.0
   277.9 ++OBJECTS  = man2html.o cgibase.o abbrev.o strdefs.o
  277.10 ++bindir   = $(DESTDIR)$(PREFIX)/usr/bin
  277.11 ++mandir   = $(DESTDIR)$(PREFIX)/usr/share/man
  277.12 ++vardir   = $(DESTDIR)$(PREFIX)/var
  277.13 ++httpdir  = $(DESTDIR)$(PREFIX)/home/httpd
  277.14 ++cgidir   = $(DESTDIR)$(PREFIX)/var/www
  277.15 ++sharedir = $(DESTDIR)$(PREFIX)/usr/share/man2html
  277.16 ++cgiowner = www
  277.17 ++cgigroup = www
  277.18 ++CC ?= gcc
  277.19 ++
  277.20 ++all: man2html hman
  277.21 ++
  277.22 ++man2html:	$(OBJECTS)
  277.23 ++	$(CC) -o man2html $(OBJECTS) $(CFLAGS)
  277.24 ++
  277.25 ++pot:
  277.26 ++	mkdir -p po
  277.27 ++	xgettext -o po/man2html.pot -k_ -kN_ \
  277.28 ++		--package-name="man2html" \
  277.29 ++		--from-code="UTF-8" \
  277.30 ++		cgibase.c man2html.c hman.sh man.sh
  277.31 ++
  277.32 ++msgmerge:
  277.33 ++	@for l in $(LINGUAS); do \
  277.34 ++		echo -n "Updating $$l po file."; \
  277.35 ++		msgmerge -U po/$$l.po po/man2html.pot; \
  277.36 ++	done;
  277.37 ++
  277.38 ++msgfmt:
  277.39 ++	@for l in $(LINGUAS); do \
  277.40 ++		echo "Compiling $$l mo file..."; \
  277.41 ++		mkdir -p po/mo/$$l/LC_MESSAGES; \
  277.42 ++		msgfmt -o po/mo/$$l/LC_MESSAGES/man2html.mo po/$$l.po; \
  277.43 ++	done;
  277.44 ++
  277.45 ++
  277.46 ++# man2html:	../src/version.h
  277.47 ++
  277.48 ++# This installs the man2html utility
  277.49 ++install:	man2html
  277.50 ++	mkdir -p $(bindir)
  277.51 ++	install -m 755 man2html $(bindir)
  277.52 ++	mkdir -p $(mandir)/man1
  277.53 ++	install -m 644 man2html.1 $(mandir)/man1/man2html.1
  277.54 ++
  277.55 ++install-scripts: install-man-scripts install-glimpse-stuff install-hman
  277.56 ++
  277.57 ++# These are the scripts that allow pointing a browser at
  277.58 ++#   http://localhost/cgi-bin/man/man2html
  277.59 ++# to work.
  277.60 ++install-man-scripts:
  277.61 ++	mkdir -p $(cgidir)
  277.62 ++	mkdir -p $(sharedir)
  277.63 ++	install -m 755 scripts/cgi-bin/man/* $(cgidir)
  277.64 ++	install -m 644 scripts/cgi-aux/man/* $(sharedir)
  277.65 ++	install -d -o $(cgiowner) -g $(cgigroup) -m 775 $(vardir)/man2html
  277.66 ++# (aux was renamed to cgi-aux since aux causes problems under DOS)
  277.67 ++
  277.68 ++# If you have installed glimpse, and have compressed man pages,
  277.69 ++# then perhaps you also want these filters.
  277.70 ++install-glimpse-stuff:
  277.71 ++	install -m 644 glimpse_filters $(vardir)/man2html/.glimpse_filters
  277.72 ++
  277.73 ++# In order not to have to type a long command like
  277.74 ++#   netscape http://localhost/cgi-bin/man/man2html?section+topic
  277.75 ++# or
  277.76 ++#   lynx lynxcgi:/home/httpd/cgi-bin/man/man2html?section+topic
  277.77 ++# it is convenient to have some shell script as a wrapper.
  277.78 ++# The script hman can be aliased to man. It uses an environment
  277.79 ++# variable MANHTMLPAGER to find out which browser you use, and
  277.80 ++# you can set MANHTMLHOST if the pages are not on localhost.
  277.81 ++hman: hman.sh
  277.82 ++	rm -f hman
  277.83 ++	sed -e 's,%version%,1.6g-7,' hman.sh > hman
  277.84 ++
  277.85 ++install-hman: hman
  277.86 ++	install -m 555 hman $(bindir)/hman
  277.87 ++	install -m 644 hman.1 $(mandir)/man1/hman.1
  277.88 ++
  277.89 ++clean:
  277.90 ++	rm -f core hman man2html $(OBJECTS) *~
  277.91 ++
  277.92 ++spotless:	clean
  277.93 ++	rm -f Makefile
  277.94 ++
  277.95 ++$(OBJECTS): defs.h
  277.96 +--- a/abbrev.c
  277.97 ++++ b/abbrev.c
  277.98 +@@ -27,7 +27,7 @@
  277.99 +     "SSO", "System Services Overview",
 277.100 +     "TEXT", "Editing Text Files",
 277.101 +     "DOCS", "Formatting Documents",
 277.102 +-    "TROFF", "Using <B>nroff</B> and <B>troff</B>",
 277.103 ++    "TROFF", "Using <b>nroff</b> and <b>troff</b>",
 277.104 +     "INDEX", "Global Index",
 277.105 +     "CPG", "C Programmer's Guide",
 277.106 +     "CREF", "C Reference Manual",
 277.107 +@@ -46,7 +46,7 @@
 277.108 +     "CGI", "SunCGI Reference Manual",
 277.109 +     "CORE", "SunCore Reference Manual",
 277.110 +     "4ASSY", "Sun-4 Assembly Language Reference",
 277.111 +-    "SARCH", "<FONT SIZE=\"-1\">SPARC</FONT> Architecture Manual",
 277.112 ++    "SARCH", "SPARC Architecture Manual",
 277.113 +     "KR", "The C Programming Language",
 277.114 +     0, 0 };
 277.115 + 
 277.116 +--- a/cgibase.c
 277.117 ++++ b/cgibase.c
 277.118 +@@ -8,6 +8,8 @@
 277.119 + #include <ctype.h>		/* tolower() */
 277.120 + #include <string.h>		/* strlen() */
 277.121 + #include "defs.h"
 277.122 ++#include <glib.h>
 277.123 ++#include <glib/gi18n.h>
 277.124 + 
 277.125 + /*
 277.126 +  * The default is to use cgibase. With relative html style
 277.127 +@@ -21,8 +23,8 @@
 277.128 +  * and uses lynx, and we use lynxcgi:/usr/lib/cgi-bin.
 277.129 +  */
 277.130 + 
 277.131 +-static char *man2htmlpath = "/cgi-bin/man/man2html"; 	/* default */
 277.132 +-static char *cgibase_format = "http://%s"; 		/* host.domain:port */
 277.133 ++static char *man2htmlpath = ""; 	/* default */
 277.134 ++static char *cgibase_format = "%s"; 		/* host.domain:port */
 277.135 + static char *cgibase_ll_format = "lynxcgi:%s"; 		/* directory */
 277.136 + static char *cgibase = "";				/* default */
 277.137 + 
 277.138 +@@ -68,76 +70,46 @@
 277.139 +      relat_html_style = 1;
 277.140 + }
 277.141 + 
 277.142 +-/* What shall we say in case of relat_html_style? */
 277.143 +-static char *signature = "<HR>\n"
 277.144 +-"This document was created by\n"
 277.145 +-"<A HREF=\"%s%s\">man2html</A>,\n"
 277.146 +-"using the manual pages.<BR>\n"
 277.147 +-"%s\n";
 277.148 +-
 277.149 +-#define TIMEFORMAT "%T GMT, %B %d, %Y"
 277.150 +-#define TIMEBUFSZ	500
 277.151 +-
 277.152 + void print_sig()
 277.153 + {
 277.154 +-    char timebuf[TIMEBUFSZ];
 277.155 +-    struct tm *timetm;
 277.156 +-    time_t now;
 277.157 +-
 277.158 +-    timebuf[0] = 0;
 277.159 +-#ifdef TIMEFORMAT
 277.160 +-    sprintf(timebuf, "Time: ");
 277.161 +-    now=time(NULL);
 277.162 +-    timetm=gmtime(&now);
 277.163 +-    strftime(timebuf+6, TIMEBUFSZ-6, TIMEFORMAT, timetm);
 277.164 +-    timebuf[TIMEBUFSZ-1] = 0;
 277.165 +-#endif
 277.166 +-    printf(signature, cgibase, man2htmlpath, timebuf);
 277.167 ++	printf("</section>\n<footer>\n<p>%s</p>\n</footer>\n",
 277.168 ++		_("This document was created by <b>man2html</b> using the manual pages."));
 277.169 + }
 277.170 + 
 277.171 + void
 277.172 + include_file_html(char *g) {
 277.173 +-     printf("<A HREF=\"file:///usr/include/%s\">%s</A>&gt;", g,g);
 277.174 ++     printf("<a href=\"file:///usr/include/%s\">%s</a>&gt;", g,g);
 277.175 + }
 277.176 + 
 277.177 + void
 277.178 + man_page_html(char *sec, char *h) {
 277.179 +-	if (relat_html_style) {
 277.180 +-		if (!h)
 277.181 +-			printf("<A HREF=\"../index.html\">"
 277.182 +-			       "Return to Main Contents</A>");
 277.183 +-		else
 277.184 +-			printf("<A HREF=\"../man%s/%s.%s.html\">%s</A>",
 277.185 +-			       sec, h, sec, h);
 277.186 +-	} else {
 277.187 +-		if (!h)
 277.188 +-			printf("<A HREF=\"%s%s\">Return to Main Contents</A>",
 277.189 +-			       cgibase, man2htmlpath);
 277.190 +-		else if (!sec)
 277.191 +-			printf("<A HREF=\"%s%s%c%s\">%s</A>",
 277.192 +-			       cgibase, man2htmlpath, sep, h, h);
 277.193 +-		else
 277.194 +-			printf("<A HREF=\"%s%s%c%s+%s\">%s</A>",
 277.195 +-			       cgibase, man2htmlpath, sep, sec, h, h);
 277.196 +-	}
 277.197 ++	if (!h)
 277.198 ++		printf("<a href=\"?\">%s</a>",
 277.199 ++			_("Return to Main Contents"));
 277.200 ++	else if (!sec)
 277.201 ++		printf("<a href=\"?%s\">%s</a>",
 277.202 ++			h, h);
 277.203 ++	else
 277.204 ++		printf("<a href=\"?%s+%s\">%s</a>",
 277.205 ++			sec, h, h);
 277.206 + }
 277.207 + 
 277.208 + void
 277.209 + ftp_html(char *f) {
 277.210 +-     printf("<A HREF=\"ftp://%s\">%s</A>", f, f);
 277.211 ++     printf("<a href=\"ftp://%s\">%s</a>", f, f);
 277.212 + }
 277.213 + 
 277.214 + void
 277.215 + www_html(char *f) {
 277.216 +-     printf("<A HREF=\"http://%s\">%s</A>", f, f);
 277.217 ++     printf("<a href=\"http://%s\">%s</a>", f, f);
 277.218 + }
 277.219 + 
 277.220 + void
 277.221 + mailto_html(char *g) {
 277.222 +-     printf("<A HREF=\"mailto:%s\">%s</A>", g, g);
 277.223 ++     printf("<a href=\"mailto:%s\">%s</a>", g, g);
 277.224 + }
 277.225 + 
 277.226 + void
 277.227 + url_html(char *g) {
 277.228 +-     printf("<A HREF=\"%s\">%s</A>", g, g);
 277.229 ++     printf("<a href=\"%s\">%s</a>", g, g);
 277.230 + }
 277.231 +--- a/hman.sh
 277.232 ++++ b/hman.sh
 277.233 +@@ -8,99 +8,83 @@
 277.234 + # Usage examples:
 277.235 + #        hman                    - get start page
 277.236 + #        hman man2html           - get man page for man2html
 277.237 +-#        hman 7 locale           - get section 7 man page for locale 
 277.238 ++#        hman 7 locale           - get section 7 man page for locale
 277.239 + #        hman 1                  - section 1 index of names only
 277.240 + #        hman 3 index            - section 3 index names+descriptions
 277.241 + #        hman -k editor          - search all man pages for some string
 277.242 +-#	 hman -P arena ./twm.man - specify browser; specify man page
 277.243 ++#        hman -P arena ./twm.man - specify browser; specify man page
 277.244 + #
 277.245 +-# hman from %version%
 277.246 ++# hman from 1.6g-7
 277.247 + #
 277.248 + 
 277.249 +-if [ x"$1" = x"-v" ] || [ x"$1" = x"-V" ]; then
 277.250 +-	echo "`basename $0` from %version%"
 277.251 ++. /usr/lib/slitaz/httphelper.sh
 277.252 ++. /lib/libtaz.sh
 277.253 ++
 277.254 ++# Internationalization
 277.255 ++export TEXTDOMAIN='man2html'
 277.256 ++_()  { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
 277.257 ++
 277.258 ++
 277.259 ++if [ "$1" == '-v' ] || [ "$1" == '-V' ]; then
 277.260 ++	echo "$(basename $0) v. 1.6g-slitaz"
 277.261 + 	exit 0
 277.262 + fi
 277.263 + 
 277.264 + # The user has to set MANHTMLPAGER (or he will get httpd-free lynx).
 277.265 + # Pick your favorite browser: lynx, xmosaic, netscape, arena, amaya, grail, ...
 277.266 +-if [ x"$MANHTMLPAGER" = x ]  && ! which lynx > /dev/null ; then
 277.267 +-	HMAN_BROWSER=sensible-browser
 277.268 +-else
 277.269 +-	HMAN_BROWSER=${MANHTMLPAGER-lynxcgi}
 277.270 +-fi
 277.271 ++HMAN_BROWSER="${MANHTMLPAGER:-tazweb}"
 277.272 + 
 277.273 +-#
 277.274 + # If the man pages are on a remote host, specify it in MANHTMLHOST.
 277.275 +-HOST=${MANHTMLHOST-localhost}
 277.276 ++HOST=${MANHTMLHOST:-localhost}
 277.277 + 
 277.278 + # Perhaps the browser was specified on the command line?
 277.279 +-if [ "$#" -gt 1 ] && [ x"$1" = x"-P" ]; then
 277.280 +-    HMAN_BROWSER="$2"
 277.281 +-    shift; shift
 277.282 ++if [ "$#" -gt 1 ] && [ "$1" == '-P' ]; then
 277.283 ++	HMAN_BROWSER="$2"
 277.284 ++	shift; shift
 277.285 + fi
 277.286 + 
 277.287 + # Perhaps the host was specified on the command line?
 277.288 +-if [ "$#" -gt 1 ] && [ x"$1" = x"-H" ]; then
 277.289 +-    HOST="$2"
 277.290 +-    shift; shift
 277.291 ++if [ "$#" -gt 1 ] && [ "$1" == '-H' ]; then
 277.292 ++	HOST="$2"
 277.293 ++	shift; shift
 277.294 + fi
 277.295 + 
 277.296 +-# Interface to a live (already running) netscape browser.
 277.297 +-nsfunc () {
 277.298 +-	if ( /bin/ps xc | grep -q 'netscape$' ) ; then
 277.299 +-		if [ -x  netscape-remote ] ; then
 277.300 +-			exec netscape-remote  -remote "openURL($1,new_window)"
 277.301 +-		else
 277.302 +-			exec netscape -remote "openURL($1,new_window)"
 277.303 +-		fi
 277.304 +-	else
 277.305 +-		netscape $1 &
 277.306 +-	fi
 277.307 +-}
 277.308 ++CGI="http://$HOST/man.cgi"
 277.309 + 
 277.310 +-urlencode() {
 277.311 +-	echo "$@" | perl -pe 'chomp(); s/([^A-Za-z0-9\ \_\-\.\/])/"%" . unpack("H*", $1)/eg; tr/ /+/;'
 277.312 ++enc() {
 277.313 ++	echo "$@" | sed -e 's|+|%2B|g; s| |+|g';
 277.314 + }
 277.315 + 
 277.316 +-
 277.317 +-case "$HMAN_BROWSER" in
 277.318 +-     lynxcgi)
 277.319 +-	HMAN_BROWSER=lynx
 277.320 +-	CG="lynxcgi:/usr/lib/cgi-bin/man"
 277.321 +-	;;
 277.322 +-     netscape)
 277.323 +-        HMAN_BROWSER=nsfunc
 277.324 +-        CG="http://$HOST/cgi-bin/man"
 277.325 +-	;;
 277.326 +-     *)
 277.327 +-	CG="http://$HOST/cgi-bin/man"
 277.328 +-	;;
 277.329 ++case "$#" in
 277.330 ++	0)
 277.331 ++		$HMAN_BROWSER "$CGI";;
 277.332 ++	1)
 277.333 ++		case "$1" in
 277.334 ++			1|2|3|4|5|6|7|8|l|n)
 277.335 ++				$HMAN_BROWSER "$CGI?$1";;
 277.336 ++			/*)
 277.337 ++				$HMAN_BROWSER "$CGI?$(enc "$1")";;
 277.338 ++			*/*)
 277.339 ++				$HMAN_BROWSER "$CGI?$(enc "$(realpath "$PWD/$1")")";;
 277.340 ++			*)
 277.341 ++				$HMAN_BROWSER "$CGI?$(enc "$1")";;
 277.342 ++		esac
 277.343 ++		;;
 277.344 ++	2)
 277.345 ++#		case "$1" in
 277.346 ++#			-k)
 277.347 ++#				$HMAN_BROWSER "$CGI?search=$(enc "$2")";;
 277.348 ++#			*)
 277.349 ++#				if [ "$2" == 'index' ]; then
 277.350 ++#					$HMAN_BROWSER "$CGI?whatis=$(enc "$1")"
 277.351 ++#				else
 277.352 ++					$HMAN_BROWSER "$CGI?$(enc "$1 $2")"
 277.353 ++#				fi
 277.354 ++#				;;
 277.355 ++#		esac
 277.356 ++		;;
 277.357 ++	*)
 277.358 ++		_ 'bad number of args';;
 277.359 + esac
 277.360 +-
 277.361 +-  case "$#" in
 277.362 +-     0)   $HMAN_BROWSER "$CG/man2html" ;;
 277.363 +-     1)   case "$1" in
 277.364 +-	    1|2|3|4|5|6|7|8|l|n)
 277.365 +-		$HMAN_BROWSER "$CG/mansec?query=$1" ;;
 277.366 +-	    /*)
 277.367 +-		$HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;;
 277.368 +-	    */*)
 277.369 +-		$HMAN_BROWSER "$CG/man2html?query=`urlencode "$PWD/$1"`" ;;
 277.370 +-	    *)
 277.371 +-		$HMAN_BROWSER "$CG/man2html?query=`urlencode "$1"`" ;;
 277.372 +-          esac ;;
 277.373 +-     2)   case "$1" in
 277.374 +-            -k)
 277.375 +-                $HMAN_BROWSER "$CG/mansearch?query=`urlencode "$2"`" ;;
 277.376 +-            *)
 277.377 +-		if [ "$2" = index ]; then
 277.378 +-		    $HMAN_BROWSER "$CG/manwhatis?query=`urlencode "$1"`"
 277.379 +-                else
 277.380 +-		    $HMAN_BROWSER "$CG/man2html?query=`urlencode "$1 $2"`"
 277.381 +-                fi ;;
 277.382 +-          esac ;;
 277.383 +-     *)   echo "bad number of args" ;;
 277.384 +-  esac
 277.385 + 
 277.386 + exit 0
 277.387 +--- /dev/null
 277.388 ++++ b/man.sh
 277.389 +@@ -0,0 +1,292 @@
 277.390 ++#!/bin/sh
 277.391 ++# man2html cgi script - uses /usr/bin/man2html to format man pages
 277.392 ++# aeb@cwi.nl - 980109
 277.393 ++# Aleksej Bobylev <al.bobylev@gmail.com>, 2015-2016
 277.394 ++
 277.395 ++. /usr/lib/slitaz/httphelper.sh
 277.396 ++. /lib/libtaz.sh
 277.397 ++
 277.398 ++# Internationalization.
 277.399 ++[ -e /etc/locale.conf ] && . /etc/locale.conf
 277.400 ++export TEXTDOMAIN='man2html'
 277.401 ++export LANG LC_ALL
 277.402 ++_()  { local T="$1"; shift; printf "$(gettext "$T")" "$@"; echo; }
 277.403 ++
 277.404 ++
 277.405 ++SECTIONS="$(_ 'User Commands'):$(_ 'System Calls'):$(_ 'C Library Functions'):\
 277.406 ++$(_ 'Devices and Network Interfaces'):$(_ 'File Formats'):\
 277.407 ++$(_ 'Games and Demos'):$(_ 'Environments, Tables, and Troff Macros'):\
 277.408 ++$(_ 'Maintenance Commands'):$(_ 'All available manual pages')"
 277.409 ++
 277.410 ++query="$(GET query)"
 277.411 ++if [ -z "$query" ]; then
 277.412 ++	set -- $(echo $(GET) | tr '+' ' ')
 277.413 ++else
 277.414 ++	set -- $(echo $(GET query) | tr '+' ' ')
 277.415 ++fi
 277.416 ++
 277.417 ++
 277.418 ++if [ $1 == 'css' ]; then
 277.419 ++	# post css file on query
 277.420 ++	header 'Content-Type: text/css'
 277.421 ++	cat /usr/share/doc/slitaz-doc.css
 277.422 ++fi
 277.423 ++
 277.424 ++if [ $# -eq 1 ]; then
 277.425 ++	case $1 in
 277.426 ++		1|2|3|4|5|6|7|8|all)
 277.427 ++			if [ "$1" == 'all' ]; then
 277.428 ++				sec_n='9'; sec_folder='man?'
 277.429 ++			else
 277.430 ++				sec_n="$1"; sec_folder="man$1"
 277.431 ++			fi
 277.432 ++			sec_desc=$(echo "$SECTIONS" | cut -d':' -f $sec_n)
 277.433 ++			header
 277.434 ++			cat <<EOT
 277.435 ++<!DOCTYPE html>
 277.436 ++<html>
 277.437 ++<head>
 277.438 ++	<title>$1. $sec_desc</title>
 277.439 ++	<link rel="stylesheet" href="?css">
 277.440 ++</head>
 277.441 ++<body><header><h1>$(_ 'Section %s: %s' $1 "$sec_desc")</h1></header>
 277.442 ++	<section><header>$(_ 'Manual Pages')</header>
 277.443 ++	<p>
 277.444 ++EOT
 277.445 ++
 277.446 ++			case $1 in
 277.447 ++				1) _ "Section 1 of the manual describes user commands and tools, for example, file \
 277.448 ++manipulation tools, shells, compilers, web browsers, file and image viewers and editors, and so \
 277.449 ++on.";;
 277.450 ++				2) _ "Section 2 of the manual describes the Linux system calls. A system call is \
 277.451 ++an entry point into the Linux kernel.";;
 277.452 ++				3) _ "Section 3 of the manual describes all library functions excluding the \
 277.453 ++library functions (system call wrappers) described in Section 2, which implement system calls.";;
 277.454 ++				4) _ "Section 4 of the manual describes special files (devices).";;
 277.455 ++				5) _ "Section 5 of the manual describes various file formats, as well as the \
 277.456 ++corresponding C structures, if any.";;
 277.457 ++				6) _ "Section 6 of the manual describes all the games and funny little programs \
 277.458 ++available on the system.";;
 277.459 ++				7) _ "Section 7 of the manual provides overviews on various topics, and describes \
 277.460 ++conventions and protocols, character set standards, the standard filesystem layout, and \
 277.461 ++miscellaneous other things.";;
 277.462 ++				8) _ "Section 8 of the manual describes commands which either can be or are used \
 277.463 ++only by the superuser, like system-administration commands, daemons, and hardware-related \
 277.464 ++commands.";;
 277.465 ++			esac
 277.466 ++
 277.467 ++			[ "$1" != 'all' ] && echo "<b><a href=\"?intro.$1\">intro</a></b>($1)"
 277.468 ++			echo '</p>'
 277.469 ++
 277.470 ++			temp="$(mktemp)"; temp2="$(mktemp)"
 277.471 ++			for dir in $(find /usr/share/man -type d -name "$sec_folder"); do
 277.472 ++				ls $dir | sed 's|\.\([0-9]\)\.*[bgx]*z*2*$|:\1|'
 277.473 ++				# fix sorting 'feature': leading '_' always ignored by `sort`
 277.474 ++			done | sed 's|_|zzzzzzzz|g' | sort -fu | sed 's|zzzzzzzz|_|g' | \
 277.475 ++			awk -F' ' -vtemp="$temp" -vtemp2="$temp2" '
 277.476 ++			{
 277.477 ++				split($1, man, ":");
 277.478 ++
 277.479 ++				letter = tolower(substr(man[1], 1, 1));
 277.480 ++				if (letter != last_letter) {
 277.481 ++					last_letter = letter;
 277.482 ++					letter_index[++num_letters] = letter;
 277.483 ++					print "<h3 id=\"l" letter "\">" toupper(letter) "</h3>" > temp;
 277.484 ++				}
 277.485 ++				lnk = man[1]; gsub("+", "%2b", lnk);
 277.486 ++				printf "<b><a href=\"?%s.%s\">%s</a></b>(%s) ", lnk, man[2], man[1], man[2] > temp;
 277.487 ++			}
 277.488 ++			END {
 277.489 ++				# Print out alphabetic quick index and other links
 277.490 ++				for (i = 1; i <= num_letters; i++) {
 277.491 ++					print "<a href=\"#l" letter_index[i] section "\">" toupper(letter_index[i]) "</a>" > temp2;
 277.492 ++				}
 277.493 ++			}
 277.494 ++			'
 277.495 ++			if [ -s "$temp" ]; then
 277.496 ++				echo '<hr>'; cat "$temp2"; echo '<hr>'
 277.497 ++				cat "$temp"
 277.498 ++				echo '<hr>'; cat "$temp2"; echo '<hr>'
 277.499 ++			fi
 277.500 ++
 277.501 ++			rm -f "$temp" "$temp2"
 277.502 ++
 277.503 ++			cat <<EOT
 277.504 ++	</section>
 277.505 ++	<section><header>$(_ 'Sections')</header>
 277.506 ++		<ol>
 277.507 ++EOT
 277.508 ++			for i in $(seq 8); do
 277.509 ++				sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i)
 277.510 ++				echo "<li><a href=\"?$i\">$sec_desc</a></li>"
 277.511 ++			done
 277.512 ++			cat <<EOT
 277.513 ++	</ol>
 277.514 ++	<p><a href="?all">$(_ 'All Sections')</a></p>
 277.515 ++</section>
 277.516 ++
 277.517 ++</body>
 277.518 ++</html>
 277.519 ++EOT
 277.520 ++			exit 0
 277.521 ++			;;
 277.522 ++	esac
 277.523 ++fi
 277.524 ++
 277.525 ++# Find the required page - expect to be called with "man2html [sec] page".
 277.526 ++# There may a prefixed "-M manpath" option.
 277.527 ++
 277.528 ++if [ $# -ge 2 -a "$1" == '-M' ]; then
 277.529 ++	MANPATH="$2"
 277.530 ++	export MANPATH
 277.531 ++	shift; shift
 277.532 ++	MP=' using the given MANPATH'
 277.533 ++else
 277.534 ++	MP=''
 277.535 ++fi
 277.536 ++
 277.537 ++
 277.538 ++# If no arguments given, show a start page.
 277.539 ++
 277.540 ++if [ $# -eq 0 ]; then
 277.541 ++	header
 277.542 ++	cat <<EOT
 277.543 ++<!DOCTYPE html>
 277.544 ++<html>
 277.545 ++<head>
 277.546 ++	<meta charset="UTF-8">
 277.547 ++	<title>$(_ 'Manual Pages - Main Contents')</title>
 277.548 ++	<link rel="stylesheet" href="?css">
 277.549 ++</head>
 277.550 ++<body>
 277.551 ++<header><h1>$(_ 'Manual Pages - Main Contents')</h1></header>
 277.552 ++<section><header>$(_ 'Name and Section lookup')</header>
 277.553 ++	<form method="GET">
 277.554 ++		<input name="query" size="40">
 277.555 ++		<button type="submit">$(_ 'Search')</button>
 277.556 ++	</form>
 277.557 ++	<p>$(_ "You can enter a program name, possibly preceded by the section, the directories to search \
 277.558 ++(with -M) or a full name. For example:")</p>
 277.559 ++
 277.560 ++	<ul>
 277.561 ++		<li><tt>find</tt></li>
 277.562 ++		<li><tt>1 find</tt></li>
 277.563 ++		<li><tt>-M /usr/share/man:/opt/man:/usr/local/share/man find</tt></li>
 277.564 ++		<li><tt>/usr/share/man/man1/gperf.1</tt></li>
 277.565 ++	</ul>
 277.566 ++</section>
 277.567 ++
 277.568 ++<section><header>$(_ 'Index of pages')</header>
 277.569 ++
 277.570 ++	<ol>
 277.571 ++EOT
 277.572 ++	for i in $(seq 8); do
 277.573 ++		sec_desc=$(echo "$SECTIONS" | cut -d':' -f $i)
 277.574 ++		echo "<li><a href=\"?$i\">$sec_desc</a></li>"
 277.575 ++	done
 277.576 ++	cat <<EOT
 277.577 ++	</ol>
 277.578 ++	<p><a href="?all">$(_ 'All Sections')</a></p>
 277.579 ++</section>
 277.580 ++
 277.581 ++<footer>
 277.582 ++	<p>$(_ 'The original man2html program and scripts are due to %s and %s.' \
 277.583 ++	'<a href="http://wsinwp01.win.tue.nl:1234/index.html">Richard Verhoeven</a>' \
 277.584 ++	'<a href="mailto:michael@actrix.gen.nz">Michael Hamilton</a>')
 277.585 ++	$(_ 'This version is from %s maintained by %s.' 'man-1.6g' \
 277.586 ++	'<a href="mailto:flucifredi@acm.org">Federico Lucifredi</a>')</p>
 277.587 ++</footer>
 277.588 ++</body>
 277.589 ++</html>
 277.590 ++EOT
 277.591 ++	exit 0
 277.592 ++fi
 277.593 ++
 277.594 ++if [ $# -gt 2 ]; then
 277.595 ++	man2html -E "man2html: bad invocation: too many arguments"
 277.596 ++	exit 0
 277.597 ++fi
 277.598 ++
 277.599 ++# A single argument may be an explicitly give path name
 277.600 ++# Otherwise, find it
 277.601 ++
 277.602 ++if [ $# -eq 1 ]; then
 277.603 ++	arg=${1//%2b/+}
 277.604 ++	case "$arg" in
 277.605 ++		/*)  PAGE="$arg";;
 277.606 ++		*.*) PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg"   -o -name "$arg.gz"   -o -name "$arg.bz2"   -o -name "$arg.xz" \));;
 277.607 ++		*)   PAGE=$(find /usr/share/man \( -type f -o -type l \) \( -name "$arg.*" -o -name "$arg.*.gz" -o -name "$arg.*.bz2" -o -name "$arg.*.xz" \));;
 277.608 ++	esac
 277.609 ++else
 277.610 ++	arg=${2//%2b/+}
 277.611 ++	PAGE="$(
 277.612 ++		for dir in $(find /usr/share/man -type d -name man$1); do
 277.613 ++			find $dir \( -type f -o -type l \) -name "$arg.$1*"
 277.614 ++		done)"
 277.615 ++fi
 277.616 ++
 277.617 ++if [ -z "$PAGE" ]; then
 277.618 ++	complaint="$(_ 'Cannot find a page')"
 277.619 ++	if [ $# -eq 1 ]; then
 277.620 ++		complaint="$(_ 'Cannot find a page for <b>%s</b> %s' $1 $MP)"
 277.621 ++	else
 277.622 ++		complaint="$(_ 'Cannot find a page for <b>%s</b> in section <b>%s</b> %s') $2 $1 $MP"
 277.623 ++	fi
 277.624 ++	man2html -E "<p>$complaint</p>"
 277.625 ++	exit 0
 277.626 ++fi
 277.627 ++
 277.628 ++if [ "$(echo "$PAGE" | wc -l)" -gt 1 ]; then
 277.629 ++	header
 277.630 ++	cat <<EOT
 277.631 ++<!DOCTYPE html>
 277.632 ++<html><head><title>$(_ 'Multiple pages')</title>
 277.633 ++<link rel="stylesheet" href="?css"></link></head>
 277.634 ++<body><header><h1>$(_ 'Multiple pages found')</h1></header>
 277.635 ++	<section>
 277.636 ++	<ul>
 277.637 ++EOT
 277.638 ++	echo "$PAGE" | awk -F'/' '{
 277.639 ++		if ($5 ~ "man") {
 277.640 ++			split($6, man, ".");
 277.641 ++			printf "<li><a href=\"?%s\">%s</a> (%s)</li>\n", $0, man[1], man[2];
 277.642 ++		} else {
 277.643 ++			split($7, man, ".");
 277.644 ++			printf "<li><a href=\"?%s\">%s</a> (%s) — %s</li>\n", $0, man[1], man[2], $5;
 277.645 ++		}
 277.646 ++	}'
 277.647 ++	sed 's|^.*$|<li><a href="?&">&</a></li>|'
 277.648 ++	echo '</ul></section></body></html>'
 277.649 ++	exit 0
 277.650 ++fi
 277.651 ++
 277.652 ++if [ -r "$PAGE" ]; then
 277.653 ++	tmpman="$(mktemp)"
 277.654 ++	# Unpack man page
 277.655 ++	case "$PAGE" in
 277.656 ++		*.gz)   zcat "$PAGE" > "$tmpman";;
 277.657 ++		*.bz2) bzcat "$PAGE" > "$tmpman";;
 277.658 ++		*.xz)  xzcat "$PAGE" > "$tmpman";;
 277.659 ++		*)        cp "$PAGE"   "$tmpman";;
 277.660 ++	esac
 277.661 ++
 277.662 ++	# Check for link
 277.663 ++	line="$(fgrep -v '.\"' "$tmpman" | head -n1)"
 277.664 ++	case "$line" in
 277.665 ++		.so*)
 277.666 ++			link="$(echo "$line" | cut -d'/' -f2)"
 277.667 ++			header	"HTTP/1.1 301 Moved Permanently" \
 277.668 ++					"Location: ?$link"
 277.669 ++			;;
 277.670 ++		*)
 277.671 ++			# Convert page to HTML
 277.672 ++			man2html "$tmpman"
 277.673 ++			;;
 277.674 ++	esac
 277.675 ++
 277.676 ++	# Clean
 277.677 ++	rm "$tmpman"
 277.678 ++else
 277.679 ++	man2html -E "Strange... Cannot find (or read) $PAGE."
 277.680 ++fi
 277.681 ++exit 0
 277.682 +--- a/man2html.c
 277.683 ++++ b/man2html.c
 277.684 +@@ -21,14 +21,17 @@
 277.685 + #include <ctype.h>
 277.686 + #include <sys/stat.h>
 277.687 + #include "defs.h"
 277.688 +-#include "../src/version.h"
 277.689 ++#include "version.h"
 277.690 ++#include <glib.h>
 277.691 ++#include <glib/gi18n.h>
 277.692 ++#define GETTEXT_PACKAGE "man2html"
 277.693 + 
 277.694 + /* BSD mandoc Bd/Ed example(?) blocks */
 277.695 + #define BD_LITERAL  1
 277.696 + #define BD_INDENT   2
 277.697 + 
 277.698 + #define SIZE(a)	(sizeof(a)/sizeof(*a))
 277.699 +-#define DOCTYPE "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
 277.700 ++#define DOCTYPE "<!DOCTYPE html>\n"
 277.701 + #define CONTENTTYPE "Content-type: text/html; charset=UTF-8\n\n"
 277.702 + 
 277.703 + static char NEWLINE[2]="\n";
 277.704 +@@ -58,28 +61,13 @@
 277.705 + 
 277.706 + static char charb[3];
 277.707 + 
 277.708 +-#ifdef GUNZIP
 277.709 +-/* from src/utils.c */
 277.710 +-static int
 277.711 +-is_shell_safe(const char *ss, int quoted) {
 277.712 +-	char *bad = " ;'\\\"<>|";
 277.713 +-	char *p;
 277.714 + 
 277.715 +-	if (quoted)
 277.716 +-		bad++;			/* allow a space inside quotes */
 277.717 +-	for (p = bad; *p; p++)
 277.718 +-		if (strchr(ss, *p))
 277.719 +-			return 0;
 277.720 +-	return 1;
 277.721 +-}
 277.722 +-#endif
 277.723 +-
 277.724 + /* reads the entire manpage into buffer *buf and returns number of chars read */
 277.725 + static int
 277.726 + read_manpage_into_buffer(char *path, char **buf) {
 277.727 + 	int compressed = 0;
 277.728 + 	FILE * f = NULL;
 277.729 +-	char * ext;
 277.730 ++	/* char * ext; */
 277.731 + 	int l = 0;
 277.732 + 	struct stat stbuf;
 277.733 + 
 277.734 +@@ -94,26 +82,6 @@
 277.735 + 		char * tmp = NULL;
 277.736 + 		char * command = NULL;
 277.737 + 		char * openpath = path;
 277.738 +-#ifdef GUNZIP
 277.739 +-
 277.740 +-		if (is_shell_safe(openpath, 1)) {
 277.741 +-			ext = strrchr(openpath, '.');
 277.742 +-			compressed = (ext && !strcmp(ext, ".gz"));
 277.743 +-
 277.744 +-			if (!compressed && stat(openpath, &stbuf)) {
 277.745 +-				tmp = (char*) xmalloc(strlen(path) + 4);
 277.746 +-				sprintf(tmp, "%s.gz", path);
 277.747 +-				if ((compressed = !stat(tmp, &stbuf)))
 277.748 +-					openpath = tmp;
 277.749 +-			}
 277.750 +-		}
 277.751 +-
 277.752 +-		if (compressed) {
 277.753 +-			command = (char*) xmalloc(strlen(openpath) + sizeof(GUNZIP) + 4);
 277.754 +-			sprintf(command, GUNZIP " '%s'", openpath);
 277.755 +-			f = popen(command, "r");
 277.756 +-		} else
 277.757 +-#endif
 277.758 + 			f = fopen(openpath, "r");
 277.759 + 
 277.760 + 		if (tmp) free(tmp);
 277.761 +@@ -170,7 +138,7 @@
 277.762 + 
 277.763 + 	h = chardef;
 277.764 + 	if (h->nr != V('*','*')) {
 277.765 +-		printf("chardef corrupted\n");
 277.766 ++		printf("%s\n", _("chardef corrupted"));
 277.767 + 		exit(1);
 277.768 + 	}
 277.769 + 
 277.770 +@@ -216,7 +184,7 @@
 277.771 +     ** Add the links to the output.
 277.772 +     ** At the moment the following are recognized:
 277.773 +     **
 277.774 +-    ** name(*)                 -> ../man?/name.*
 277.775 ++    ** name(*)                 -> ?name.*
 277.776 +     ** method://string         -> method://string
 277.777 +     ** www.host.name           -> http://www.host.name
 277.778 +     ** ftp.host.name           -> ftp://ftp.host.name
 277.779 +@@ -453,8 +421,8 @@
 277.780 + #define DL	1
 277.781 + #define	UL	2
 277.782 + #define	OL	3
 277.783 +-static char *dl_open[4] = { "", "<DL COMPACT>\n", "<UL>", "<OL>" };
 277.784 +-static char *dl_close[4] = { "", "</DL>\n", "</UL>", "</OL>" };
 277.785 ++static char *dl_open[4] = { "", "<dl compact>\n", "<ul>", "<ol>" };
 277.786 ++static char *dl_close[4] = { "", "</dl>\n", "</ul>", "</ol>" };
 277.787 + 
 277.788 + static inline void
 277.789 + dl_begin(void) {
 277.790 +@@ -462,7 +430,7 @@
 277.791 + 	  out_html(dl_open[DL]);
 277.792 + 	  dl_set[itemdepth]=DL;
 277.793 +      }
 277.794 +-     out_html("<DT>");
 277.795 ++     out_html("<dt>");
 277.796 + }
 277.797 + 
 277.798 + static inline void
 277.799 +@@ -481,14 +449,14 @@
 277.800 +      itemdepth++;
 277.801 +      if (itemdepth < SIZE(dl_set))
 277.802 + 	  dl_set[itemdepth]=noDL;
 277.803 +-     out_html("<DL COMPACT><DT><DD>");
 277.804 ++     out_html("<dl compact><dt><dd>");
 277.805 + }
 277.806 + 
 277.807 + static inline void
 277.808 + dl_endlevel(void) {
 277.809 +      if (itemdepth) {
 277.810 + 	  dl_end();
 277.811 +-	  out_html("</DL>\n");
 277.812 ++	  out_html("</dl>\n");
 277.813 + 	  itemdepth--;
 277.814 +      }
 277.815 + }
 277.816 +@@ -538,12 +506,12 @@
 277.817 + 
 277.818 + #define FO0 ""
 277.819 + #define FC0 ""
 277.820 +-#define FO1 "<I>"
 277.821 +-#define FC1 "</I>"
 277.822 +-#define FO2 "<B>"
 277.823 +-#define FC2 "</B>"
 277.824 +-#define FO3 "<TT>"
 277.825 +-#define FC3 "</TT>"
 277.826 ++#define FO1 "<i>"
 277.827 ++#define FC1 "</i>"
 277.828 ++#define FO2 "<b>"
 277.829 ++#define FC2 "</b>"
 277.830 ++#define FO3 "<tt>"
 277.831 ++#define FC3 "</tt>"
 277.832 + 
 277.833 + char *switchfont[16] = { ""     , FC0 FO1, FC0 FO2, FC0 FO3,
 277.834 + 			 FC1 FO0, ""     , FC1 FO2, FC1 FO3,
 277.835 +@@ -588,14 +556,16 @@
 277.836 +   i=current_font;
 277.837 +   sizebuf[0]=0;
 277.838 +   strcat(sizebuf, change_to_font(0));
 277.839 +-  if (current_size) strcat(sizebuf, "</FONT>");
 277.840 ++  if (current_size) strcat(sizebuf, "</span>");
 277.841 +   current_size=nr;
 277.842 +   if (nr) {
 277.843 +     int l;
 277.844 +-    strcat(sizebuf, "<FONT SIZE=\"");
 277.845 ++    strcat(sizebuf, "<span style=\"font-size: ");
 277.846 +     l=strlen(sizebuf);
 277.847 +     if (nr>0) sizebuf[l++]='+'; else sizebuf[l++]='-',nr=-nr;
 277.848 +     sizebuf[l++]=nr+'0';
 277.849 ++    sizebuf[l++]='p';
 277.850 ++    sizebuf[l++]='t';
 277.851 +     sizebuf[l++]='"';
 277.852 +     sizebuf[l++]='>';
 277.853 +     sizebuf[l]=0;
 277.854 +@@ -775,7 +745,7 @@
 277.855 + 	skip_escape=exskipescape;
 277.856 + 	intresult=j;
 277.857 + 	break;
 277.858 +-    case 'l': h="<HR>"; curpos=0;
 277.859 ++    case 'l': h="<hr>"; curpos=0;
 277.860 +     case 'b':
 277.861 +     case 'v':
 277.862 +     case 'x':
 277.863 +@@ -812,7 +782,7 @@
 277.864 +     case 'c': no_newline_output=1; break;
 277.865 +     case '{': newline_for_fun++; h="";break;
 277.866 +     case '}': if (newline_for_fun) newline_for_fun--; h="";break;
 277.867 +-    case 'p': h="<BR>\n";curpos=0; break;
 277.868 ++    case 'p': h="<br>\n";curpos=0; break;
 277.869 +     case 't': h="\t";curpos=(curpos+8)&0xfff8; break;
 277.870 +     case '<': h="&lt;";curpos++; break;
 277.871 +     case '>': h="&gt;";curpos++; break;
 277.872 +@@ -1021,7 +991,7 @@
 277.873 +     out_html(change_to_size(0));
 277.874 +     if (!fillout) {
 277.875 + 	fillout=1;
 277.876 +-	out_html("</PRE>");
 277.877 ++	out_html("</pre>");
 277.878 +     }
 277.879 +     while (*h && *h!='\n') h++;
 277.880 +     if (h[-1]==';') {
 277.881 +@@ -1197,45 +1167,45 @@
 277.882 + 	currow=currow->prev;
 277.883 +     }
 277.884 +     /* produce html output */
 277.885 +-    if (center) out_html("<CENTER>");
 277.886 +-    if (box==2) out_html("<TABLE BORDER><TR><TD>");
 277.887 +-    out_html("<TABLE");
 277.888 ++    if (center) out_html("<div style=\"margin: 0 auto\">");
 277.889 ++    if (box==2) out_html("<table border><tr><td>");
 277.890 ++    out_html("<table");
 277.891 +     if (box || border) {
 277.892 +-	out_html(" BORDER");
 277.893 +-	if (!border) out_html("><TR><TD><TABLE");
 277.894 +-	if (expand) out_html(" WIDTH=100%");
 277.895 ++	out_html(" border");
 277.896 ++	if (!border) out_html("><tr><td><table");
 277.897 ++	if (expand) out_html(" width=100%");
 277.898 +     }
 277.899 +     out_html(">\n");
 277.900 +     currow=layout;
 277.901 +     while (currow) {
 277.902 + 	j=0;
 277.903 +-	out_html("<TR VALIGN=top>");
 277.904 ++	out_html("<tr style=\"vertical-align: top\">");
 277.905 + 	curfield=currow->first;
 277.906 + 	while (curfield) {
 277.907 + 	    if (curfield->align!='S' && curfield->align!='^') {
 277.908 +-		out_html("<TD");
 277.909 ++		out_html("<td");
 277.910 + 		switch (curfield->align) {
 277.911 + 		case 'N':
 277.912 + 		    curfield->space+=4;
 277.913 + 		case 'R':
 277.914 +-		    out_html(" ALIGN=right");
 277.915 ++		    out_html(" style=\"text-align: right\"");
 277.916 + 		    break;
 277.917 + 		case 'C':
 277.918 +-		    out_html(" ALIGN=center");
 277.919 ++		    out_html(" style=\"text-align: center\"");
 277.920 + 		default:
 277.921 + 		    break;
 277.922 + 		}
 277.923 + 		if (!curfield->valign && curfield->rowspan>1)
 277.924 +-		    out_html(" VALIGN=center");
 277.925 ++		    out_html(" style=\"vertical-align: center\"");
 277.926 + 		if (curfield->colspan>1) {
 277.927 + 		    char buf[5];
 277.928 +-		    out_html(" COLSPAN=");
 277.929 ++		    out_html(" colspan=");
 277.930 + 		    sprintf(buf, "%i", curfield->colspan);
 277.931 + 		    out_html(buf);
 277.932 + 		}
 277.933 + 		if (curfield->rowspan>1) {
 277.934 + 		    char buf[5];
 277.935 +-		    out_html(" ROWSPAN=");
 277.936 ++		    out_html(" rowspan=");
 277.937 + 		    sprintf(buf, "%i", curfield->rowspan);
 277.938 + 		    out_html(buf);
 277.939 + 		}
 277.940 +@@ -1244,8 +1214,8 @@
 277.941 + 		if (curfield->size) out_html(change_to_size(curfield->size));
 277.942 + 		if (curfield->font) out_html(change_to_font(curfield->font));
 277.943 + 		switch (curfield->align) {
 277.944 +-		case '=': out_html("<HR><HR>"); break;
 277.945 +-		case '_': out_html("<HR>"); break;
 277.946 ++		case '=': out_html("<hr><hr>"); break;
 277.947 ++		case '_': out_html("<hr>"); break;
 277.948 + 		default:
 277.949 + 		    if (curfield->contents) out_html(curfield->contents);
 277.950 + 		    break;
 277.951 +@@ -1255,20 +1225,20 @@
 277.952 + 		if (curfield->font) out_html(change_to_font(0));
 277.953 + 		if (curfield->size) out_html(change_to_size(0));
 277.954 + 		if (j>=maxcol && curfield->align>'@' && curfield->align!='_')
 277.955 +-		    out_html("<BR>");
 277.956 +-		out_html("</TD>");
 277.957 ++		    out_html("<br>");
 277.958 ++		out_html("</td>");
 277.959 + 	    }
 277.960 + 	    curfield=curfield->next;
 277.961 + 	}
 277.962 +-	out_html("</TR>\n");
 277.963 ++	out_html("</tr>\n");
 277.964 + 	currow=currow->next;
 277.965 +     }
 277.966 +-    if (box && !border) out_html("</TABLE>");
 277.967 +-    out_html("</TABLE>");
 277.968 +-    if (box==2) out_html("</TABLE>");
 277.969 +-    if (center) out_html("</CENTER>\n");
 277.970 ++    if (box && !border) out_html("</table>");
 277.971 ++    out_html("</table>");
 277.972 ++    if (box==2) out_html("</table>");
 277.973 ++    if (center) out_html("</div>\n");
 277.974 +     else out_html("\n");
 277.975 +-    if (!oldfillout) out_html("<PRE>");
 277.976 ++    if (!oldfillout) out_html("<pre>");
 277.977 +     fillout=oldfillout;
 277.978 +     out_html(change_to_size(oldsize));
 277.979 +     out_html(change_to_font(oldfont));
 277.980 +@@ -1401,7 +1371,7 @@
 277.981 + 		case '&': value = (value && value2); break;
 277.982 + 		case ':': value = (value || value2); break;
 277.983 + 		default: fprintf(stderr,
 277.984 +-				 "man2html: Unknown operator %c.\n", oper);
 277.985 ++				_("man2html: Unknown operator %c.\n"), oper);
 277.986 + 		}
 277.987 + 		oper=0;
 277.988 + 	    }
 277.989 +@@ -1489,42 +1459,42 @@
 277.990 + 
 277.991 + 
 277.992 + char *section_list[] = {
 277.993 +-    "1", "User Commands ",
 277.994 +-    "1C", "User Commands",
 277.995 +-    "1G", "User Commands",
 277.996 +-    "1S", "User Commands",
 277.997 +-    "1V", "User Commands ",
 277.998 +-    "2", "System Calls",
 277.999 +-    "2V", "System Calls",
277.1000 +-    "3", "C Library Functions",
277.1001 +-    "3C", "Compatibility Functions",
277.1002 +-    "3F", "Fortran Library Routines",
277.1003 +-    "3K", "Kernel VM Library Functions",
277.1004 +-    "3L", "Lightweight Processes Library",
277.1005 +-    "3M", "Mathematical Library",
277.1006 +-    "3N", "Network Functions",
277.1007 +-    "3R", "RPC Services Library",
277.1008 +-    "3S", "Standard I/O Functions",
277.1009 +-    "3V", "C Library Functions",
277.1010 +-    "3X", "Miscellaneous Library Functions",
277.1011 +-    "4", "Devices and Network Interfaces",
277.1012 +-    "4F", "Protocol Families",
277.1013 +-    "4I", "Devices and Network Interfaces",
277.1014 +-    "4M", "Devices and Network Interfaces",
277.1015 +-    "4N", "Devices and Network Interfaces",
277.1016 +-    "4P", "Protocols",
277.1017 +-    "4S", "Devices and Network Interfaces",
277.1018 +-    "4V", "Devices and Network Interfaces",
277.1019 +-    "5", "File Formats",
277.1020 +-    "5V", "File Formats",
277.1021 +-    "6", "Games and Demos",
277.1022 +-    "7", "Environments, Tables, and Troff Macros",
277.1023 +-    "7V", "Environments, Tables, and Troff Macros",
277.1024 +-    "8", "Maintenance Commands",
277.1025 +-    "8C", "Maintenance Commands",
277.1026 +-    "8S", "Maintenance Commands",
277.1027 +-    "8V", "Maintenance Commands",
277.1028 +-    "L", "Local Commands",
277.1029 ++    "1",  N_("User Commands"),
277.1030 ++    "1C", N_("User Commands"),
277.1031 ++    "1G", N_("User Commands"),
277.1032 ++    "1S", N_("User Commands"),
277.1033 ++    "1V", N_("User Commands"),
277.1034 ++    "2",  N_("System Calls"),
277.1035 ++    "2V", N_("System Calls"),
277.1036 ++    "3",  N_("C Library Functions"),
277.1037 ++    "3C", N_("Compatibility Functions"),
277.1038 ++    "3F", N_("Fortran Library Routines"),
277.1039 ++    "3K", N_("Kernel VM Library Functions"),
277.1040 ++    "3L", N_("Lightweight Processes Library"),
277.1041 ++    "3M", N_("Mathematical Library"),
277.1042 ++    "3N", N_("Network Functions"),
277.1043 ++    "3R", N_("RPC Services Library"),
277.1044 ++    "3S", N_("Standard I/O Functions"),
277.1045 ++    "3V", N_("C Library Functions"),
277.1046 ++    "3X", N_("Miscellaneous Library Functions"),
277.1047 ++    "4",  N_("Devices and Network Interfaces"),
277.1048 ++    "4F", N_("Protocol Families"),
277.1049 ++    "4I", N_("Devices and Network Interfaces"),
277.1050 ++    "4M", N_("Devices and Network Interfaces"),
277.1051 ++    "4N", N_("Devices and Network Interfaces"),
277.1052 ++    "4P", N_("Protocols"),
277.1053 ++    "4S", N_("Devices and Network Interfaces"),
277.1054 ++    "4V", N_("Devices and Network Interfaces"),
277.1055 ++    "5",  N_("File Formats"),
277.1056 ++    "5V", N_("File Formats"),
277.1057 ++    "6",  N_("Games and Demos"),
277.1058 ++    "7",  N_("Environments, Tables, and Troff Macros"),
277.1059 ++    "7V", N_("Environments, Tables, and Troff Macros"),
277.1060 ++    "8",  N_("Maintenance Commands"),
277.1061 ++    "8C", N_("Maintenance Commands"),
277.1062 ++    "8S", N_("Maintenance Commands"),
277.1063 ++    "8V", N_("Maintenance Commands"),
277.1064 ++    "L",  N_("Local Commands"),
277.1065 + /* for Solaris: 
277.1066 +     "1", "User Commands",
277.1067 +     "1B", "SunOS/BSD Compatibility Package Commands",
277.1068 +@@ -1593,7 +1563,7 @@
277.1069 +     "9s", "DDI and DKI Data Structures",
277.1070 +     "L", "Local Commands",
277.1071 + */
277.1072 +-    NULL, "Misc. Reference Manual Pages",
277.1073 ++    NULL, N_("Misc. Reference Manual Pages"),
277.1074 +     NULL, NULL
277.1075 + };
277.1076 + 
277.1077 +@@ -1604,7 +1574,7 @@
277.1078 + 
277.1079 +     if (!c) return "";
277.1080 +     while (section_list[i] && strcmp(c,section_list[i])) i=i+2;
277.1081 +-    if (section_list[i+1]) return section_list[i+1];
277.1082 ++    if (section_list[i+1]) return _(section_list[i+1]);
277.1083 +     else return c;
277.1084 + }
277.1085 + 
277.1086 +@@ -1636,10 +1606,10 @@
277.1087 +     if (level != subs) {
277.1088 + 	manidx_need(6);
277.1089 + 	if (subs) {
277.1090 +-	    strcpy(manidx+mip, "</DL>\n");
277.1091 ++	    strcpy(manidx+mip, "</dl>\n");
277.1092 + 	    mip += 6;
277.1093 + 	} else {
277.1094 +-	    strcpy(manidx+mip, "<DL>\n");
277.1095 ++	    strcpy(manidx+mip, "<dl>\n");
277.1096 + 	    mip += 5;
277.1097 + 	}
277.1098 +     }
277.1099 +@@ -1647,7 +1617,7 @@
277.1100 + 
277.1101 +     scan_troff(item, 1, &c);
277.1102 +     manidx_need(100 + strlen(c));
277.1103 +-    sprintf(manidx+mip, "<DT><A HREF=\"#%s\">%s</A><DD>\n", label, c);
277.1104 ++    sprintf(manidx+mip, "<dt><a href=\"#%s\">%s</a></dt><dd>\n", label, c);
277.1105 +     if (c) free(c);
277.1106 +     while (manidx[mip]) mip++;
277.1107 + }
277.1108 +@@ -1834,8 +1804,8 @@
277.1109 + 	    }
277.1110 + 	    break;
277.1111 + 	case V('b','r'):
277.1112 +-	    if (still_dd) out_html("<DD>");
277.1113 +-	    else out_html("<BR>\n");
277.1114 ++	    if (still_dd) out_html("<dd>");
277.1115 ++	    else out_html("<br>\n");
277.1116 + 	    curpos=0;
277.1117 + 	    c=c+j;
277.1118 + 	    if (c[0] == escapesym) { c=scan_escape(c+1); }
277.1119 +@@ -1865,17 +1835,17 @@
277.1120 + 	    c=skip_till_newline(c);
277.1121 + 	    /* center next i lines */
277.1122 + 	    if (i>0) {
277.1123 +-		out_html("<CENTER>\n");
277.1124 ++		out_html("<div style=\"margin: 0 auto\">\n");
277.1125 + 		while (i && *c) {
277.1126 + 		    char *line=NULL;
277.1127 + 		    c=scan_troff(c,1, &line);
277.1128 +-		    if (line && strncmp(line, "<BR>", 4)) {
277.1129 ++		    if (line && strncmp(line, "<br>", 4)) {
277.1130 + 			out_html(line);
277.1131 +-			out_html("<BR>\n");
277.1132 ++			out_html("<br>\n");
277.1133 + 			i--;
277.1134 + 		    }
277.1135 + 		}
277.1136 +-		out_html("</CENTER>\n");
277.1137 ++		out_html("</div>\n");
277.1138 + 		curpos=0;
277.1139 + 	    }
277.1140 + 	    break;
277.1141 +@@ -1906,7 +1876,7 @@
277.1142 + 	    if (!fillout) {
277.1143 + 		out_html(change_to_font(0));
277.1144 + 		out_html(change_to_size('0'));
277.1145 +-		out_html("</PRE>\n");
277.1146 ++		out_html("</pre>\n");
277.1147 + 	    }
277.1148 + 	    curpos=0;
277.1149 + 	    fillout=1;
277.1150 +@@ -1981,7 +1951,7 @@
277.1151 + 	    if (fillout) {
277.1152 + 		out_html(change_to_font(0));
277.1153 + 		out_html(change_to_size('0'));
277.1154 +-		out_html("<PRE>\n");
277.1155 ++		out_html("<pre>\n");
277.1156 + 	    }
277.1157 + 	    curpos=0;
277.1158 + 	    fillout=0;
277.1159 +@@ -2002,7 +1972,7 @@
277.1160 + 	    break;
277.1161 + 	case V('s','p'):
277.1162 + 	    c=c+j;
277.1163 +-	    if (fillout) out_html("<P>"); else {
277.1164 ++	    if (fillout) out_html("<p>"); else {
277.1165 + 		out_html(NEWLINE);
277.1166 + 		NEWLINE[0]='\n';
277.1167 + 	    }
277.1168 +@@ -2033,30 +2003,15 @@
277.1169 + 		*c = 0;
277.1170 + 		scan_troff(h,1, &name);
277.1171 + 		if (name[3] == '/') h=name+3; else h=name;
277.1172 +-#if NOCGI
277.1173 +-                if (!out_length) {
277.1174 +-		    char *t,*s;
277.1175 +-		    t=strrchr(fname, '/');
277.1176 +-		    if (!t) t=fname;
277.1177 +-		    fprintf(stderr, "ln -s %s.html %s.html\n", h, t);
277.1178 +-		    s=strrchr(t, '.');if (!s) s=t;
277.1179 +-		    printf(CONTENTTYPE DOCTYPE);
277.1180 +-		    printf("<HTML><HEAD><TITLE> Man page of %s</TITLE>\n"
277.1181 +-			   "</HEAD><BODY>\n"
277.1182 +-			   "See the man page for <A HREF=\"%s.html\">%s</A>.\n"
277.1183 +-			   "</BODY></HTML>\n",
277.1184 +-			   s, h, h);
277.1185 +-		} else
277.1186 +-#endif
277.1187 +                 {
277.1188 + 		    /* this works alright, except for section 3 */
277.1189 + 		    if ((l = read_manpage_into_buffer(h, &buf)) < 0) {
277.1190 + 			 fprintf(stderr,
277.1191 +-				"man2html: unable to open or read file %s\n", h);
277.1192 +-			 out_html("<BLOCKQUOTE>"
277.1193 +-				  "man2html: unable to open or read file\n");
277.1194 ++				_("man2html: unable to open or read file %s\n"), h);
277.1195 ++			 out_html("<blockquote>");
277.1196 ++			 out_html(_("man2html: unable to open or read file\n"));
277.1197 + 			 out_html(h);
277.1198 +-			 out_html("</BLOCKQUOTE>\n");
277.1199 ++			 out_html("</blockquote>\n");
277.1200 + 		    } else {
277.1201 + 			buf[0]=buf[l]='\n';
277.1202 + 			buf[l+1]=buf[l+2]=0;
277.1203 +@@ -2085,7 +2040,7 @@
277.1204 + #if 0
277.1205 + 	    dl_down();
277.1206 + #endif
277.1207 +-	    out_html("<BR>\n");
277.1208 ++	    out_html("<br>\n");
277.1209 + 	    c=c+j;
277.1210 + 	    c=scan_expression(c, &j);
277.1211 + 	    for (i=0; i<j; i++) out_html("&nbsp;");
277.1212 +@@ -2163,7 +2118,7 @@
277.1213 +             if (words) {
277.1214 + 		scan_troff(wordlist[0], 1,NULL);
277.1215 + 	    }
277.1216 +-	    out_html("<DD>");
277.1217 ++	    out_html("<dd>");
277.1218 + 	    curpos = 0;
277.1219 + 	    break;
277.1220 + 	case V('T','P'):
277.1221 +@@ -2172,7 +2127,7 @@
277.1222 + 	    /* somewhere a definition ends with '.TP' */
277.1223 + 	    if (!*c) still_dd=1; else {
277.1224 + 		c=scan_troff(c,1,NULL);
277.1225 +-		out_html("<DD>");
277.1226 ++		out_html("<dd>");
277.1227 + 	    }
277.1228 + 	    curpos=0;
277.1229 + 	    break;
277.1230 +@@ -2195,20 +2150,20 @@
277.1231 + 		 fprintf(idxfile,"\n");
277.1232 + 	    }
277.1233 + #endif
277.1234 +-            out_html("<A NAME=\"");
277.1235 ++            out_html("<span id=\"");
277.1236 + 	    out_html(idxlabel);
277.1237 + 	    /* this will not work in mosaic (due to a bug).
277.1238 + 	    ** Adding '&nbsp;' between '>' and '<' solves it, but creates
277.1239 + 	    ** some space. A normal space does not work.
277.1240 + 	    */
277.1241 +-	    out_html("\"></A>");
277.1242 ++	    out_html("\"></span>");
277.1243 + 	    break;
277.1244 + 	case V('P',' '):
277.1245 + 	case V('P','\n'):
277.1246 + 	case V('L','P'):
277.1247 + 	case V('P','P'):
277.1248 + 	    dl_end();
277.1249 +-	    if (fillout) out_html("<P>\n"); else {
277.1250 ++	    if (fillout) out_html("<p>\n"); else {
277.1251 + 		out_html(NEWLINE);
277.1252 + 		NEWLINE[0]='\n';
277.1253 + 	    }
277.1254 +@@ -2272,19 +2227,29 @@
277.1255 + 	    out_html(change_to_size(0));
277.1256 + 	    if (!fillout) {
277.1257 + 		fillout=1;
277.1258 +-		out_html("</PRE>");
277.1259 ++		out_html("</pre>");
277.1260 + 	    }
277.1261 + 	    trans_char(c,'"', '\a');
277.1262 + 	    add_to_index(mode, c);
277.1263 +-	    out_html("<A NAME=\"");
277.1264 +-	    out_html(label);
277.1265 +-	    /* &nbsp; for mosaic users */
277.1266 +-	    if (mode) out_html("\">&nbsp;</A>\n<H3>");
277.1267 +-	    else out_html("\">&nbsp;</A>\n<H2>");
277.1268 ++
277.1269 ++		if (mode) {
277.1270 ++			out_html("<h3 id=\"");
277.1271 ++			out_html(label);
277.1272 ++			out_html("\">");
277.1273 ++		} else {
277.1274 ++			out_html("</section>\n\n<section id=\"");
277.1275 ++			out_html(label);
277.1276 ++			out_html("\">\n<h2>");
277.1277 ++		}
277.1278 ++
277.1279 + 	    mandoc_synopsis = (strncmp(c, "SYNOPSIS", 8) == 0);
277.1280 + 	    c = (mandoc_command ? scan_troff_mandoc : scan_troff)(c,1,NULL);
277.1281 +-	    if (mode) out_html("</H3>\n");
277.1282 +-	    else out_html("</H2>\n");
277.1283 ++
277.1284 ++		if (mode)
277.1285 ++			out_html("</h3>\n");
277.1286 ++		else
277.1287 ++			out_html("</h2>\n");
277.1288 ++
277.1289 + 	    curpos=0;
277.1290 + 	    break;
277.1291 + 	case V('T','S'):
277.1292 +@@ -2315,7 +2280,7 @@
277.1293 + 		    int skip=0;
277.1294 + 		    output_possible=1;
277.1295 + 		    printf(CONTENTTYPE DOCTYPE);
277.1296 +-		    out_html("<HTML><HEAD><TITLE>Man page of ");
277.1297 ++		    out_html("<html><head>\n<meta charset=\"UTF-8\">\n<title>");
277.1298 + 		    scan_troff(wordlist[0], 0, &t);
277.1299 + 		    /* we need to remove all html tags */
277.1300 + 		    for (s=q=t; *s; s++) {
277.1301 +@@ -2324,11 +2289,14 @@
277.1302 + 		      else if (!skip) *q++ = *s;
277.1303 + 		    }
277.1304 + 		    *q = '\0';
277.1305 +-		    out_html(t);
277.1306 ++		    char buff[256];
277.1307 ++		    sprintf(buff, _("Man page of %s"), t);
277.1308 ++		    out_html(buff);
277.1309 + 		    free(t);
277.1310 +-		    out_html("</TITLE>\n</HEAD><BODY>\n<H1>");
277.1311 ++		    out_html("</title>\n<link rel=\"stylesheet\" href=\"?css\">\n</head><body>\n<header><h1>");
277.1312 + 		    scan_troff(wordlist[0], 0, NULL);
277.1313 +-		    out_html("</H1>\nSection: ");
277.1314 ++		    out_html("</h1></header>\n<section>\n");
277.1315 ++		    out_html(_("Section: "));
277.1316 + 		    if (words>4)
277.1317 + 		    	scan_troff(wordlist[4], 0, NULL);
277.1318 + 		    else
277.1319 +@@ -2336,14 +2304,17 @@
277.1320 + 		    out_html(" (");
277.1321 + 		    scan_troff(wordlist[1], 0, NULL);
277.1322 + 		    if (words>2) {
277.1323 +-			out_html(")<BR>Updated: ");
277.1324 ++			out_html(")<br>");
277.1325 ++			out_html(_("Updated: "));
277.1326 + 			scan_troff(wordlist[2], 1, NULL);
277.1327 + 		    } else out_html(")");
277.1328 +-		    out_html("<BR><A HREF=\"#index\">Index</A>\n");
277.1329 ++		    out_html("<br><a href=\"#index\">");
277.1330 ++		    out_html(_("Index"));
277.1331 ++		    out_html("</a>\n");
277.1332 + 		    man_page_html(0,0);	/* Return to Main Contents */
277.1333 + 		    *sl='\n';
277.1334 +-		    out_html("<HR>\n");
277.1335 +-		    if (mandoc_command) out_html("<BR>BSD mandoc<BR>");
277.1336 ++		    out_html("<hr>\n");
277.1337 ++		    if (mandoc_command) out_html("<br>\nBSD mandoc<br>");
277.1338 + 		}
277.1339 + 		c = sl+1;
277.1340 + 	    } else
277.1341 +@@ -2507,7 +2478,7 @@
277.1342 + 		 dl_newlevel_type(DL);
277.1343 + 	    if (nl)
277.1344 + 		 *nl = t;
277.1345 +-	    if (fillout) out_html("<P>\n"); else {
277.1346 ++	    if (fillout) out_html("<p>\n"); else {
277.1347 + 		 out_html(NEWLINE);
277.1348 + 		 NEWLINE[0]='\n';
277.1349 + 	    }
277.1350 +@@ -2518,7 +2489,7 @@
277.1351 + 	case V('E','l'):	/* BSD mandoc */
277.1352 + 	     c=c+j;
277.1353 + 	     dl_endlevel_type();
277.1354 +-	     if (fillout) out_html("<P>\n"); else {
277.1355 ++	     if (fillout) out_html("<p>\n"); else {
277.1356 + 		  out_html(NEWLINE);
277.1357 + 		  NEWLINE[0]='\n';
277.1358 + 	     }
277.1359 +@@ -2528,7 +2499,7 @@
277.1360 + 	case V('I','t'):	/* BSD mandoc */
277.1361 + 	     c=c+j;
277.1362 + 	     if (dl_type(DL)) {
277.1363 +-		  out_html("<DT>");
277.1364 ++		  out_html("<dt>");
277.1365 + 		  out_html(change_to_font('B'));
277.1366 + 		  if (*c == '\n') {
277.1367 + 		       /* Don't allow embedded comms after a newline */
277.1368 +@@ -2543,9 +2514,9 @@
277.1369 + 		  if (inXo)
277.1370 + 		       still_dd = 1;
277.1371 + 		  else
277.1372 +-		       out_html("<DD>");
277.1373 ++		       out_html("<dd>");
277.1374 + 	     } else if (dl_type(UL) || dl_type(OL)) {
277.1375 +-		  out_html("<LI>");
277.1376 ++		  out_html("<li>");
277.1377 + 		  c=scan_troff_mandoc(c,1,NULL);
277.1378 + 		  out_html(NEWLINE);
277.1379 + 	     }
277.1380 +@@ -2559,7 +2530,7 @@
277.1381 + 	     c=c+j;
277.1382 + 	     if (inXo) {
277.1383 + 		  if (still_dd)
277.1384 +-		       out_html("<DD>");
277.1385 ++		       out_html("<dd>");
277.1386 + 		  inXo = 0;
277.1387 + 	     }
277.1388 + 	     break;
277.1389 +@@ -2594,12 +2565,12 @@
277.1390 + 	case V('D','l'):	/* BSD mandoc */
277.1391 + 	     c=c+j;
277.1392 + 	     out_html(NEWLINE);
277.1393 +-	     out_html("<BLOCKQUOTE>");	    
277.1394 ++	     out_html("<blockquote>");	    
277.1395 + 	     out_html(change_to_font('L'));
277.1396 + 	     if (*c == '\n') c++;
277.1397 + 	     c=scan_troff_mandoc(c, 1, NULL);	    
277.1398 + 	     out_html(change_to_font('R'));
277.1399 +-	     out_html("</BLOCKQUOTE>");	    
277.1400 ++	     out_html("</blockquote>");	    
277.1401 + 	     if (fillout) curpos++; else curpos=0;
277.1402 + 	     break;
277.1403 + 	case V('B','d'):	/* BSD mandoc */
277.1404 +@@ -2615,14 +2586,14 @@
277.1405 + 	     mandoc_bd_options = 0; /* Remember options for terminating Bl */
277.1406 + 	     if (strstr(c, "-offset indent")) {
277.1407 + 		  mandoc_bd_options |= BD_INDENT;
277.1408 +-		  out_html("<BLOCKQUOTE>\n");
277.1409 ++		  out_html("<blockquote>\n");
277.1410 + 	     }
277.1411 + 	     if (strstr(c, "-literal") || strstr(c, "-unfilled")) {
277.1412 + 		  if (fillout) {
277.1413 + 		       mandoc_bd_options |= BD_LITERAL;
277.1414 + 		       out_html(change_to_font(0));
277.1415 + 		       out_html(change_to_size('0'));
277.1416 +-		       out_html("<PRE>\n");
277.1417 ++		       out_html("<pre>\n");
277.1418 + 		  }
277.1419 + 		  curpos=0;
277.1420 + 		  fillout=0;
277.1421 +@@ -2637,18 +2608,18 @@
277.1422 + 		  if (!fillout) {
277.1423 + 		       out_html(change_to_font(0));
277.1424 + 		       out_html(change_to_size('0'));
277.1425 +-		       out_html("</PRE>\n");
277.1426 ++		       out_html("</pre>\n");
277.1427 + 		  }
277.1428 + 	     }
277.1429 + 	     if (mandoc_bd_options & BD_INDENT)
277.1430 +-		  out_html("</BLOCKQUOTE>\n");
277.1431 ++		  out_html("</blockquote>\n");
277.1432 + 	     curpos=0;
277.1433 + 	     fillout=1;
277.1434 + 	     c=skip_till_newline(c);
277.1435 + 	     break;
277.1436 + 	case V('B','e'):	/* BSD mandoc */
277.1437 + 	     c=c+j;
277.1438 +-	     if (fillout) out_html("<P>"); else {
277.1439 ++	     if (fillout) out_html("<p>"); else {
277.1440 + 		  out_html(NEWLINE);
277.1441 + 		  NEWLINE[0]='\n';
277.1442 + 	     }
277.1443 +@@ -2715,7 +2686,7 @@
277.1444 + 	     if (fillout) curpos++; else curpos=0;
277.1445 + 	     break;
277.1446 + 	case V('P','p'):	/* BSD mandoc */
277.1447 +-	     if (fillout) out_html("<P>\n"); else {
277.1448 ++	     if (fillout) out_html("<p>\n"); else {
277.1449 + 		  out_html(NEWLINE);
277.1450 + 		  NEWLINE[0]='\n';
277.1451 + 	     }
277.1452 +@@ -2726,9 +2697,9 @@
277.1453 + 	     trans_char(c,'"','\a');
277.1454 + 	     c=c+j;
277.1455 + 	     if (*c == '\n') c++;
277.1456 +-	     out_html("``");
277.1457 ++	     out_html("“");
277.1458 + 	     c=scan_troff_mandoc(c, 1, NULL);
277.1459 +-	     out_html("''");
277.1460 ++	     out_html("”");
277.1461 + 	     out_html(NEWLINE);
277.1462 + 	     if (fillout) curpos++; else curpos=0;
277.1463 + 	     break;
277.1464 +@@ -2800,12 +2771,22 @@
277.1465 + 	     trans_char(c,'"','\a');
277.1466 + 	     c=c+j;
277.1467 + 	     if (*c == '\n') c++;
277.1468 +-	     out_html("`");
277.1469 ++	     out_html("‘");
277.1470 + 	     c=scan_troff_mandoc(c, 1, NULL);
277.1471 +-	     out_html("'");
277.1472 ++	     out_html("’");
277.1473 + 	     out_html(NEWLINE);
277.1474 + 	     if (fillout) curpos++; else curpos=0;
277.1475 + 	     break;
277.1476 ++	case V('A','q'):	/* BSD mandoc */
277.1477 ++	     trans_char(c,'"','\a');
277.1478 ++	     c=c+j;
277.1479 ++	     if (*c == '\n') c++;
277.1480 ++	     out_html("⟨");
277.1481 ++	     c=scan_troff_mandoc(c, 1, NULL);
277.1482 ++	     out_html("⟩");
277.1483 ++	     out_html(NEWLINE);
277.1484 ++	     if (fillout) curpos++; else curpos=0;
277.1485 ++	     break;
277.1486 + 	case V('A','r'):	/* BSD mandoc */
277.1487 + 	     /* parse one line in italics */
277.1488 + 	     out_html(change_to_font('I'));
277.1489 +@@ -2855,7 +2836,7 @@
277.1490 + 		   */
277.1491 + 		  static int count = 0; /* Don't break on the first Nm */
277.1492 + 		  if (count) {
277.1493 +-		       out_html("<BR>");
277.1494 ++		       out_html("<br>");
277.1495 + 		  } else {
277.1496 + 		       char *end, t=0 /* just for gcc */;
277.1497 + 		       end = strchr(c, '\n');
277.1498 +@@ -3038,7 +3019,7 @@
277.1499 + 	    if (h[-1] == '\n' && still_dd && isalnum(*h)) {
277.1500 + 		/* sometimes a .HP request is not followed by a .br request */
277.1501 + 		FLUSHIBP;
277.1502 +-		out_html("<DD>");
277.1503 ++		out_html("<dd>");
277.1504 + 		curpos=0;
277.1505 + 		still_dd=0;
277.1506 + 	    }
277.1507 +@@ -3108,12 +3089,12 @@
277.1508 + 				curpos++;
277.1509 + 			    }
277.1510 + 			} else {
277.1511 +-			    out_html("<TT>");
277.1512 ++			    out_html("<tt>");
277.1513 + 			    while (curpos < tabstops[curtab]) {
277.1514 + 				out_html("&nbsp;");
277.1515 + 				curpos++;
277.1516 + 			    }
277.1517 +-			    out_html("</TT>");
277.1518 ++			    out_html("</tt>");
277.1519 + 			}
277.1520 + 		    }
277.1521 + 		}
277.1522 +@@ -3122,7 +3103,7 @@
277.1523 + 		if (*h == ' ' && (h[-1] == '\n' || usenbsp)) {
277.1524 + 		    FLUSHIBP;
277.1525 + 		    if (!usenbsp && fillout) {
277.1526 +-			out_html("<BR>");
277.1527 ++			out_html("<br>");
277.1528 + 			curpos=0;
277.1529 + 		    }
277.1530 + 		    usenbsp=fillout;
277.1531 +@@ -3196,13 +3177,13 @@
277.1532 + 
277.1533 +      switch(status) {
277.1534 + 	case 403:
277.1535 +-		printf("Status: 403 Forbidden\n");
277.1536 ++		printf("HTTP/1.1 403 Forbidden\n");
277.1537 + 		break;
277.1538 + 	case 404:
277.1539 +-		printf("Status: 404 Not Found\n");
277.1540 ++		printf("HTTP/1.1 404 Not Found\n");
277.1541 + 		break;
277.1542 + 	case 500:
277.1543 +-		printf("Status: 500 Internal Server Error\n");
277.1544 ++		printf("HTTP/1.1 500 Internal Server Error\n");
277.1545 + 		break;
277.1546 + 	case 0:
277.1547 + 	default:
277.1548 +@@ -3210,12 +3191,13 @@
277.1549 +      }
277.1550 + 	     
277.1551 +      printf(CONTENTTYPE DOCTYPE);
277.1552 +-     printf("<HTML><HEAD><TITLE>%s</TITLE></HEAD>\n"
277.1553 +-	    "<BODY>\n<H1>%s</H1>\n", s, s);
277.1554 ++     printf("<html>\n<head>\n<meta charset=\"UTF-8\">\n<title>%s</title>\n"
277.1555 ++     	"<link rel=\"stylesheet\" href=\"?css\">\n</head>\n"
277.1556 ++	    "<body>\n<header><h1>%s</h1></header>\n<section>\n", s, s);
277.1557 +      va_start(p, t);
277.1558 +      vfprintf(stdout, t, p);
277.1559 +      va_end(p);
277.1560 +-     printf("</BODY></HTML>\n");
277.1561 ++     printf("</section>\n</body></html>\n");
277.1562 +      exit(0);
277.1563 + }
277.1564 + 
277.1565 +@@ -3223,8 +3205,8 @@
277.1566 + xstrdup(const char *s) {
277.1567 +      char *p = strdup(s);
277.1568 +      if (p == NULL)
277.1569 +-	  error_page(500, "Out of memory",
277.1570 +-			 "Sorry, out of memory, aborting...\n");
277.1571 ++	  error_page(500, _("Out of memory"),
277.1572 ++			_("Sorry, out of memory, aborting...\n"));
277.1573 +      return p;
277.1574 + }
277.1575 + 
277.1576 +@@ -3232,8 +3214,8 @@
277.1577 + xmalloc(size_t size) {
277.1578 +      void *p = malloc(size);
277.1579 +      if (p == NULL)
277.1580 +-	  error_page(500, "Out of memory",
277.1581 +-			 "Sorry, out of memory, aborting...\n");
277.1582 ++	  error_page(500, _("Out of memory"),
277.1583 ++			_("Sorry, out of memory, aborting...\n"));
277.1584 +      return p;
277.1585 + }
277.1586 + 
277.1587 +@@ -3241,16 +3223,16 @@
277.1588 + xrealloc(void *ptr, size_t size) {
277.1589 +      void *p = realloc(ptr,size);
277.1590 +      if (p == NULL)
277.1591 +-	  error_page(500, "Out of memory",
277.1592 +-			 "Sorry, out of memory, aborting...\n");
277.1593 ++	  error_page(500, _("Out of memory"),
277.1594 ++			_("Sorry, out of memory, aborting...\n"));
277.1595 +      return p;
277.1596 + }
277.1597 + 
277.1598 + static void
277.1599 + usage(void) {
277.1600 +-     error_page(500, "man2html: bad invocation",
277.1601 +-	"Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n"
277.1602 +-	"or:   man2html -r [filename]\n");
277.1603 ++     error_page(500, _("man2html: bad invocation"),
277.1604 ++	_("Call: man2html [-l|-h host.domain:port] [-p|-q] [filename]\n"
277.1605 ++	"or:   man2html -r [filename]\n"));
277.1606 + }
277.1607 + 
277.1608 + static void
277.1609 +@@ -3273,7 +3255,7 @@
277.1610 + 	       }
277.1611 + #if 0
277.1612 + 	       else  /* complain or not - this need not be fatal */
277.1613 +-		    error_page("Error", "man2html: could not chdir to %s", s);
277.1614 ++		    error_page(_("Error"), _("man2html: could not chdir to %s"), s);
277.1615 + #endif
277.1616 + 	  }
277.1617 +      }
277.1618 +@@ -3291,6 +3273,11 @@
277.1619 +  */
277.1620 + int
277.1621 + main(int argc, char **argv) {
277.1622 ++	setlocale (LC_ALL, "");
277.1623 ++	bindtextdomain (GETTEXT_PACKAGE, "/usr/share/locale");
277.1624 ++	bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
277.1625 ++	textdomain (GETTEXT_PACKAGE);
277.1626 ++
277.1627 +     int l, c;
277.1628 +     char *buf, *filename, *fnam = NULL;
277.1629 + 
277.1630 +@@ -3309,7 +3296,7 @@
277.1631 + 	 case 'D':
277.1632 + 	      goto_dir(optarg, 0, 0); break;
277.1633 + 	 case 'E':
277.1634 +-	      error_page(0, "Error", "%s", optarg); break;
277.1635 ++	      error_page(0, _("Error"), "%s", optarg); break;
277.1636 + 	 case 'h':
277.1637 + 	      set_cgibase("localhost"); break;
277.1638 + 	 case 'H':
277.1639 +@@ -3362,7 +3349,7 @@
277.1640 + 
277.1641 +     l = read_manpage_into_buffer(fnam, &buf);
277.1642 +     if (l < 0)
277.1643 +-    	error_page(404, "File not found", "Could not open %s\n", fname);
277.1644 ++    	error_page(404, _("File not found"), _("Could not open %s\n"), fname);
277.1645 + 
277.1646 +     buf[0] = '\n';
277.1647 +     buf[l+1] = '\n';
277.1648 +@@ -3379,34 +3366,34 @@
277.1649 +     out_html(change_to_size(0));
277.1650 +     if (!fillout) {
277.1651 + 	fillout=1;
277.1652 +-	out_html("</PRE>");
277.1653 ++	out_html("</pre>");
277.1654 +     }
277.1655 +     out_html(NEWLINE);
277.1656 +     if (output_possible) {
277.1657 + 	/* &nbsp; for mosaic users */
277.1658 + 	if (manidx) {
277.1659 +-	    printf("<HR>\n<A NAME=\"index\">&nbsp;</A><H2>Index</H2>\n<DL>\n");
277.1660 ++	    printf("</section>\n\n<section id=\"index\">\n<h2>%s</h2>\n\n<dl>\n", _("Index"));
277.1661 + 	    manidx[mip]=0;
277.1662 + 	    printf("%s", manidx);
277.1663 +-	    if (subs) printf("</DL>\n");
277.1664 +-	    printf("</DL>\n");
277.1665 ++	    if (subs) printf("</dl>\n");
277.1666 ++	    printf("</dl>\n");
277.1667 + 	}
277.1668 + 	print_sig();
277.1669 +-	printf("</BODY>\n</HTML>\n");
277.1670 ++	printf("</body>\n</html>\n");
277.1671 +     } else {
277.1672 + 	if (!filename)
277.1673 + 	     filename = fname;
277.1674 + 	if (*filename == '/')
277.1675 +-	     error_page(403, "Invalid Man Page",
277.1676 +-		   "The requested file %s is not a valid (unformatted) "
277.1677 ++	     error_page(403, _("Invalid Man Page"),
277.1678 ++		 _("The requested file %s is not a valid (unformatted) "
277.1679 + 		   "man page.\nIf the file is a formatted man page, "
277.1680 + 		   "you could try to load the\n"
277.1681 +-		   "<A HREF=\"file://%s\">plain file</A>.\n",
277.1682 ++		   "<a href=\"file://%s\">plain file</a>.\n"),
277.1683 + 		   filename, filename);
277.1684 + 	else
277.1685 +-	     error_page(403, "Invalid Man Page",
277.1686 +-		   "The requested file %s is not a valid (unformatted) "
277.1687 +-		   "man page.", filename);
277.1688 ++	     error_page(403, _("Invalid Man Page"),
277.1689 ++		 _("The requested file %s is not a valid (unformatted) "
277.1690 ++		   "man page."), filename);
277.1691 +     }
277.1692 +     if (idxfile)
277.1693 + 	 fclose(idxfile);
277.1694 +--- a/scripts/cgi-bin/man/man2html
277.1695 ++++ b/scripts/cgi-bin/man/man2html
277.1696 +@@ -8,11 +8,11 @@
277.1697 + 
277.1698 + # Do we need lynxcgi URLs? For the moment our criterion is
277.1699 + # 1) HTTP_USER_AGENT=Lynx*  and 2) HTTP_HOST is unset.
277.1700 +-AGENT="${HTTP_USER_AGENT-unknown}"
277.1701 ++AGENT="${HTTP_USER_AGENT:-unknown}"
277.1702 + 
277.1703 + case "$AGENT" in
277.1704 +     Lynx*|lynx*)
277.1705 +-	HH="${HTTP_HOST-nohh}"
277.1706 ++	HH="${HTTP_HOST:-nohh}"
277.1707 + 	SED="s/%lynx //"
277.1708 + 	;;
277.1709 +     *)
277.1710 +@@ -21,7 +21,7 @@
277.1711 + 	;;
277.1712 + esac
277.1713 + 
277.1714 +-SERVER="${SERVER_NAME-localhost}"
277.1715 ++SERVER="${SERVER_NAME:-localhost}"
277.1716 + case "$HH" in
277.1717 +     nohh)
277.1718 + 	LL="-l"
277.1719 +--- a/scripts/cgi-bin/man/mansearch
277.1720 ++++ b/scripts/cgi-bin/man/mansearch
277.1721 +@@ -7,11 +7,11 @@
277.1722 + 
277.1723 + # Do we need lynxcgi URLs? For the moment our criterion is
277.1724 + # 1) HTTP_USER_AGENT=Lynx*  and 2) HTTP_HOST is unset.
277.1725 +-AGENT="${HTTP_USER_AGENT-unknown}"
277.1726 ++AGENT="${HTTP_USER_AGENT:-unknown}"
277.1727 + 
277.1728 + case "$AGENT" in
277.1729 +     Lynx*|lynx*)
277.1730 +-	HH="${HTTP_HOST-nohh}"
277.1731 ++	HH="${HTTP_HOST:-nohh}"
277.1732 + 	SED="s/%lynx //"
277.1733 + 	;;
277.1734 +     *)
277.1735 +@@ -20,7 +20,7 @@
277.1736 + 	;;
277.1737 + esac
277.1738 + 
277.1739 +-SERVER="${SERVER_NAME-localhost}"
277.1740 ++SERVER="${SERVER_NAME:-localhost}"
277.1741 + case "$HH" in
277.1742 +     nohh)
277.1743 + 	CG="lynxcgi:/usr/lib/cgi-bin/man"
277.1744 +--- a/scripts/cgi-bin/man/mansearchhelp
277.1745 ++++ b/scripts/cgi-bin/man/mansearchhelp
277.1746 +@@ -4,17 +4,17 @@
277.1747 + 
277.1748 + # Do we need lynxcgi URLs? For the moment our criterion is
277.1749 + # 1) HTTP_USER_AGENT=Lynx*  and 2) HTTP_HOST is unset.
277.1750 +-AGENT="${HTTP_USER_AGENT-unknown}"
277.1751 ++AGENT="${HTTP_USER_AGENT:-unknown}"
277.1752 + case "$AGENT" in
277.1753 +     Lynx*|lynx*)
277.1754 +-	HH="${HTTP_HOST-nohh}"
277.1755 ++	HH="${HTTP_HOST:-nohh}"
277.1756 + 	;;
277.1757 +     *)
277.1758 + 	HH=nolynx
277.1759 + 	;;
277.1760 + esac
277.1761 + 
277.1762 +-SERVER="${SERVER_NAME-localhost}"
277.1763 ++SERVER="${SERVER_NAME:-localhost}"
277.1764 + case "$HH" in
277.1765 +     nohh)
277.1766 + 	CG="lynxcgi:/usr/lib/cgi-bin/man"
277.1767 +--- a/strdefs.c
277.1768 ++++ b/strdefs.c
277.1769 +@@ -27,266 +27,333 @@
277.1770 +     { V('.','V'), 1,     0, NULL }, /* the me package tests for this */
277.1771 +     { 0, 0, 0, NULL } };
277.1772 + 
277.1773 ++
277.1774 ++/* Characters written according to http://mdocml.bsd.lv/man/mandoc_char.7.html */
277.1775 ++
277.1776 + static STRDEF standardstring[] = {
277.1777 +-    { V('<','='), 2, "&lt;=", NULL  }, /* less equal */
277.1778 +-    { V('>','='), 2, "&gt=;", NULL  }, /* greather equal */
277.1779 +-    { V('A','m'), 1, "&amp;", NULL  }, /* infinity */
277.1780 +-    { V('B','a'), 1, "|", NULL  }, /* vartical bar */
277.1781 +-    { V('G','e'), 2, "&gt=;", NULL  }, /* greather equal */
277.1782 +-    { V('G','t'), 1, "&gt;", NULL  }, /* greather than */
277.1783 +-    { V('I','f'), 1, "&infin;", NULL  }, /* infinity */
277.1784 +-    { V('L','e'), 2, "&lt;=", NULL  }, /* less equal */
277.1785 +-    { V('L','q'), 1, "&ldquo;", NULL  }, /* left double quote  */
277.1786 +-    { V('L','t'), 1, "&lt;", NULL  }, /* less than */
277.1787 +-    { V('N','a'), 3, "NaN", NULL  }, /* not a number */
277.1788 +-    { V('N','e'), 2, "!=", NULL  }, /* not equal */
277.1789 +-    { V('P','i'), 2, "Pi", NULL  }, /* pi */
277.1790 +-    { V('P','m'), 1, "&plusmn;", NULL  }, /* plus minus */
277.1791 +-    { V('R',' '), 1, "&#174;", NULL },
277.1792 +-    { V('R','q'), 1, "&rdquo;", NULL  }, /* right double quote  */
277.1793 +-    { V('a','a'), 1, "'", NULL  }, /* accute accent  */
277.1794 +-    { V('g','a'), 1, "`", NULL  }, /* grave accent  */
277.1795 +-    { V('l','q'), 2, "``", NULL },
277.1796 +-    { V('q',' '), 1, "&quot;", NULL  }, /* straight double quote  */
277.1797 +-    { V('r','q'), 2, "''", NULL },
277.1798 +-    { V('u','a'), 1, "^", NULL  }, /* upwards arrow  */
277.1799 ++    { V('<','='), 1, "≤",        NULL },	/* less-than-equal */
277.1800 ++    { V('>','='), 1, "≥",        NULL },	/* greater-than-equal */
277.1801 ++    { V('A','i'), 4, "ANSI",     NULL },	/* ANSI standard name */
277.1802 ++    { V('A','m'), 1, "&amp;",    NULL },	/* ampersand */
277.1803 ++    { V('B','a'), 1, "|",        NULL },	/* vertical bar */
277.1804 ++    { V('G','e'), 1, "≥",        NULL },	/* greater-than-equal */
277.1805 ++    { V('G','t'), 1, "&gt;",     NULL },	/* greater-than */
277.1806 ++    { V('I','f'), 8, "infinity", NULL },	/* infinity */
277.1807 ++    { V('L','e'), 1, "≤",        NULL },	/* less-than-equal */
277.1808 ++    { V('L','q'), 1, "“",        NULL },	/* left-double-quote */
277.1809 ++    { V('L','t'), 1, "&lt;",     NULL },	/* less-than */
277.1810 ++    { V('N','a'), 3, "NaN",      NULL },	/* NaN  */
277.1811 ++    { V('N','e'), 1, "≠",        NULL },	/* not equal */
277.1812 ++    { V('P','i'), 2, "pi",       NULL },	/* pi */
277.1813 ++    { V('P','m'), 1, "±",        NULL },	/* plus-minus */
277.1814 ++    { V('P','x'), 5, "POSIX",    NULL },	/* POSIX standard name */
277.1815 ++    { V('R',' '), 1, "®",        NULL },	/* restricted mark */
277.1816 ++    { V('R','q'), 1, "”",        NULL },	/* right-double-quote */
277.1817 ++    { V('T','m'), 4, "(Tm)",     NULL },	/* trade mark */
277.1818 ++    { V('a','a'), 1, "´",        NULL },	/* acute */
277.1819 ++    { V('g','a'), 1, "`",        NULL },	/* grave */
277.1820 ++    { V('l','p'), 1, "(",        NULL },	/* left-parenthesis */
277.1821 ++    { V('l','q'), 1, "“",        NULL },	/* left double-quote */
277.1822 ++    { V('q',' '), 1, "&quot;",   NULL },	/* double-quote */
277.1823 ++    { V('r','p'), 1, ")",        NULL },	/* right-parenthesis */
277.1824 ++    { V('r','q'), 1, "”",        NULL },	/* right double-quote */
277.1825 ++    { V('u','a'), 1, "↑",        NULL },	/* up-arrow */
277.1826 ++    { V('v','a'), 1, "↕",        NULL },	/* up-down arrow */
277.1827 +     { 0, 0, NULL, NULL}
277.1828 + };
277.1829 + 
277.1830 + static STRDEF standardchar[] = {
277.1831 +-    { V('*','*'), 1, "*", NULL  },	/* math star */
277.1832 +-    { V('*','A'), 1, "&Alpha;", NULL },
277.1833 +-    { V('*','B'), 1, "&Beta;", NULL },
277.1834 +-    { V('*','C'), 1, "&Xi;", NULL },
277.1835 +-    { V('*','D'), 1, "&Delta;", NULL },
277.1836 +-    { V('*','E'), 1, "&Epsilon;", NULL },
277.1837 +-    { V('*','F'), 1, "&Phi;", NULL },
277.1838 +-    { V('*','G'), 1, "&Gamma;", NULL },
277.1839 +-    { V('*','H'), 1, "&Theta;", NULL },
277.1840 +-    { V('*','I'), 1, "&Iota;", NULL },
277.1841 +-    { V('*','K'), 1, "&Kappa;", NULL },
277.1842 +-    { V('*','L'), 1, "&Lambda;", NULL },
277.1843 +-    { V('*','M'), 1, "&Mu;", NULL },
277.1844 +-    { V('*','N'), 1, "&Nu;", NULL },
277.1845 +-    { V('*','O'), 1, "&Omicron;", NULL },
277.1846 +-    { V('*','P'), 1, "&Pi;", NULL },
277.1847 +-    { V('*','Q'), 1, "&Psi;", NULL },
277.1848 +-    { V('*','R'), 1, "&Rho;", NULL },
277.1849 +-    { V('*','S'), 1, "&Sigma;", NULL },
277.1850 +-    { V('*','T'), 1, "&Tau;", NULL },
277.1851 +-    { V('*','U'), 1, "&Upsilon;", NULL },
277.1852 +-    { V('*','W'), 1, "&Omega;", NULL },
277.1853 +-    { V('*','X'), 1, "&Chi;", NULL },
277.1854 +-    { V('*','Y'), 1, "&Eta;", NULL },
277.1855 +-    { V('*','Z'), 1, "&Zeta;", NULL },
277.1856 +-    { V('*','a'), 1, "&alpha;", NULL },
277.1857 +-    { V('*','b'), 1, "&beta;", NULL },
277.1858 +-    { V('*','c'), 1, "&xi;", NULL },
277.1859 +-    { V('*','d'), 1, "&delta;", NULL },
277.1860 +-    { V('*','e'), 1, "&epsilon;", NULL },
277.1861 +-    { V('*','f'), 1, "&phi;", NULL },
277.1862 +-    { V('*','g'), 1, "&gamma;", NULL },
277.1863 +-    { V('*','h'), 1, "&theta;", NULL },
277.1864 +-    { V('*','i'), 1, "&iota;", NULL },
277.1865 +-    { V('*','k'), 1, "&kappa;", NULL },
277.1866 +-    { V('*','l'), 1, "&lambda;", NULL },
277.1867 +-    { V('*','m'), 1, "&mu;", NULL },
277.1868 +-    { V('*','n'), 1, "&nu;", NULL },
277.1869 +-    { V('*','o'), 1, "&omicron;", NULL },
277.1870 +-    { V('*','p'), 1, "&pi;", NULL },
277.1871 +-    { V('*','q'), 1, "&psi;", NULL },
277.1872 +-    { V('*','r'), 1, "&rho;", NULL },
277.1873 +-    { V('*','s'), 1, "&sigma;", NULL },
277.1874 +-    { V('*','t'), 1, "&tau;", NULL },
277.1875 +-    { V('*','u'), 1, "&upsilon;", NULL },
277.1876 +-    { V('*','w'), 1, "&omega;", NULL },
277.1877 +-    { V('*','x'), 1, "&chi;", NULL },
277.1878 +-    { V('*','y'), 1, "&eta;", NULL },
277.1879 +-    { V('*','z'), 1, "&zeta;", NULL },
277.1880 +-    { V('\'','A'), 1, "&Aacute;", NULL },
277.1881 +-    { V('\'','E'), 1, "&Eacute;", NULL },
277.1882 +-    { V('\'','I'), 1, "&Iacute;", NULL },
277.1883 +-    { V('\'','O'), 1, "&Oacute;", NULL },
277.1884 +-    { V('\'','U'), 1, "&Uacute;", NULL },
277.1885 +-    { V('\'','Y'), 1, "&Yacute;", NULL },
277.1886 +-    { V('\'','a'), 1, "&aacute;", NULL },
277.1887 +-    { V('\'','e'), 1, "&eacute;", NULL },
277.1888 +-    { V('\'','i'), 1, "&iacute;", NULL },
277.1889 +-    { V('\'','o'), 1, "&oacute;", NULL },
277.1890 +-    { V('\'','u'), 1, "&uacute;", NULL },
277.1891 +-    { V('\'','y'), 1, "&yacute;", NULL },
277.1892 +-    { V('!','='), 1, "&ne;", NULL },
277.1893 +-    { V('%','0'), 1, "&permil;", NULL },
277.1894 +-    { V('+','-'), 1, "&plusmn;", NULL },
277.1895 +-    { V(',','C'), 1, "&Ccedil;", NULL },
277.1896 +-    { V(',','c'), 1, "&ccedil;", NULL },
277.1897 +-    { V('-','>'), 1, "&rarr;", NULL },
277.1898 +-    { V('-','D'), 1, "&ETH;", NULL },
277.1899 +-    { V('.','i'), 1, "&#x131;", NULL },
277.1900 +-    { V('/','L'), 1, "&#x141;", NULL },
277.1901 +-    { V('/','O'), 1, "&Oslash;", NULL },
277.1902 +-    { V('/','l'), 1, "&#x142;", NULL },
277.1903 +-    { V('/','o'), 1, "&oslash;", NULL },
277.1904 +-    { V('1','2'), 1, "&#189;", NULL  },
277.1905 +-    { V('1','4'), 1, "&#188;", NULL  },
277.1906 +-    { V('3','4'), 1, "&#190;", NULL  },
277.1907 +-    { V(':','A'), 1, "&Auml;", NULL },
277.1908 +-    { V(':','E'), 1, "&Euml;", NULL },
277.1909 +-    { V(':','I'), 1, "&Iuml;", NULL },
277.1910 +-    { V(':','O'), 1, "&Ouml;", NULL },
277.1911 +-    { V(':','U'), 1, "&Uuml;", NULL },
277.1912 +-    { V(':','a'), 1, "&auml;", NULL },
277.1913 +-    { V(':','e'), 1, "&euml;", NULL },
277.1914 +-    { V(':','i'), 1, "&iuml;", NULL },
277.1915 +-    { V(':','o'), 1, "&ouml;", NULL },
277.1916 +-    { V(':','u'), 1, "&uuml;", NULL },
277.1917 +-    { V(':','y'), 1, "&yuml;", NULL },
277.1918 +-    { V('<','-'), 1, "&larr;", NULL },
277.1919 +-    { V('<','='), 1, "&le;", NULL },
277.1920 +-    { V('<','>'), 1, "&harr;", NULL },
277.1921 +-    { V('=','='), 1, "&equiv;", NULL },
277.1922 +-    { V('=','~'), 1, "&cong;", NULL },
277.1923 +-    { V('>','='), 1, "&ge;", NULL },
277.1924 +-    { V('A','E'), 1, "&AElig;", NULL },
277.1925 +-    { V('A','h'), 1, "&alepfsym;", NULL },
277.1926 +-    { V('C','R'), 1, "&#x240d;", NULL },
277.1927 +-    { V('C','s'), 1, "&curren;", NULL },
277.1928 +-    { V('D','o'), 1, "$", NULL },
277.1929 +-    { V('E','u'), 1, "&euro;", NULL },
277.1930 +-    { V('F','c'), 1, "&raquo;", NULL  },
277.1931 +-    { V('F','i'), 3, "ffi", NULL  },
277.1932 +-    { V('F','l'), 3, "ffl", NULL  },
277.1933 +-    { V('F','o'), 1, "&laquo;", NULL  },
277.1934 +-    { V('O','E'), 1, "&OElig;", NULL },
277.1935 +-    { V('P','o'), 1, "&pound;", NULL },
277.1936 +-    { V('S','1'), 1, "&sup1;", NULL },
277.1937 +-    { V('S','2'), 1, "&sup2;", NULL },
277.1938 +-    { V('S','3'), 1, "&sup3;", NULL },
277.1939 +-    { V('S','d'), 1, "&eth;", NULL },
277.1940 +-    { V('T','P'), 1, "&THORN;", NULL },
277.1941 +-    { V('T','p'), 1, "&thorn;", NULL },
277.1942 +-    { V('Y','e'), 1, "&yen;", NULL },
277.1943 +-    { V('^','A'), 1, "&Acirc;", NULL },
277.1944 +-    { V('^','E'), 1, "&Ecirc;", NULL },
277.1945 +-    { V('^','I'), 1, "&Icirc;", NULL },
277.1946 +-    { V('^','O'), 1, "&Ocirc;", NULL },
277.1947 +-    { V('^','U'), 1, "&Ucirc;", NULL },
277.1948 +-    { V('^','a'), 1, "&acirc;", NULL },
277.1949 +-    { V('^','e'), 1, "&ecirc;", NULL },
277.1950 +-    { V('^','i'), 1, "&icirc;", NULL },
277.1951 +-    { V('^','o'), 1, "&ocirc;", NULL },
277.1952 +-    { V('^','u'), 1, "&ucirc;", NULL },
277.1953 +-    { V('`','A'), 1, "&Agrave;", NULL },
277.1954 +-    { V('`','E'), 1, "&Egrave;", NULL },
277.1955 +-    { V('`','I'), 1, "&Igrave;", NULL },
277.1956 +-    { V('`','O'), 1, "&Ograve;", NULL },
277.1957 +-    { V('`','U'), 1, "&Ugrave;", NULL },
277.1958 +-    { V('`','a'), 1, "&agrave;", NULL },
277.1959 +-    { V('`','e'), 1, "&egrave;", NULL },
277.1960 +-    { V('`','i'), 1, "&igrave;", NULL },
277.1961 +-    { V('`','o'), 1, "&ograve;", NULL },
277.1962 +-    { V('`','u'), 1, "&ugrave;", NULL },
277.1963 +-    { V('a','a'), 1, "&acute;", NULL },
277.1964 +-    { V('a','e'), 1, "&aelig;", NULL },
277.1965 +-    { V('a','p'), 1, "&asymp;", NULL },
277.1966 +-    { V('a','q'), 1, "'", NULL },
277.1967 +-    { V('a','t'), 1, "@", NULL },
277.1968 +-    { V('a','~'), 1, "~", NULL },
277.1969 +-    { V('b','a'), 1, "|", NULL },
277.1970 +-    { V('b','b'), 1, "|", NULL },
277.1971 +-    { V('b','r'), 1, "|", NULL  },
277.1972 +-    { V('b','r'), 1, "|", NULL },
277.1973 +-    { V('b','u'), 1, "&bull;", NULL },
277.1974 +-    { V('b','v'), 1, "|", NULL  },
277.1975 +-    { V('c','*'), 1, "&otimes;", NULL },
277.1976 +-    { V('c','+'), 1, "&oplus;", NULL },
277.1977 +-    { V('c','i'), 1, "&#x25cb;", NULL },
277.1978 +-    { V('c','o'), 1, "&#169;", NULL  },
277.1979 +-    { V('c','q'), 1, "'", NULL },
277.1980 +-    { V('c','t'), 1, "&#162;", NULL  },
277.1981 +-    { V('d','A'), 1, "&dArr;", NULL },
277.1982 +-    { V('d','a'), 1, "&darr;", NULL },
277.1983 +-    { V('d','d'), 1, "=", NULL },
277.1984 +-    { V('d','e'), 1, "&#176;", NULL  },
277.1985 +-    { V('d','g'), 1, "-", NULL },
277.1986 +-    { V('d','i'), 1, "&#247;", NULL  },
277.1987 +-    { V('d','q'), 1, "&quot;", NULL  },
277.1988 +-    { V('e','m'), 3, "---", NULL  }, 	/* em dash */
277.1989 +-    { V('e','n'), 1, "-", NULL }, 	/* en dash */
277.1990 +-    { V('e','q'), 1, "=", NULL },
277.1991 +-    { V('e','s'), 1, "&#216;", NULL  },
277.1992 +-    { V('e','u'), 1, "&euro;", NULL },
277.1993 +-    { V('f','/'), 1, "&frasl;", NULL },
277.1994 +-    { V('f','c'), 1, "&rsaquo;", NULL  },
277.1995 +-    { V('f','f'), 2, "ff", NULL  },
277.1996 +-    { V('f','i'), 2, "fi", NULL  },
277.1997 +-    { V('f','l'), 2, "fl", NULL  },
277.1998 +-    { V('f','m'), 1, "&#180;", NULL  },
277.1999 +-    { V('f','o'), 1, "&lsaquo;", NULL  },
277.2000 +-    { V('g','a'), 1, "`", NULL  },
277.2001 +-    { V('h','A'), 1, "&hArr;", NULL },
277.2002 +-    { V('h','y'), 1, "-", NULL  },
277.2003 +-    { V('i','f'), 1, "&infin;", NULL },
277.2004 +-    { V('i','s'), 8, "Integral", NULL }, /* integral sign */
277.2005 +-    { V('l','A'), 1, "&lArr;", NULL },
277.2006 +-    { V('l','B'), 1, "[", NULL },
277.2007 +-    { V('l','C'), 1, "{", NULL },
277.2008 +-    { V('l','a'), 1, "&lt;", NULL },
277.2009 +-    { V('l','b'), 1, "[", NULL  },
277.2010 +-    { V('l','c'), 2, "|&#175;", NULL  },
277.2011 +-    { V('l','f'), 2, "|_", NULL  },
277.2012 +-    { V('l','h'), 1, "&#x261a;", NULL },
277.2013 +-    { V('l','k'), 1, "<FONT SIZE=\"+2\">{</FONT>", NULL  },
277.2014 +-    { V('l','q'), 1, "\"", NULL },
277.2015 +-    { V('l','z'), 1, "&loz;", NULL },
277.2016 +-    { V('m','c'), 1, "&micro;", NULL },
277.2017 +-    { V('m','i'), 1, "-", NULL  },
277.2018 +-    { V('m','u'), 1, "&#215;", NULL  },
277.2019 +-    { V('n','o'), 1, "&#172;", NULL  },
277.2020 +-    { V('o','A'), 1, "&Aring;", NULL },
277.2021 +-    { V('o','a'), 1, "&aring;", NULL },
277.2022 +-    { V('o','e'), 1, "&oelig;", NULL },
277.2023 +-    { V('o','q'), 1, "'", NULL },
277.2024 +-    { V('o','r'), 1, "|", NULL },
277.2025 +-    { V('p','d'), 1, "d", NULL }, 	/* partial derivative */
277.2026 +-    { V('p','l'), 1, "+", NULL },
277.2027 +-    { V('p','s'), 1, "&para;", NULL },
277.2028 +-    { V('r','!'), 1, "&iexcl;", NULL },
277.2029 +-    { V('r','?'), 1, "&iquest;", NULL },
277.2030 +-    { V('r','A'), 1, "&rArr;", NULL },
277.2031 +-    { V('r','B'), 1, "]", NULL },
277.2032 +-    { V('r','C'), 1, "}", NULL },
277.2033 +-    { V('r','a'), 1, "&gt;", NULL },
277.2034 +-    { V('r','c'), 2, "&#175;|", NULL  },
277.2035 +-    { V('r','f'), 2, "_|", NULL  },
277.2036 +-    { V('r','g'), 1, "&#174;", NULL  },
277.2037 +-    { V('r','h'), 1, "&#x261b;", NULL },
277.2038 +-    { V('r','k'), 1, "<FONT SIZE=\"+2\">}</FONT>", NULL  },
277.2039 +-    { V('r','n'), 1, "&#175;", NULL  },
277.2040 +-    { V('r','q'), 1, "\"", NULL },
277.2041 +-    { V('r','s'), 1, "\\", NULL },
277.2042 +-    { V('r','u'), 1, "_", NULL },
277.2043 +-    { V('s','c'), 1, "&#167;", NULL  },
277.2044 +-    { V('s','h'), 1, "#", NULL },
277.2045 +-    { V('s','l'), 1, "/", NULL },
277.2046 +-    { V('s','q'), 1, "&#x25a1;", NULL },
277.2047 +-    { V('s','s'), 1, "&szlig;", NULL },
277.2048 +-    { V('t','f'), 1, "&there4;", NULL },
277.2049 +-    { V('t','i'), 1, "~", NULL },
277.2050 +-    { V('t','m'), 1, "&trade;", NULL },
277.2051 +-    { V('t','s'), 1, "s", NULL }, 	/* should be terminal sigma */
277.2052 +-    { V('u','A'), 1, "&uArr;", NULL },
277.2053 +-    { V('u','a'), 1, "&uarr;", NULL },
277.2054 +-    { V('u','l'), 1, "_", NULL },
277.2055 +-    { V('~','A'), 1, "&Atilde;", NULL },
277.2056 +-    { V('~','N'), 1, "&Ntilde;", NULL },
277.2057 +-    { V('~','O'), 1, "&Otilde;", NULL },
277.2058 +-    { V('~','a'), 1, "&atilde;", NULL },
277.2059 +-    { V('~','n'), 1, "&ntilde;", NULL },
277.2060 +-    { V('~','o'), 1, "&otilde;", NULL },
277.2061 ++    { V('*','*'), 1, "∗", NULL },	/* asterisk */
277.2062 ++    { V('*','A'), 1, "Α", NULL },	/* Alpha */
277.2063 ++    { V('*','B'), 1, "Β", NULL },	/* Beta */
277.2064 ++    { V('*','C'), 1, "Ξ", NULL },	/* Xi */
277.2065 ++    { V('*','D'), 1, "Δ", NULL },	/* Delta */
277.2066 ++    { V('*','E'), 1, "Ε", NULL },	/* Epsilon */
277.2067 ++    { V('*','F'), 1, "Φ", NULL },	/* Phi */
277.2068 ++    { V('*','G'), 1, "Γ", NULL },	/* Gamma */
277.2069 ++    { V('*','H'), 1, "Θ", NULL },	/* Theta */
277.2070 ++    { V('*','I'), 1, "Ι", NULL },	/* Iota */
277.2071 ++    { V('*','K'), 1, "Κ", NULL },	/* Kappa */
277.2072 ++    { V('*','L'), 1, "Λ", NULL },	/* Lambda */
277.2073 ++    { V('*','M'), 1, "Μ", NULL },	/* Mu */
277.2074 ++    { V('*','N'), 1, "Ν", NULL },	/* Nu */
277.2075 ++    { V('*','O'), 1, "Ο", NULL },	/* Omicron */
277.2076 ++    { V('*','P'), 1, "Π", NULL },	/* Pi */
277.2077 ++    { V('*','Q'), 1, "Ψ", NULL },	/* Psi */
277.2078 ++    { V('*','R'), 1, "Ρ", NULL },	/* Rho */
277.2079 ++    { V('*','S'), 1, "Σ", NULL },	/* Sigma */
277.2080 ++    { V('*','T'), 1, "Τ", NULL },	/* Tau */
277.2081 ++    { V('*','U'), 1, "Υ", NULL },	/* Upsilon */
277.2082 ++    { V('*','W'), 1, "Ω", NULL },	/* Omega */
277.2083 ++    { V('*','X'), 1, "Χ", NULL },	/* Chi */
277.2084 ++    { V('*','Y'), 1, "Η", NULL },	/* Eta */
277.2085 ++    { V('*','Z'), 1, "Ζ", NULL },	/* Zeta */
277.2086 ++    { V('*','a'), 1, "α", NULL },	/* alpha */
277.2087 ++    { V('*','b'), 1, "β", NULL },	/* beta */
277.2088 ++    { V('*','c'), 1, "ξ", NULL },	/* xi */
277.2089 ++    { V('*','d'), 1, "δ", NULL },	/* delta */
277.2090 ++    { V('*','e'), 1, "ε", NULL },	/* epsilon */
277.2091 ++    { V('*','f'), 1, "φ", NULL },	/* phi */
277.2092 ++    { V('*','g'), 1, "γ", NULL },	/* gamma */
277.2093 ++    { V('*','h'), 1, "θ", NULL },	/* theta */
277.2094 ++    { V('*','i'), 1, "ι", NULL },	/* iota */
277.2095 ++    { V('*','k'), 1, "κ", NULL },	/* kappa */
277.2096 ++    { V('*','l'), 1, "λ", NULL },	/* lambda */
277.2097 ++    { V('*','m'), 1, "μ", NULL },	/* mu */
277.2098 ++    { V('*','n'), 1, "ν", NULL },	/* nu */
277.2099 ++    { V('*','o'), 1, "ο", NULL },	/* omicron */
277.2100 ++    { V('*','p'), 1, "π", NULL },	/* pi */
277.2101 ++    { V('*','q'), 1, "ψ", NULL },	/* psi */
277.2102 ++    { V('*','r'), 1, "ρ", NULL },	/* rho */
277.2103 ++    { V('*','s'), 1, "σ", NULL },	/* sigma */
277.2104 ++    { V('*','t'), 1, "τ", NULL },	/* tau */
277.2105 ++    { V('*','u'), 1, "υ", NULL },	/* upsilon */
277.2106 ++    { V('*','w'), 1, "ω", NULL },	/* omega */
277.2107 ++    { V('*','x'), 1, "χ", NULL },	/* chi */
277.2108 ++    { V('*','y'), 1, "η", NULL },	/* eta */
277.2109 ++    { V('*','z'), 1, "ζ", NULL },	/* zeta */
277.2110 ++    { V('\'','A'), 1, "Á", NULL },	/* acute A */
277.2111 ++    { V('\'','E'), 1, "É", NULL },	/* acute E */
277.2112 ++    { V('\'','I'), 1, "Í", NULL },	/* acute I */
277.2113 ++    { V('\'','O'), 1, "Ó", NULL },	/* acute O */
277.2114 ++    { V('\'','U'), 1, "Ú", NULL },	/* acute U */
277.2115 ++    { V('\'','Y'), 1, "Ý", NULL },	/* Yacute (*) */
277.2116 ++    { V('\'','a'), 1, "á", NULL },	/* acute a */
277.2117 ++    { V('\'','e'), 1, "é", NULL },	/* acute e */
277.2118 ++    { V('\'','i'), 1, "í", NULL },	/* acute i */
277.2119 ++    { V('\'','o'), 1, "ó", NULL },	/* acute o */
277.2120 ++    { V('\'','u'), 1, "ú", NULL },	/* acute u */
277.2121 ++    { V('\'','y'), 1, "ý", NULL },	/* yacute (*) */
277.2122 ++    { V('!','='), 1, "≠", NULL },	/* not equal */
277.2123 ++    { V('%','0'), 1, "‰", NULL },	/* per-thousand */
277.2124 ++    { V('+','-'), 1, "±", NULL },	/* plus-minus */
277.2125 ++    { V('+','e'), 1, "ϵ", NULL },	/* epsilon variant */
277.2126 ++    { V('+','f'), 1, "φ", NULL },	/* phi variant */
277.2127 ++    { V('+','h'), 1, "ϑ", NULL },	/* theta variant */
277.2128 ++    { V('+','p'), 1, "ϖ", NULL },	/* pi variant */
277.2129 ++    { V(',','C'), 1, "Ç", NULL },	/* cedilla C */
277.2130 ++    { V(',','c'), 1, "ç", NULL },	/* cedilla c */
277.2131 ++    { V('-','+'), 1, "∓", NULL },	/* minus-plus */
277.2132 ++    { V('-','>'), 1, "→", NULL },	/* right arrow */
277.2133 ++    { V('-','D'), 1, "Ð", NULL },	/* Eth */
277.2134 ++    { V('-','h'), 1, "ℏ", NULL },	/* Planck constant over 2π */
277.2135 ++    { V('.','i'), 1, "ı", NULL },	/* dotless i */
277.2136 ++    { V('.','j'), 1, "ȷ", NULL },	/* dotless j */
277.2137 ++    { V('/','L'), 1, "Ł", NULL },	/* stroke L */
277.2138 ++    { V('/','O'), 1, "Ø", NULL },	/* stroke O */
277.2139 ++    { V('/','_'), 1, "∠", NULL },	/* angle */
277.2140 ++    { V('/','l'), 1, "ł", NULL },	/* stroke l */
277.2141 ++    { V('/','o'), 1, "ø", NULL },	/* stroke o */
277.2142 ++    { V('1','2'), 1, "½", NULL },	/* 1/2 (*) */
277.2143 ++    { V('1','4'), 1, "¼", NULL },	/* 1/4 (*) */
277.2144 ++    { V('3','4'), 1, "¾", NULL },	/* 3/4 (*) */
277.2145 ++    { V('3','d'), 1, "∴", NULL },	/* therefore */
277.2146 ++    { V(':','A'), 1, "Ä", NULL },	/* dieresis A */
277.2147 ++    { V(':','E'), 1, "Ë", NULL },	/* dieresis E */
277.2148 ++    { V(':','I'), 1, "Ï", NULL },	/* dieresis I */
277.2149 ++    { V(':','O'), 1, "Ö", NULL },	/* dieresis O */
277.2150 ++    { V(':','U'), 1, "Ü", NULL },	/* dieresis U */
277.2151 ++    { V(':','a'), 1, "ä", NULL },	/* dieresis a */
277.2152 ++    { V(':','e'), 1, "ë", NULL },	/* dieresis e */
277.2153 ++    { V(':','i'), 1, "ï", NULL },	/* dieresis i */
277.2154 ++    { V(':','o'), 1, "ö", NULL },	/* dieresis o */
277.2155 ++    { V(':','u'), 1, "ü", NULL },	/* dieresis u */
277.2156 ++    { V(':','y'), 1, "ÿ", NULL },	/* dieresis y */
277.2157 ++    { V('<','-'), 1, "←", NULL },	/* left arrow */
277.2158 ++    { V('<','<'), 1, "≪", NULL },	/* much less */
277.2159 ++    { V('<','='), 1, "≤", NULL },	/* less-than-equal */
277.2160 ++    { V('<','>'), 1, "↔", NULL },	/* left-right arrow */
277.2161 ++    { V('=','='), 1, "≡", NULL },	/* equivalent */
277.2162 ++    { V('=','~'), 1, "≅", NULL },	/* approximately equal */
277.2163 ++    { V('>','='), 1, "≥", NULL },	/* greater-than-equal */
277.2164 ++    { V('>','>'), 1, "≫", NULL },	/* much greater */
277.2165 ++    { V('A','E'), 1, "Æ", NULL },	/* AE ligature */
277.2166 ++    { V('A','N'), 1, "∧", NULL },	/* logical and */
277.2167 ++    { V('A','h'), 1, "ℵ", NULL },	/* aleph */
277.2168 ++    { V('B','q'), 1, "„", NULL },	/* right low double-quote */
277.2169 ++    { V('C','R'), 1, "↵", NULL },	/* carriage return */
277.2170 ++    { V('C','s'), 1, "¤", NULL },	/* Scandinavian */
277.2171 ++    { V('D','o'), 1, "$", NULL },	/* dollar */
277.2172 ++    { V('E','u'), 1, "€", NULL },	/* Euro symbol */
277.2173 ++    { V('F','c'), 1, "»", NULL },	/* right guillemet */
277.2174 ++    { V('F','i'), 1, "ffi", NULL },	/* ffi ligature */
277.2175 ++    { V('F','l'), 1, "ffl", NULL },	/* ffl ligature */
277.2176 ++    { V('F','n'), 1, "ƒ", NULL },	/* florin */
277.2177 ++    { V('F','o'), 1, "«", NULL },	/* left guillemet */
277.2178 ++    { V('I','J'), 1, "IJ", NULL },	/* IJ ligature */
277.2179 ++    { V('I','m'), 1, "ℑ", NULL },	/* imaginary */
277.2180 ++    { V('O','E'), 1, "Œ", NULL },	/* OE ligature */
277.2181 ++    { V('O','K'), 1, "✓", NULL },	/* check mark */
277.2182 ++    { V('O','R'), 1, "∨", NULL },	/* logical or */
277.2183 ++    { V('P','o'), 1, "£", NULL },	/* pound */
277.2184 ++    { V('R','e'), 1, "ℜ", NULL },	/* real */
277.2185 ++    { V('S','1'), 1, "¹", NULL },	/* sup1 (*) */
277.2186 ++    { V('S','2'), 1, "²", NULL },	/* sup2 (*) */
277.2187 ++    { V('S','3'), 1, "³", NULL },	/* sup3 (*) */
277.2188 ++    { V('S','d'), 1, "ð", NULL },	/* eth */
277.2189 ++    { V('T','P'), 1, "Þ", NULL },	/* Thorn */
277.2190 ++    { V('T','p'), 1, "þ", NULL },	/* thorn */
277.2191 ++    { V('Y','e'), 1, "¥", NULL },	/* yen */
277.2192 ++    { V('^','A'), 1, "Â", NULL },	/* circumflex A */
277.2193 ++    { V('^','E'), 1, "Ê", NULL },	/* circumflex E */
277.2194 ++    { V('^','I'), 1, "Î", NULL },	/* circumflex I */
277.2195 ++    { V('^','O'), 1, "Ô", NULL },	/* circumflex O */
277.2196 ++    { V('^','U'), 1, "Û", NULL },	/* circumflex U */
277.2197 ++    { V('^','a'), 1, "â", NULL },	/* circumflex a */
277.2198 ++    { V('^','e'), 1, "ê", NULL },	/* circumflex e */
277.2199 ++    { V('^','i'), 1, "î", NULL },	/* circumflex i */
277.2200 ++    { V('^','o'), 1, "ô", NULL },	/* circumflex o */
277.2201 ++    { V('^','u'), 1, "û", NULL },	/* circumflex u */
277.2202 ++    { V('`','A'), 1, "À", NULL },	/* grave A */
277.2203 ++    { V('`','E'), 1, "È", NULL },	/* grave E */
277.2204 ++    { V('`','I'), 1, "Ì", NULL },	/* grave I */
277.2205 ++    { V('`','O'), 1, "Ò", NULL },	/* grave O */
277.2206 ++    { V('`','U'), 1, "Ù", NULL },	/* grave U */
277.2207 ++    { V('`','a'), 1, "à", NULL },	/* grave a */
277.2208 ++    { V('`','e'), 1, "è", NULL },	/* grave e */
277.2209 ++    { V('`','i'), 1, "ì", NULL },	/* grave i */
277.2210 ++    { V('`','o'), 1, "ò", NULL },	/* grave o */
277.2211 ++    { V('`','u'), 1, "ù", NULL },	/* grave u */
277.2212 ++    { V('a','"'), 1, "˝", NULL },	/* Hungarian umlaut */
277.2213 ++    { V('a','-'), 1, "¯", NULL },	/* macron */
277.2214 ++    { V('a','.'), 1, "˙", NULL },	/* dotted */
277.2215 ++    { V('a','^'), 1, "^", NULL },	/* circumflex */
277.2216 ++    { V('a','a'), 1, "´", NULL },	/* acute */
277.2217 ++    { V('a','b'), 1, "˘", NULL },	/* breve */
277.2218 ++    { V('a','c'), 1, "¸", NULL },	/* cedilla */
277.2219 ++    { V('a','d'), 1, "¨", NULL },	/* dieresis */
277.2220 ++    { V('a','e'), 1, "æ", NULL },	/* ae ligature */
277.2221 ++    { V('a','h'), 1, "ˇ", NULL },	/* caron */
277.2222 ++    { V('a','o'), 1, "˚", NULL },	/* ring */
277.2223 ++    { V('a','p'), 1, "∼", NULL },	/* tilde operator */
277.2224 ++    { V('a','q'), 1, "'", NULL },	/* apostrophe quote (text) */
277.2225 ++    { V('a','t'), 1, "@", NULL },	/* at */
277.2226 ++    { V('a','~'), 1, "~", NULL },	/* tilde */
277.2227 ++    { V('b','a'), 1, "|", NULL },	/* bar */
277.2228 ++    { V('b','b'), 1, "¦", NULL },	/* broken bar */
277.2229 ++    { V('b','r'), 1, "│", NULL },	/* box rule */
277.2230 ++    { V('b','q'), 1, "‚", NULL },	/* right low single-quote */
277.2231 ++    { V('b','u'), 1, "•", NULL },	/* bullet */
277.2232 ++    { V('b','v'), 1, "⎪", NULL },	/* brace extension */
277.2233 ++    { V('c','*'), 1, "⊗", NULL },	/* circle-multiply */
277.2234 ++    { V('c','+'), 1, "⊕", NULL },	/* circle-plus */
277.2235 ++    { V('c','a'), 1, "∩", NULL },	/* intersection */
277.2236 ++    { V('c','i'), 1, "○", NULL },	/* circle */
277.2237 ++    { V('c','o'), 1, "©", NULL },	/* copyright */
277.2238 ++    { V('c','q'), 1, "’", NULL },	/* right single-quote */
277.2239 ++    { V('c','t'), 1, "¢", NULL },	/* cent */
277.2240 ++    { V('c','u'), 1, "∪", NULL },	/* union */
277.2241 ++    { V('d','A'), 1, "⇓", NULL },	/* down double-arrow */
277.2242 ++    { V('d','a'), 1, "↓", NULL },	/* down arrow */
277.2243 ++    { V('d','d'), 1, "‡", NULL },	/* double dagger */
277.2244 ++    { V('d','e'), 1, "°", NULL },	/* degree */
277.2245 ++    { V('d','g'), 1, "†", NULL },	/* dagger */
277.2246 ++    { V('d','i'), 1, "÷", NULL },	/* divide */
277.2247 ++    { V('d','q'), 1, "\"", NULL },	/* double quote (text) */
277.2248 ++    { V('e','m'), 1, "—", NULL },	/* em-dash */
277.2249 ++    { V('e','n'), 1, "–", NULL },	/* en-dash */
277.2250 ++    { V('e','q'), 1, "=", NULL },	/* equal */
277.2251 ++    { V('e','s'), 1, "∅", NULL },	/* empty set */
277.2252 ++    { V('e','u'), 1, "€", NULL },	/* Euro symbol */
277.2253 ++    { V('f','/'), 1, "⁄", NULL },	/* fraction */
277.2254 ++    { V('f','a'), 1, "∀", NULL },	/* universal quantifier */
277.2255 ++    { V('f','c'), 1, "›", NULL },	/* right single guillemet */
277.2256 ++    { V('f','f'), 1, "ff", NULL },	/* ff ligature */
277.2257 ++    { V('f','i'), 1, "fi", NULL },	/* fi ligature */
277.2258 ++    { V('f','l'), 1, "fl", NULL },	/* fl ligature */
277.2259 ++    { V('f','m'), 1, "′", NULL },	/* minute */
277.2260 ++    { V('f','o'), 1, "‹", NULL },	/* left single guillemet */
277.2261 ++    { V('g','a'), 1, "`", NULL },	/* grave */
277.2262 ++    { V('g','r'), 1, "∇", NULL },	/* gradient */
277.2263 ++    { V('h','A'), 1, "⇔", NULL },	/* left-right double-arrow */
277.2264 ++    { V('h','a'), 1, "^", NULL },	/* hat (text) */
277.2265 ++    { V('h','o'), 1, "˛", NULL },	/* ogonek */
277.2266 ++    { V('h','y'), 1, "‐", NULL },	/* hyphen */
277.2267 ++    { V('i','b'), 1, "⊆", NULL },	/* reflexive subset */
277.2268 ++    { V('i','f'), 1, "∞", NULL },	/* infinity */
277.2269 ++    { V('i','j'), 1, "ij", NULL },	/* ij ligature */
277.2270 ++    { V('i','p'), 1, "⊇", NULL },	/* reflexive superset */
277.2271 ++    { V('i','s'), 1, "∫", NULL },	/* integral */
277.2272 ++    { V('l','A'), 1, "⇐", NULL },	/* left double-arrow */
277.2273 ++    { V('l','B'), 1, "[", NULL },	/* left bracket */
277.2274 ++    { V('l','C'), 1, "{", NULL },	/* left brace */
277.2275 ++    { V('l','a'), 1, "⟨", NULL },	/* left angle */
277.2276 ++    { V('l','b'), 1, "⎩", NULL },	/* bottom-left hooked brace */
277.2277 ++    { V('l','c'), 1, "⌈", NULL },	/* left-ceiling */
277.2278 ++    { V('l','f'), 1, "⌊", NULL },	/* left-floor */
277.2279 ++    { V('l','h'), 1, "☜", NULL },	/* left hand */
277.2280 ++    { V('l','k'), 1, "⎨", NULL },	/* mid-left hooked brace */
277.2281 ++    { V('l','q'), 1, "“", NULL },	/* left double-quote */
277.2282 ++    { V('l','t'), 1, "⎧", NULL },	/* top-left hooked brace */
277.2283 ++    { V('l','z'), 1, "◊", NULL },	/* lozenge */
277.2284 ++    { V('m','c'), 1, "µ", NULL },	/* micro */
277.2285 ++    { V('m','i'), 1, "−", NULL },	/* minus */
277.2286 ++    { V('m','o'), 1, "∈", NULL },	/* element */
277.2287 ++    { V('m','u'), 1, "×", NULL },	/* multiply */
277.2288 ++    { V('n','b'), 1, "⊄", NULL },	/* not subset */
277.2289 ++    { V('n','c'), 1, "⊅", NULL },	/* not superset */
277.2290 ++    { V('n','e'), 1, "≢", NULL },	/* not equivalent */
277.2291 ++    { V('n','m'), 1, "∉", NULL },	/* not element */
277.2292 ++    { V('n','o'), 1, "¬", NULL },	/* logical not */
277.2293 ++    { V('o','A'), 1, "Å", NULL },	/* ring A */
277.2294 ++    { V('o','a'), 1, "å", NULL },	/* ring a */
277.2295 ++    { V('o','e'), 1, "œ", NULL },	/* oe ligature */
277.2296 ++    { V('o','q'), 1, "‘", NULL },	/* left single-quote */
277.2297 ++    { V('o','r'), 1, "|", NULL },	/* bitwise or */
277.2298 ++    { V('p','c'), 1, "·", NULL },	/* center-dot */
277.2299 ++    { V('p','d'), 1, "∂", NULL },	/* partial differential */
277.2300 ++    { V('p','l'), 1, "+", NULL },	/* plus */
277.2301 ++    { V('p','p'), 1, "⊥", NULL },	/* perpendicular */
277.2302 ++    { V('p','s'), 1, "¶", NULL },	/* paragraph */
277.2303 ++    { V('p','t'), 1, "∝", NULL },	/* proportionate */
277.2304 ++    { V('r','!'), 1, "¡", NULL },	/* upside-down exclamation */
277.2305 ++    { V('r','?'), 1, "¿", NULL },	/* upside-down question */
277.2306 ++    { V('r','A'), 1, "⇒", NULL },	/* right double-arrow */
277.2307 ++    { V('r','B'), 1, "]", NULL },	/* right bracket */
277.2308 ++    { V('r','C'), 1, "}", NULL },	/* right brace */
277.2309 ++    { V('r','a'), 1, "⟩", NULL },	/* right angle */
277.2310 ++    { V('r','b'), 1, "⎭", NULL },	/* bottom-right hooked brace */
277.2311 ++    { V('r','c'), 1, "⌉", NULL },	/* right-ceiling */
277.2312 ++    { V('r','f'), 1, "⌋", NULL },	/* right-floor */
277.2313 ++    { V('r','g'), 1, "®", NULL },	/* registered */
277.2314 ++    { V('r','h'), 1, "☞", NULL },	/* right hand */
277.2315 ++    { V('r','k'), 1, "⎬", NULL },	/* mid-right hooked brace */
277.2316 ++    { V('r','l'), 1, "‾", NULL },	/* overline */
277.2317 ++    { V('r','n'), 1, "‾", NULL },	/* overline */
277.2318 ++    { V('r','q'), 1, "”", NULL },	/* right double-quote */
277.2319 ++    { V('r','s'), 1, "\\", NULL },	/* backward slash */
277.2320 ++    { V('r','t'), 1, "⎫", NULL },	/* top-left hooked brace */
277.2321 ++    { V('r','u'), 1, "_", NULL },	/* (*) */
277.2322 ++    { V('s','b'), 1, "⊂", NULL },	/* proper subset */
277.2323 ++    { V('s','c'), 1, "§", NULL },	/* section */
277.2324 ++    { V('s','d'), 1, "″", NULL },	/* second */
277.2325 ++    { V('s','h'), 1, "#", NULL },	/* hash (pound) */
277.2326 ++    { V('s','l'), 1, "/", NULL },	/* forward slash */
277.2327 ++    { V('s','p'), 1, "⊃", NULL },	/* proper superset */
277.2328 ++    { V('s','q'), 1, "□", NULL },	/* white square */
277.2329 ++    { V('s','r'), 1, "√", NULL },	/* square root */
277.2330 ++    { V('s','s'), 1, "ß", NULL },	/* German eszett */
277.2331 ++    { V('s','t'), 1, "∋", NULL },	/* such that */
277.2332 ++    { V('t','e'), 1, "∃", NULL },	/* existential quantifier */
277.2333 ++    { V('t','f'), 1, "∴", NULL },	/* therefore */
277.2334 ++    { V('t','i'), 1, "~", NULL },	/* tilde (text) */
277.2335 ++    { V('t','m'), 1, "™", NULL },	/* trademarked */
277.2336 ++    { V('t','s'), 1, "ς", NULL },	/* sigma terminal */
277.2337 ++    { V('u','A'), 1, "⇑", NULL },	/* up double-arrow */
277.2338 ++    { V('u','a'), 1, "↑", NULL },	/* up arrow */
277.2339 ++    { V('u','l'), 1, "_", NULL },	/* underscore */
277.2340 ++    { V('v','A'), 1, "⇕", NULL },	/* up-down double-arrow */
277.2341 ++    { V('v','a'), 1, "↕", NULL },	/* up-down arrow */
277.2342 ++    { V('|','='), 1, "≃", NULL },	/* asymptotically equal */
277.2343 ++    { V('~','='), 1, "≈", NULL },	/* almost equal */
277.2344 ++    { V('~','A'), 1, "Ã", NULL },	/* tilde A */
277.2345 ++    { V('~','N'), 1, "Ñ", NULL },	/* tilde N */
277.2346 ++    { V('~','O'), 1, "Õ", NULL },	/* tilde O */
277.2347 ++    { V('~','a'), 1, "ã", NULL },	/* tilde a */
277.2348 ++    { V('~','n'), 1, "ñ", NULL },	/* tilde n */
277.2349 ++    { V('~','o'), 1, "õ", NULL },	/* tilde o */
277.2350 ++    { V('~','~'), 1, "≈", NULL },	/* almost equal */
277.2351 +     { 0, 0, NULL, NULL  }
277.2352 +-
277.2353 +-    
277.2354 + };
277.2355 + 
277.2356 + void stdinit(void) {
277.2357 +--- /dev/null
277.2358 ++++ b/version.h
277.2359 +@@ -0,0 +1 @@
277.2360 ++#define version "1.6g-7-slitaz"
   278.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   278.2 +++ b/man2html/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   278.3 @@ -0,0 +1,1 @@
   278.4 +-p1|man2html-slitaz.diff
   279.1 --- a/manserver/receipt	Wed May 09 17:03:28 2018 +0300
   279.2 +++ b/manserver/receipt	Thu May 10 21:12:00 2018 +0300
   279.3 @@ -16,7 +16,7 @@
   279.4  genpkg_rules()
   279.5  {
   279.6  	mkdir -p $fs/usr/bin $fs/usr/share/licenses $fs/usr/share/man/man1 $fs/etc/init.d
   279.7 -	cd $src; patch -p0 -i $stuff/manserver-1.08-add-xz.patch
   279.8 +
   279.9  	install -Dm755 $src/manServer.pl $fs/usr/bin/manServer
  279.10  	install -Dm755 $stuff/manserver $fs/usr/bin/manserver
  279.11  	install -Dm644 $src/LICENSE $fs/usr/share/licenses/manserver.txt
   280.1 --- a/manserver/stuff/manserver-1.08-add-xz.patch	Wed May 09 17:03:28 2018 +0300
   280.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   280.3 @@ -1,87 +0,0 @@
   280.4 ---- manServer.pl.orig
   280.5 -+++ manServer.pl
   280.6 -@@ -175,7 +175,7 @@
   280.7 - 		listDir($request);
   280.8 - 		$processed = 1;
   280.9 - 	}
  280.10 --	elsif (-f $request || -f "$request.gz" || -f "$request.bz2")
  280.11 -+	elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz")
  280.12 - 	{
  280.13 - 		# Only allow fully specified files if they're in our manpath
  280.14 - 		foreach $md (@manpath)
  280.15 -@@ -270,7 +270,7 @@
  280.16 - 				foreach $f (@files)
  280.17 - 				{
  280.18 - 					next if ($f eq "." || $f eq ".." || $f !~ m/\./);
  280.19 --					$f =~ s/\.(gz|bz2)$//;
  280.20 -+					$f =~ s/\.(gz|bz2|xz)$//;
  280.21 - 					# ($name) = ($f =~ m,/([^/]*)$,);
  280.22 - 					print OUT "<A HREF=\"$root$request/$f\">$f</A>&nbsp;\n";
  280.23 - 				}
  280.24 -@@ -322,6 +322,13 @@
  280.25 - 			$srcfile =~ m/^(.*)$/;
  280.26 - 			$srcfile = $1;	# untaint
  280.27 - 		}
  280.28 -+		elsif (-f "$file.xz")
  280.29 -+		{
  280.30 -+			$zfile = "$file.xz";
  280.31 -+			$srcfile = "/usr/bin/xzcat $zfile |";
  280.32 -+			$srcfile =~ m/^(.*)$/;
  280.33 -+			$srcfile = $1;	# untaint
  280.34 -+		}
  280.35 - 	}
  280.36 - 	print LOG "man2html $file\n";
  280.37 - 	$foundNroffTag = 0;
  280.38 -@@ -2823,7 +2830,7 @@
  280.39 - 	@multipleMatches = ();
  280.40 - 
  280.41 - 	$file = $_[0];
  280.42 --	return $file if (-f $file || -f "$file.gz" || -f "$file.bz2");
  280.43 -+	return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  280.44 - 
  280.45 - 	# Search the path for the requested man page, which may be of the form:
  280.46 - 	# "/usr/man/man1/ls.1", "ls.1" or "ls".
  280.47 -@@ -2837,7 +2844,7 @@
  280.48 - 		{
  280.49 - 			$dir = $md;
  280.50 - 			$file = "$dir/man$sect/$page.$sect";
  280.51 --			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  280.52 -+			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  280.53 - 		}
  280.54 - 	}
  280.55 - 	else
  280.56 -@@ -2855,13 +2862,13 @@
  280.57 - 	{
  280.58 - 		($s) = ($dir =~ m/man([0-9A-Za-z]+)$/);
  280.59 - 		$file = "$dir/$page.$s";
  280.60 --		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  280.61 -+		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  280.62 - 		$file = "$dir/$request";
  280.63 --		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  280.64 -+		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  280.65 - 		if ($sect && "$page.$sect" ne $request)
  280.66 - 		{
  280.67 - 			$file = "$dir/$page.$sect";
  280.68 --			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  280.69 -+			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  280.70 - 		}
  280.71 - 	}
  280.72 - 	if (@multipleMatches == 1)
  280.73 -@@ -2882,7 +2889,7 @@
  280.74 - 		{
  280.75 - 			if ($f =~ m/^$page\./)
  280.76 - 			{
  280.77 --				$f =~ s/\.(gz|bz2)$//;
  280.78 -+				$f =~ s/\.(gz|bz2|xz)$//;
  280.79 - 				push(@multipleMatches, "$dir/$f");
  280.80 - 			}
  280.81 - 		}
  280.82 -@@ -2908,7 +2915,7 @@
  280.83 - 			{
  280.84 - 				next if ($f eq "." || $f eq ".." || $f !~ m/\./);
  280.85 - 				next unless ("$dir/$f" =~ m/perl/);
  280.86 --				$f =~ s/\.(gz|bz2)$//;
  280.87 -+				$f =~ s/\.(gz|bz2|xz)$//;
  280.88 - 				($name) = ($f =~ m,(.+)\.[^.]*$,);
  280.89 - 				$perlPages{$name} = "$dir/$f";
  280.90 - 			}
   281.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   281.2 +++ b/manserver/stuff/patches/manserver-1.08-add-xz.patch	Thu May 10 21:12:00 2018 +0300
   281.3 @@ -0,0 +1,87 @@
   281.4 +--- manServer.pl.orig
   281.5 ++++ manServer.pl
   281.6 +@@ -175,7 +175,7 @@
   281.7 + 		listDir($request);
   281.8 + 		$processed = 1;
   281.9 + 	}
  281.10 +-	elsif (-f $request || -f "$request.gz" || -f "$request.bz2")
  281.11 ++	elsif (-f $request || -f "$request.gz" || -f "$request.bz2" || -f "$request.xz")
  281.12 + 	{
  281.13 + 		# Only allow fully specified files if they're in our manpath
  281.14 + 		foreach $md (@manpath)
  281.15 +@@ -270,7 +270,7 @@
  281.16 + 				foreach $f (@files)
  281.17 + 				{
  281.18 + 					next if ($f eq "." || $f eq ".." || $f !~ m/\./);
  281.19 +-					$f =~ s/\.(gz|bz2)$//;
  281.20 ++					$f =~ s/\.(gz|bz2|xz)$//;
  281.21 + 					# ($name) = ($f =~ m,/([^/]*)$,);
  281.22 + 					print OUT "<A HREF=\"$root$request/$f\">$f</A>&nbsp;\n";
  281.23 + 				}
  281.24 +@@ -322,6 +322,13 @@
  281.25 + 			$srcfile =~ m/^(.*)$/;
  281.26 + 			$srcfile = $1;	# untaint
  281.27 + 		}
  281.28 ++		elsif (-f "$file.xz")
  281.29 ++		{
  281.30 ++			$zfile = "$file.xz";
  281.31 ++			$srcfile = "/usr/bin/xzcat $zfile |";
  281.32 ++			$srcfile =~ m/^(.*)$/;
  281.33 ++			$srcfile = $1;	# untaint
  281.34 ++		}
  281.35 + 	}
  281.36 + 	print LOG "man2html $file\n";
  281.37 + 	$foundNroffTag = 0;
  281.38 +@@ -2823,7 +2830,7 @@
  281.39 + 	@multipleMatches = ();
  281.40 + 
  281.41 + 	$file = $_[0];
  281.42 +-	return $file if (-f $file || -f "$file.gz" || -f "$file.bz2");
  281.43 ++	return $file if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  281.44 + 
  281.45 + 	# Search the path for the requested man page, which may be of the form:
  281.46 + 	# "/usr/man/man1/ls.1", "ls.1" or "ls".
  281.47 +@@ -2837,7 +2844,7 @@
  281.48 + 		{
  281.49 + 			$dir = $md;
  281.50 + 			$file = "$dir/man$sect/$page.$sect";
  281.51 +-			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  281.52 ++			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  281.53 + 		}
  281.54 + 	}
  281.55 + 	else
  281.56 +@@ -2855,13 +2862,13 @@
  281.57 + 	{
  281.58 + 		($s) = ($dir =~ m/man([0-9A-Za-z]+)$/);
  281.59 + 		$file = "$dir/$page.$s";
  281.60 +-		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  281.61 ++		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  281.62 + 		$file = "$dir/$request";
  281.63 +-		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  281.64 ++		push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  281.65 + 		if ($sect && "$page.$sect" ne $request)
  281.66 + 		{
  281.67 + 			$file = "$dir/$page.$sect";
  281.68 +-			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2");
  281.69 ++			push(@multipleMatches, $file) if (-f $file || -f "$file.gz" || -f "$file.bz2" || -f "$file.xz");
  281.70 + 		}
  281.71 + 	}
  281.72 + 	if (@multipleMatches == 1)
  281.73 +@@ -2882,7 +2889,7 @@
  281.74 + 		{
  281.75 + 			if ($f =~ m/^$page\./)
  281.76 + 			{
  281.77 +-				$f =~ s/\.(gz|bz2)$//;
  281.78 ++				$f =~ s/\.(gz|bz2|xz)$//;
  281.79 + 				push(@multipleMatches, "$dir/$f");
  281.80 + 			}
  281.81 + 		}
  281.82 +@@ -2908,7 +2915,7 @@
  281.83 + 			{
  281.84 + 				next if ($f eq "." || $f eq ".." || $f !~ m/\./);
  281.85 + 				next unless ("$dir/$f" =~ m/perl/);
  281.86 +-				$f =~ s/\.(gz|bz2)$//;
  281.87 ++				$f =~ s/\.(gz|bz2|xz)$//;
  281.88 + 				($name) = ($f =~ m,(.+)\.[^.]*$,);
  281.89 + 				$perlPages{$name} = "$dir/$f";
  281.90 + 			}
   282.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   282.2 +++ b/manserver/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   282.3 @@ -0,0 +1,1 @@
   282.4 +-p0|manserver-1.08-add-xz.patch
   283.1 --- a/marlin/receipt	Wed May 09 17:03:28 2018 +0300
   283.2 +++ b/marlin/receipt	Thu May 10 21:12:00 2018 +0300
   283.3 @@ -21,8 +21,6 @@
   283.4  	# gee-1.0 is old while gee-0.8 is latest ;)
   283.5  	sed -i 's|gee-1.0|gee-0.8|g' $(grep -l gee-1.0 $(find . -type f))
   283.6  
   283.7 -	patch -p1 < $stuff/marlin-0.5.patch
   283.8 -	patch -p1 < $stuff/marlin-icons.patch
   283.9  	sed -i 's/Gdk.EventKey event = Gdk.EventKey(/Gdk.Event event = new Gdk.Event(Gdk.EventType.KEY_PRESS/' libwidgets/tests/tests-pathbar.vala
  283.10  	sed -i 's/event\./&key./' libwidgets/tests/tests-pathbar.vala
  283.11  	sed -i 's/event)/event.key)/' libwidgets/tests/tests-pathbar.vala
   284.1 --- a/marlin/stuff/marlin-0.5.patch	Wed May 09 17:03:28 2018 +0300
   284.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   284.3 @@ -1,51 +0,0 @@
   284.4 -# discussion: https://aur.archlinux.org/packages/marlin-bzr/
   284.5 -# patch found here: http://pastie.org/5189903
   284.6 ---- marlin-0.5/src/fm-directory-view.h
   284.7 -+++ marlin-0.5/src/fm-directory-view.h
   284.8 -@@ -42,6 +42,7 @@
   284.9 - typedef struct FMDirectoryView FMDirectoryView;
  284.10 - typedef struct FMDirectoryViewClass FMDirectoryViewClass;
  284.11 - 
  284.12 -+#define FM_DIRECTORY_TYPE_VIEW fm_directory_view_get_type()
  284.13 - #define FM_TYPE_DIRECTORY_VIEW fm_directory_view_get_type()
  284.14 - #define FM_DIRECTORY_VIEW(obj) \
  284.15 -     (G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_DIRECTORY_VIEW, FMDirectoryView))
  284.16 -
  284.17 ---- marlin-0.5/src/exo-icon-view.c
  284.18 -+++ marlin-0.5/src/exo-icon-view.c
  284.19 -@@ -4641,8 +4641,15 @@
  284.20 -         item = list ? list->data : NULL;
  284.21 - 
  284.22 -         /* Give focus to the first cell initially */
  284.23 --        exo_icon_view_set_cell_data (icon_view, item);
  284.24 --        gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  284.25 -+        if (item == NULL)
  284.26 -+        {
  284.27 -+            return;
  284.28 -+        }
  284.29 -+        else
  284.30 -+        {
  284.31 -+            exo_icon_view_set_cell_data (icon_view, item);
  284.32 -+            gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  284.33 -+        }
  284.34 -     }
  284.35 -     else
  284.36 -     {
  284.37 -@@ -4798,8 +4805,15 @@
  284.38 -         item = list ? list->data : NULL;
  284.39 - 
  284.40 -         /* Give focus to the first cell initially */
  284.41 --        exo_icon_view_set_cell_data (icon_view, item);
  284.42 --        gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  284.43 -+        if (item == NULL)
  284.44 -+        {
  284.45 -+            return;
  284.46 -+        }
  284.47 -+        else
  284.48 -+        {
  284.49 -+            exo_icon_view_set_cell_data (icon_view, item);
  284.50 -+            gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  284.51 -+        }
  284.52 -     }
  284.53 -     else
  284.54 -     {
   285.1 --- a/marlin/stuff/marlin-icons.patch	Wed May 09 17:03:28 2018 +0300
   285.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   285.3 @@ -1,129 +0,0 @@
   285.4 ---- marlin-0.5/src/View/Chrome/ViewSwicher.vala
   285.5 -+++ marlin-0.5/src/View/Chrome/ViewSwicher.vala
   285.6 -@@ -74,16 +74,16 @@
   285.7 - 
   285.8 -             switcher = new ModeButton ();
   285.9 - 
  285.10 --            icon = new Image.from_icon_name ("view-list-icons-symbolic", IconSize.MENU);
  285.11 -+            icon = new Image.from_icon_name ("view-list-icons", IconSize.MENU);
  285.12 -             icon.set_tooltip_text (_("View as icons"));
  285.13 -             switcher.append(icon);
  285.14 --            list = new Image.from_icon_name ("view-list-details-symbolic", IconSize.MENU);
  285.15 -+            list = new Image.from_icon_name ("view-list-details", IconSize.MENU);
  285.16 -             list.set_tooltip_text (_("View as list"));
  285.17 -             switcher.append(list);
  285.18 --            compact = new Image.from_icon_name ("view-list-compact-symbolic", IconSize.MENU);
  285.19 -+            compact = new Image.from_icon_name ("view-list-compact", IconSize.MENU);
  285.20 -             compact.set_tooltip_text (_("View as compact list"));
  285.21 -             switcher.append(compact);
  285.22 --            miller = new Image.from_icon_name ("view-list-column-symbolic", IconSize.MENU);
  285.23 -+            miller = new Image.from_icon_name ("view-list-column", IconSize.MENU);
  285.24 -             miller.set_tooltip_text(_("View as column"));
  285.25 -             switcher.append(miller);
  285.26 -             
  285.27 ---- marlin-0.5/src/View/Window.vala
  285.28 -+++ marlin-0.5/src/View/Window.vala
  285.29 -@@ -703,13 +703,13 @@
  285.30 -                                { "Redo", Stock.REDO, N_("_Redo"),
  285.31 -                                  "<control>Y", N_("Redo the last action"),
  285.32 -                                  action_redo_callback },
  285.33 --                               { "Up", "go-up-symbolic", N_("Open _Parent"),
  285.34 -+                               { "Up", "go-up", N_("Open _Parent"),
  285.35 -                                  "<alt>Up", N_("Open the parent folder"),
  285.36 -                                  action_go_up },
  285.37 --                               { "Back", "go-previous-symbolic", N_("_Back"),
  285.38 -+                               { "Back", "go-previous", N_("_Back"),
  285.39 -                                  "<alt>Left", N_("Go to the previous visited location"),
  285.40 -                                  action_go_back },
  285.41 --                               { "Forward", "go-next-symbolic", N_("_Forward"),
  285.42 -+                               { "Forward", "go-next", N_("_Forward"),
  285.43 -                                  "<alt>Right", N_("Go to the next visited location"),
  285.44 -                                  action_go_forward },
  285.45 -                                { "Reload", Stock.REFRESH, N_("_Reload"),
  285.46 ---- marlin-0.5/src/View/LocationBar.vala
  285.47 -+++ marlin-0.5/src/View/LocationBar.vala
  285.48 -@@ -110,7 +110,7 @@
  285.49 -             dir = Environment.get_user_special_dir(UserDirectory.MUSIC);
  285.50 -             if(dir.contains("/"))
  285.51 -             {
  285.52 --                IconDirectory icon = {dir, "folder-music-symbolic", false, null, null, dir.split("/"), false, null};
  285.53 -+                IconDirectory icon = {dir, "folder-music", false, null, null, dir.split("/"), false, null};
  285.54 -                 icon.exploded[0] = "/";
  285.55 -                 add_icon(icon);
  285.56 -             }
  285.57 -@@ -119,7 +119,7 @@
  285.58 -             dir = Environment.get_user_special_dir(UserDirectory.PICTURES);
  285.59 -             if(dir.contains("/"))
  285.60 -             {
  285.61 --                IconDirectory icon = {dir, "folder-pictures-symbolic", false, null, null, dir.split("/"), false, null};
  285.62 -+                IconDirectory icon = {dir, "folder-pictures", false, null, null, dir.split("/"), false, null};
  285.63 -                 icon.exploded[0] = "/";
  285.64 -                 add_icon(icon);
  285.65 -             }
  285.66 -@@ -128,7 +128,7 @@
  285.67 -             dir = Environment.get_user_special_dir(UserDirectory.VIDEOS);
  285.68 -             if(dir.contains("/"))
  285.69 -             {
  285.70 --                IconDirectory icon = {dir, "folder-videos-symbolic", false, null, null, dir.split("/"), false, null};
  285.71 -+                IconDirectory icon = {dir, "folder-videos", false, null, null, dir.split("/"), false, null};
  285.72 -                 icon.exploded[0] = "/";
  285.73 -                 add_icon(icon);
  285.74 -             }
  285.75 -@@ -137,7 +137,7 @@
  285.76 -             dir = Environment.get_user_special_dir(UserDirectory.DOWNLOAD);
  285.77 -             if(dir.contains("/"))
  285.78 -             {
  285.79 --                IconDirectory icon = {dir, "folder-downloads-symbolic", false, null, null, dir.split("/"), false, null};
  285.80 -+                IconDirectory icon = {dir, "folder-downloads", false, null, null, dir.split("/"), false, null};
  285.81 -                 icon.exploded[0] = "/";
  285.82 -                 add_icon(icon);
  285.83 -             }
  285.84 -@@ -146,7 +146,7 @@
  285.85 -             dir = Environment.get_user_special_dir(UserDirectory.DOCUMENTS);
  285.86 -             if(dir.contains("/"))
  285.87 -             {
  285.88 --                IconDirectory icon = {dir, "folder-documents-symbolic", false, null, null, dir.split("/"), false, null};
  285.89 -+                IconDirectory icon = {dir, "folder-documents", false, null, null, dir.split("/"), false, null};
  285.90 -                 icon.exploded[0] = "/";
  285.91 -                 add_icon(icon);
  285.92 -             }
  285.93 -@@ -155,7 +155,7 @@
  285.94 -             dir = Environment.get_user_special_dir(UserDirectory.TEMPLATES);
  285.95 -             if(dir.contains("/"))
  285.96 -             {
  285.97 --                IconDirectory icon = {dir, "folder-templates-symbolic", false, null, null, dir.split("/"), false, null};
  285.98 -+                IconDirectory icon = {dir, "folder-templates", false, null, null, dir.split("/"), false, null};
  285.99 -                 icon.exploded[0] = "/";
 285.100 -                 add_icon(icon);
 285.101 -             }
 285.102 -@@ -163,7 +163,7 @@
 285.103 -             dir = Environment.get_home_dir();
 285.104 -             if(dir.contains("/"))
 285.105 -             {
 285.106 --                IconDirectory icon = {dir, "go-home-symbolic", false, null, null, dir.split("/"), true, null};
 285.107 -+                IconDirectory icon = {dir, "go-home", false, null, null, dir.split("/"), true, null};
 285.108 -                 icon.exploded[0] = "/";
 285.109 -                 add_icon(icon);
 285.110 -             }
 285.111 ---- marlin-0.5/src/View/Chrome/TopMenu.vala
 285.112 -+++ marlin-0.5/src/View/Chrome/TopMenu.vala
 285.113 -@@ -43,7 +43,7 @@
 285.114 -             compact_menu = (Gtk.Menu) win.ui.get_widget("/CompactMenu");
 285.115 -             toolbar_menu = (Gtk.Menu) win.ui.get_widget("/ToolbarMenu");
 285.116 - 
 285.117 --            app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system-symbolic", IconSize.MENU), 
 285.118 -+            app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system", IconSize.MENU), 
 285.119 -                                                              null, _("Menu"), compact_menu);
 285.120 -             setup_items();
 285.121 -             show();
 285.122 ---- marlin-0.5/libwidgets/BreadcrumbsEntry.vala
 285.123 -+++ marlin-0.5/libwidgets/BreadcrumbsEntry.vala
 285.124 -@@ -74,7 +74,7 @@
 285.125 -         
 285.126 -         /* Load arrow image */
 285.127 -         try {
 285.128 --            arrow_img = IconTheme.get_default ().load_icon ("go-jump-symbolic", 16, IconLookupFlags.GENERIC_FALLBACK);
 285.129 -+            arrow_img = IconTheme.get_default ().load_icon ("go-jump", 16, IconLookupFlags.GENERIC_FALLBACK);
 285.130 -         } catch(Error err) {
 285.131 -             stderr.printf ("Unable to load home icon: %s", err.message);
 285.132 -         }
   286.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   286.2 +++ b/marlin/stuff/patches/marlin-0.5.patch	Thu May 10 21:12:00 2018 +0300
   286.3 @@ -0,0 +1,51 @@
   286.4 +# discussion: https://aur.archlinux.org/packages/marlin-bzr/
   286.5 +# patch found here: http://pastie.org/5189903
   286.6 +--- marlin-0.5/src/fm-directory-view.h
   286.7 ++++ marlin-0.5/src/fm-directory-view.h
   286.8 +@@ -42,6 +42,7 @@
   286.9 + typedef struct FMDirectoryView FMDirectoryView;
  286.10 + typedef struct FMDirectoryViewClass FMDirectoryViewClass;
  286.11 + 
  286.12 ++#define FM_DIRECTORY_TYPE_VIEW fm_directory_view_get_type()
  286.13 + #define FM_TYPE_DIRECTORY_VIEW fm_directory_view_get_type()
  286.14 + #define FM_DIRECTORY_VIEW(obj) \
  286.15 +     (G_TYPE_CHECK_INSTANCE_CAST ((obj), FM_TYPE_DIRECTORY_VIEW, FMDirectoryView))
  286.16 +
  286.17 +--- marlin-0.5/src/exo-icon-view.c
  286.18 ++++ marlin-0.5/src/exo-icon-view.c
  286.19 +@@ -4641,8 +4641,15 @@
  286.20 +         item = list ? list->data : NULL;
  286.21 + 
  286.22 +         /* Give focus to the first cell initially */
  286.23 +-        exo_icon_view_set_cell_data (icon_view, item);
  286.24 +-        gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  286.25 ++        if (item == NULL)
  286.26 ++        {
  286.27 ++            return;
  286.28 ++        }
  286.29 ++        else
  286.30 ++        {
  286.31 ++            exo_icon_view_set_cell_data (icon_view, item);
  286.32 ++            gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  286.33 ++        }
  286.34 +     }
  286.35 +     else
  286.36 +     {
  286.37 +@@ -4798,8 +4805,15 @@
  286.38 +         item = list ? list->data : NULL;
  286.39 + 
  286.40 +         /* Give focus to the first cell initially */
  286.41 +-        exo_icon_view_set_cell_data (icon_view, item);
  286.42 +-        gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  286.43 ++        if (item == NULL)
  286.44 ++        {
  286.45 ++            return;
  286.46 ++        }
  286.47 ++        else
  286.48 ++        {
  286.49 ++            exo_icon_view_set_cell_data (icon_view, item);
  286.50 ++            gtk_cell_area_focus (icon_view->priv->cell_area, direction);
  286.51 ++        }
  286.52 +     }
  286.53 +     else
  286.54 +     {
   287.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   287.2 +++ b/marlin/stuff/patches/marlin-icons.patch	Thu May 10 21:12:00 2018 +0300
   287.3 @@ -0,0 +1,129 @@
   287.4 +--- marlin-0.5/src/View/Chrome/ViewSwicher.vala
   287.5 ++++ marlin-0.5/src/View/Chrome/ViewSwicher.vala
   287.6 +@@ -74,16 +74,16 @@
   287.7 + 
   287.8 +             switcher = new ModeButton ();
   287.9 + 
  287.10 +-            icon = new Image.from_icon_name ("view-list-icons-symbolic", IconSize.MENU);
  287.11 ++            icon = new Image.from_icon_name ("view-list-icons", IconSize.MENU);
  287.12 +             icon.set_tooltip_text (_("View as icons"));
  287.13 +             switcher.append(icon);
  287.14 +-            list = new Image.from_icon_name ("view-list-details-symbolic", IconSize.MENU);
  287.15 ++            list = new Image.from_icon_name ("view-list-details", IconSize.MENU);
  287.16 +             list.set_tooltip_text (_("View as list"));
  287.17 +             switcher.append(list);
  287.18 +-            compact = new Image.from_icon_name ("view-list-compact-symbolic", IconSize.MENU);
  287.19 ++            compact = new Image.from_icon_name ("view-list-compact", IconSize.MENU);
  287.20 +             compact.set_tooltip_text (_("View as compact list"));
  287.21 +             switcher.append(compact);
  287.22 +-            miller = new Image.from_icon_name ("view-list-column-symbolic", IconSize.MENU);
  287.23 ++            miller = new Image.from_icon_name ("view-list-column", IconSize.MENU);
  287.24 +             miller.set_tooltip_text(_("View as column"));
  287.25 +             switcher.append(miller);
  287.26 +             
  287.27 +--- marlin-0.5/src/View/Window.vala
  287.28 ++++ marlin-0.5/src/View/Window.vala
  287.29 +@@ -703,13 +703,13 @@
  287.30 +                                { "Redo", Stock.REDO, N_("_Redo"),
  287.31 +                                  "<control>Y", N_("Redo the last action"),
  287.32 +                                  action_redo_callback },
  287.33 +-                               { "Up", "go-up-symbolic", N_("Open _Parent"),
  287.34 ++                               { "Up", "go-up", N_("Open _Parent"),
  287.35 +                                  "<alt>Up", N_("Open the parent folder"),
  287.36 +                                  action_go_up },
  287.37 +-                               { "Back", "go-previous-symbolic", N_("_Back"),
  287.38 ++                               { "Back", "go-previous", N_("_Back"),
  287.39 +                                  "<alt>Left", N_("Go to the previous visited location"),
  287.40 +                                  action_go_back },
  287.41 +-                               { "Forward", "go-next-symbolic", N_("_Forward"),
  287.42 ++                               { "Forward", "go-next", N_("_Forward"),
  287.43 +                                  "<alt>Right", N_("Go to the next visited location"),
  287.44 +                                  action_go_forward },
  287.45 +                                { "Reload", Stock.REFRESH, N_("_Reload"),
  287.46 +--- marlin-0.5/src/View/LocationBar.vala
  287.47 ++++ marlin-0.5/src/View/LocationBar.vala
  287.48 +@@ -110,7 +110,7 @@
  287.49 +             dir = Environment.get_user_special_dir(UserDirectory.MUSIC);
  287.50 +             if(dir.contains("/"))
  287.51 +             {
  287.52 +-                IconDirectory icon = {dir, "folder-music-symbolic", false, null, null, dir.split("/"), false, null};
  287.53 ++                IconDirectory icon = {dir, "folder-music", false, null, null, dir.split("/"), false, null};
  287.54 +                 icon.exploded[0] = "/";
  287.55 +                 add_icon(icon);
  287.56 +             }
  287.57 +@@ -119,7 +119,7 @@
  287.58 +             dir = Environment.get_user_special_dir(UserDirectory.PICTURES);
  287.59 +             if(dir.contains("/"))
  287.60 +             {
  287.61 +-                IconDirectory icon = {dir, "folder-pictures-symbolic", false, null, null, dir.split("/"), false, null};
  287.62 ++                IconDirectory icon = {dir, "folder-pictures", false, null, null, dir.split("/"), false, null};
  287.63 +                 icon.exploded[0] = "/";
  287.64 +                 add_icon(icon);
  287.65 +             }
  287.66 +@@ -128,7 +128,7 @@
  287.67 +             dir = Environment.get_user_special_dir(UserDirectory.VIDEOS);
  287.68 +             if(dir.contains("/"))
  287.69 +             {
  287.70 +-                IconDirectory icon = {dir, "folder-videos-symbolic", false, null, null, dir.split("/"), false, null};
  287.71 ++                IconDirectory icon = {dir, "folder-videos", false, null, null, dir.split("/"), false, null};
  287.72 +                 icon.exploded[0] = "/";
  287.73 +                 add_icon(icon);
  287.74 +             }
  287.75 +@@ -137,7 +137,7 @@
  287.76 +             dir = Environment.get_user_special_dir(UserDirectory.DOWNLOAD);
  287.77 +             if(dir.contains("/"))
  287.78 +             {
  287.79 +-                IconDirectory icon = {dir, "folder-downloads-symbolic", false, null, null, dir.split("/"), false, null};
  287.80 ++                IconDirectory icon = {dir, "folder-downloads", false, null, null, dir.split("/"), false, null};
  287.81 +                 icon.exploded[0] = "/";
  287.82 +                 add_icon(icon);
  287.83 +             }
  287.84 +@@ -146,7 +146,7 @@
  287.85 +             dir = Environment.get_user_special_dir(UserDirectory.DOCUMENTS);
  287.86 +             if(dir.contains("/"))
  287.87 +             {
  287.88 +-                IconDirectory icon = {dir, "folder-documents-symbolic", false, null, null, dir.split("/"), false, null};
  287.89 ++                IconDirectory icon = {dir, "folder-documents", false, null, null, dir.split("/"), false, null};
  287.90 +                 icon.exploded[0] = "/";
  287.91 +                 add_icon(icon);
  287.92 +             }
  287.93 +@@ -155,7 +155,7 @@
  287.94 +             dir = Environment.get_user_special_dir(UserDirectory.TEMPLATES);
  287.95 +             if(dir.contains("/"))
  287.96 +             {
  287.97 +-                IconDirectory icon = {dir, "folder-templates-symbolic", false, null, null, dir.split("/"), false, null};
  287.98 ++                IconDirectory icon = {dir, "folder-templates", false, null, null, dir.split("/"), false, null};
  287.99 +                 icon.exploded[0] = "/";
 287.100 +                 add_icon(icon);
 287.101 +             }
 287.102 +@@ -163,7 +163,7 @@
 287.103 +             dir = Environment.get_home_dir();
 287.104 +             if(dir.contains("/"))
 287.105 +             {
 287.106 +-                IconDirectory icon = {dir, "go-home-symbolic", false, null, null, dir.split("/"), true, null};
 287.107 ++                IconDirectory icon = {dir, "go-home", false, null, null, dir.split("/"), true, null};
 287.108 +                 icon.exploded[0] = "/";
 287.109 +                 add_icon(icon);
 287.110 +             }
 287.111 +--- marlin-0.5/src/View/Chrome/TopMenu.vala
 287.112 ++++ marlin-0.5/src/View/Chrome/TopMenu.vala
 287.113 +@@ -43,7 +43,7 @@
 287.114 +             compact_menu = (Gtk.Menu) win.ui.get_widget("/CompactMenu");
 287.115 +             toolbar_menu = (Gtk.Menu) win.ui.get_widget("/ToolbarMenu");
 287.116 + 
 287.117 +-            app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system-symbolic", IconSize.MENU), 
 287.118 ++            app_menu = new Varka.Widgets.ToolButtonWithMenu (new Image.from_icon_name ("emblem-system", IconSize.MENU), 
 287.119 +                                                              null, _("Menu"), compact_menu);
 287.120 +             setup_items();
 287.121 +             show();
 287.122 +--- marlin-0.5/libwidgets/BreadcrumbsEntry.vala
 287.123 ++++ marlin-0.5/libwidgets/BreadcrumbsEntry.vala
 287.124 +@@ -74,7 +74,7 @@
 287.125 +         
 287.126 +         /* Load arrow image */
 287.127 +         try {
 287.128 +-            arrow_img = IconTheme.get_default ().load_icon ("go-jump-symbolic", 16, IconLookupFlags.GENERIC_FALLBACK);
 287.129 ++            arrow_img = IconTheme.get_default ().load_icon ("go-jump", 16, IconLookupFlags.GENERIC_FALLBACK);
 287.130 +         } catch(Error err) {
 287.131 +             stderr.printf ("Unable to load home icon: %s", err.message);
 287.132 +         }
   288.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   288.2 +++ b/marlin/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   288.3 @@ -0,0 +1,2 @@
   288.4 +-p1|marlin-0.5.patch
   288.5 +-p1|marlin-icons.patch
   289.1 --- a/memtest/receipt	Wed May 09 17:03:28 2018 +0300
   289.2 +++ b/memtest/receipt	Thu May 10 21:12:00 2018 +0300
   289.3 @@ -21,7 +21,7 @@
   289.4  	sed -i  -e '/scp memtest.bin/d' -e 's/gcc/gcc-3/' \
   289.5  		-e 's/-fno-stack-protector//' Makefile
   289.6  	sed -i 's/0b10/2/' init.c
   289.7 -	patch -p1 < $stuff/$SOURCE-$VERSION-array-size.patch
   289.8 +
   289.9  	make
  289.10  	cp $stuff/*.S $stuff/pack .
  289.11  	for i in bootloader unpack ; do
   290.1 --- a/memtest/stuff/memtest86+-5.01-array-size.patch	Wed May 09 17:03:28 2018 +0300
   290.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   290.3 @@ -1,20 +0,0 @@
   290.4 ---- memtest86+-5.01/controller.c~	2013-08-10 02:01:58.000000000 +0000
   290.5 -+++ memtest86+-5.01/controller.c	2013-12-12 20:58:12.873555378 +0000
   290.6 -@@ -292,7 +292,7 @@
   290.7 - 
   290.8 - 	/* First, locate the PCI bus where the MCH is located */
   290.9 - 
  290.10 --	for(i = 0; i < sizeof(possible_nhm_bus); i++) {
  290.11 -+	for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
  290.12 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
  290.13 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
  290.14 - 		vid &= 0xFFFF;
  290.15 -@@ -327,7 +327,7 @@
  290.16 - 	ctrl.mode = ECC_NONE;
  290.17 - 
  290.18 - 	/* First, locate the PCI bus where the MCH is located */
  290.19 --	for(i = 0; i < sizeof(possible_nhm_bus); i++) {
  290.20 -+	for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
  290.21 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
  290.22 - 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
  290.23 - 		vid &= 0xFFFF;
   291.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   291.2 +++ b/memtest/stuff/patches/memtest86+-5.01-array-size.patch	Thu May 10 21:12:00 2018 +0300
   291.3 @@ -0,0 +1,20 @@
   291.4 +--- memtest86+-5.01/controller.c~	2013-08-10 02:01:58.000000000 +0000
   291.5 ++++ memtest86+-5.01/controller.c	2013-12-12 20:58:12.873555378 +0000
   291.6 +@@ -292,7 +292,7 @@
   291.7 + 
   291.8 + 	/* First, locate the PCI bus where the MCH is located */
   291.9 + 
  291.10 +-	for(i = 0; i < sizeof(possible_nhm_bus); i++) {
  291.11 ++	for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
  291.12 + 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
  291.13 + 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
  291.14 + 		vid &= 0xFFFF;
  291.15 +@@ -327,7 +327,7 @@
  291.16 + 	ctrl.mode = ECC_NONE;
  291.17 + 
  291.18 + 	/* First, locate the PCI bus where the MCH is located */
  291.19 +-	for(i = 0; i < sizeof(possible_nhm_bus); i++) {
  291.20 ++	for(i = 0; i < sizeof(possible_nhm_bus) / sizeof(possible_nhm_bus[0]); i++) {
  291.21 + 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x00, 2, &vid);
  291.22 + 		pci_conf_read( possible_nhm_bus[i], 3, 4, 0x02, 2, &did);
  291.23 + 		vid &= 0xFFFF;
   292.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   292.2 +++ b/memtest/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   292.3 @@ -0,0 +1,1 @@
   292.4 +-p1|memtest86+-5.01-array-size.patch
   293.1 --- a/mesa12/receipt	Wed May 09 17:03:28 2018 +0300
   293.2 +++ b/mesa12/receipt	Thu May 10 21:12:00 2018 +0300
   293.3 @@ -19,8 +19,6 @@
   293.4  SPLIT="mesa12 mesa12-dev mesa12-dri mesa12-libegl"
   293.5  
   293.6  compile_rules() {
   293.7 -#	patch -p1 -i $stuff/mesa-12.0.patch
   293.8 -
   293.9  	# "swr" driver is disabled due to compilation errors
  293.10  	GLL_DRV="nouveau,r300,r600,radeonsi,svga,swrast"
  293.11  
   294.1 --- a/mesa12/stuff/mesa-12.0.patch	Wed May 09 17:03:28 2018 +0300
   294.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   294.3 @@ -1,20 +0,0 @@
   294.4 ---- a/src/gallium/drivers/swr/rasterizer/core/utils.h
   294.5 -+++ b/src/gallium/drivers/swr/rasterizer/core/utils.h
   294.6 -@@ -37,7 +37,7 @@
   294.7 - #define _MM_INSERT_EPI64 _mm_insert_epi64
   294.8 - #define _MM_EXTRACT_EPI64 _mm_extract_epi64
   294.9 - #else
  294.10 --INLINE INT64 _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx)
  294.11 -+INLINE int64_t _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx)
  294.12 - {
  294.13 -     OSALIGNLINE(uint32_t) elems[4];
  294.14 -     _mm_store_si128((__m128i*)elems, a);
  294.15 -@@ -55,7 +55,7 @@
  294.16 -     }
  294.17 - }
  294.18 - 
  294.19 --INLINE __m128i  _MM_INSERT_EPI64(__m128i a, INT64 b, const int32_t ndx)
  294.20 -+INLINE __m128i  _MM_INSERT_EPI64(__m128i a, int64_t b, const int32_t ndx)
  294.21 - {
  294.22 -     OSALIGNLINE(int64_t) elems[2];
  294.23 -     _mm_store_si128((__m128i*)elems, a);
   295.1 --- a/mesa12/stuff/nouveau-fix-header.patch	Wed May 09 17:03:28 2018 +0300
   295.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   295.3 @@ -1,86 +0,0 @@
   295.4 -From 5c102dd94f435e97507213fbd128e50dd15f5f54 Mon Sep 17 00:00:00 2001
   295.5 -From: Ben Skeggs <bskeggs@redhat.com>
   295.6 -Date: Mon, 20 Dec 2010 03:39:36 +0000
   295.7 -Subject: nouveau: fix includes for latest libdrm
   295.8 -
   295.9 -Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  295.10 ----
  295.11 -diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
  295.12 -index ab480ca..747b084 100644
  295.13 ---- a/src/gallium/drivers/nouveau/nouveau_winsys.h
  295.14 -+++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
  295.15 -@@ -10,7 +10,7 @@
  295.16 - #include "nouveau/nouveau_grobj.h"
  295.17 - #include "nouveau/nouveau_notifier.h"
  295.18 - #include "nouveau/nouveau_resource.h"
  295.19 --#include "nouveau/nouveau_pushbuf.h"
  295.20 -+#include "nouveau/nv04_pushbuf.h"
  295.21 - 
  295.22 - #ifndef NV04_PFIFO_MAX_PACKET_LEN
  295.23 - #define NV04_PFIFO_MAX_PACKET_LEN 2047
  295.24 -diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
  295.25 -index ce48022..a99df76 100644
  295.26 ---- a/src/gallium/drivers/nv50/nv50_surface.c
  295.27 -+++ b/src/gallium/drivers/nv50/nv50_surface.c
  295.28 -@@ -22,7 +22,7 @@
  295.29 - 
  295.30 - #define __NOUVEAU_PUSH_H__
  295.31 - #include <stdint.h>
  295.32 --#include "nouveau/nouveau_pushbuf.h"
  295.33 -+#include "nouveau/nv04_pushbuf.h"
  295.34 - #include "nv50_context.h"
  295.35 - #include "nv50_resource.h"
  295.36 - #include "pipe/p_defines.h"
  295.37 -diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c
  295.38 -index e0e65e7..e2fadd3 100644
  295.39 ---- a/src/gallium/drivers/nvfx/nv04_2d.c
  295.40 -+++ b/src/gallium/drivers/nvfx/nv04_2d.c
  295.41 -@@ -34,11 +34,11 @@
  295.42 - #include <stdio.h>
  295.43 - #include <stdint.h>
  295.44 - #include <nouveau/nouveau_device.h>
  295.45 --#include <nouveau/nouveau_pushbuf.h>
  295.46 - #include <nouveau/nouveau_channel.h>
  295.47 - #include <nouveau/nouveau_bo.h>
  295.48 - #include <nouveau/nouveau_notifier.h>
  295.49 - #include <nouveau/nouveau_grobj.h>
  295.50 -+#include <nouveau/nv04_pushbuf.h>
  295.51 - #include "nv04_2d.h"
  295.52 - 
  295.53 - #include "nouveau/nv_object.xml.h"
  295.54 -diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c
  295.55 -index 597664e..339b317 100644
  295.56 ---- a/src/gallium/drivers/nvfx/nvfx_vbo.c
  295.57 -+++ b/src/gallium/drivers/nvfx/nvfx_vbo.c
  295.58 -@@ -9,8 +9,7 @@
  295.59 - #include "nvfx_resource.h"
  295.60 - 
  295.61 - #include "nouveau/nouveau_channel.h"
  295.62 --
  295.63 --#include "nouveau/nouveau_pushbuf.h"
  295.64 -+#include "nouveau/nv04_pushbuf.h"
  295.65 - 
  295.66 - static inline unsigned
  295.67 - util_guess_unique_indices_count(unsigned mode, unsigned indices)
  295.68 -diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
  295.69 -index 8036b18..c5ac128 100644
  295.70 ---- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h
  295.71 -+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
  295.72 -@@ -38,7 +38,6 @@
  295.73 - #include <assert.h>
  295.74 - 
  295.75 - #include "nouveau_device.h"
  295.76 --#include "nouveau_pushbuf.h"
  295.77 - #include "nouveau_grobj.h"
  295.78 - #include "nouveau_channel.h"
  295.79 - #include "nouveau_bo.h"
  295.80 -@@ -46,6 +45,7 @@
  295.81 - #include "nouveau_screen.h"
  295.82 - #include "nouveau_state.h"
  295.83 - #include "nouveau_surface.h"
  295.84 -+#include "nv04_pushbuf.h"
  295.85 - 
  295.86 - #define DRIVER_DATE	"20091015"
  295.87 - #define DRIVER_AUTHOR	"Nouveau"
  295.88 ---
  295.89 -cgit v0.8.3-6-g21f6
   296.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   296.2 +++ b/mesa12/stuff/patches/mesa-12.0.patch	Thu May 10 21:12:00 2018 +0300
   296.3 @@ -0,0 +1,20 @@
   296.4 +--- a/src/gallium/drivers/swr/rasterizer/core/utils.h
   296.5 ++++ b/src/gallium/drivers/swr/rasterizer/core/utils.h
   296.6 +@@ -37,7 +37,7 @@
   296.7 + #define _MM_INSERT_EPI64 _mm_insert_epi64
   296.8 + #define _MM_EXTRACT_EPI64 _mm_extract_epi64
   296.9 + #else
  296.10 +-INLINE INT64 _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx)
  296.11 ++INLINE int64_t _MM_EXTRACT_EPI64(__m128i a, const int32_t ndx)
  296.12 + {
  296.13 +     OSALIGNLINE(uint32_t) elems[4];
  296.14 +     _mm_store_si128((__m128i*)elems, a);
  296.15 +@@ -55,7 +55,7 @@
  296.16 +     }
  296.17 + }
  296.18 + 
  296.19 +-INLINE __m128i  _MM_INSERT_EPI64(__m128i a, INT64 b, const int32_t ndx)
  296.20 ++INLINE __m128i  _MM_INSERT_EPI64(__m128i a, int64_t b, const int32_t ndx)
  296.21 + {
  296.22 +     OSALIGNLINE(int64_t) elems[2];
  296.23 +     _mm_store_si128((__m128i*)elems, a);
   297.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   297.2 +++ b/mesa12/stuff/patches/nouveau-fix-header.patch	Thu May 10 21:12:00 2018 +0300
   297.3 @@ -0,0 +1,86 @@
   297.4 +From 5c102dd94f435e97507213fbd128e50dd15f5f54 Mon Sep 17 00:00:00 2001
   297.5 +From: Ben Skeggs <bskeggs@redhat.com>
   297.6 +Date: Mon, 20 Dec 2010 03:39:36 +0000
   297.7 +Subject: nouveau: fix includes for latest libdrm
   297.8 +
   297.9 +Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  297.10 +---
  297.11 +diff --git a/src/gallium/drivers/nouveau/nouveau_winsys.h b/src/gallium/drivers/nouveau/nouveau_winsys.h
  297.12 +index ab480ca..747b084 100644
  297.13 +--- a/src/gallium/drivers/nouveau/nouveau_winsys.h
  297.14 ++++ b/src/gallium/drivers/nouveau/nouveau_winsys.h
  297.15 +@@ -10,7 +10,7 @@
  297.16 + #include "nouveau/nouveau_grobj.h"
  297.17 + #include "nouveau/nouveau_notifier.h"
  297.18 + #include "nouveau/nouveau_resource.h"
  297.19 +-#include "nouveau/nouveau_pushbuf.h"
  297.20 ++#include "nouveau/nv04_pushbuf.h"
  297.21 + 
  297.22 + #ifndef NV04_PFIFO_MAX_PACKET_LEN
  297.23 + #define NV04_PFIFO_MAX_PACKET_LEN 2047
  297.24 +diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c
  297.25 +index ce48022..a99df76 100644
  297.26 +--- a/src/gallium/drivers/nv50/nv50_surface.c
  297.27 ++++ b/src/gallium/drivers/nv50/nv50_surface.c
  297.28 +@@ -22,7 +22,7 @@
  297.29 + 
  297.30 + #define __NOUVEAU_PUSH_H__
  297.31 + #include <stdint.h>
  297.32 +-#include "nouveau/nouveau_pushbuf.h"
  297.33 ++#include "nouveau/nv04_pushbuf.h"
  297.34 + #include "nv50_context.h"
  297.35 + #include "nv50_resource.h"
  297.36 + #include "pipe/p_defines.h"
  297.37 +diff --git a/src/gallium/drivers/nvfx/nv04_2d.c b/src/gallium/drivers/nvfx/nv04_2d.c
  297.38 +index e0e65e7..e2fadd3 100644
  297.39 +--- a/src/gallium/drivers/nvfx/nv04_2d.c
  297.40 ++++ b/src/gallium/drivers/nvfx/nv04_2d.c
  297.41 +@@ -34,11 +34,11 @@
  297.42 + #include <stdio.h>
  297.43 + #include <stdint.h>
  297.44 + #include <nouveau/nouveau_device.h>
  297.45 +-#include <nouveau/nouveau_pushbuf.h>
  297.46 + #include <nouveau/nouveau_channel.h>
  297.47 + #include <nouveau/nouveau_bo.h>
  297.48 + #include <nouveau/nouveau_notifier.h>
  297.49 + #include <nouveau/nouveau_grobj.h>
  297.50 ++#include <nouveau/nv04_pushbuf.h>
  297.51 + #include "nv04_2d.h"
  297.52 + 
  297.53 + #include "nouveau/nv_object.xml.h"
  297.54 +diff --git a/src/gallium/drivers/nvfx/nvfx_vbo.c b/src/gallium/drivers/nvfx/nvfx_vbo.c
  297.55 +index 597664e..339b317 100644
  297.56 +--- a/src/gallium/drivers/nvfx/nvfx_vbo.c
  297.57 ++++ b/src/gallium/drivers/nvfx/nvfx_vbo.c
  297.58 +@@ -9,8 +9,7 @@
  297.59 + #include "nvfx_resource.h"
  297.60 + 
  297.61 + #include "nouveau/nouveau_channel.h"
  297.62 +-
  297.63 +-#include "nouveau/nouveau_pushbuf.h"
  297.64 ++#include "nouveau/nv04_pushbuf.h"
  297.65 + 
  297.66 + static inline unsigned
  297.67 + util_guess_unique_indices_count(unsigned mode, unsigned indices)
  297.68 +diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.h b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
  297.69 +index 8036b18..c5ac128 100644
  297.70 +--- a/src/mesa/drivers/dri/nouveau/nouveau_driver.h
  297.71 ++++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.h
  297.72 +@@ -38,7 +38,6 @@
  297.73 + #include <assert.h>
  297.74 + 
  297.75 + #include "nouveau_device.h"
  297.76 +-#include "nouveau_pushbuf.h"
  297.77 + #include "nouveau_grobj.h"
  297.78 + #include "nouveau_channel.h"
  297.79 + #include "nouveau_bo.h"
  297.80 +@@ -46,6 +45,7 @@
  297.81 + #include "nouveau_screen.h"
  297.82 + #include "nouveau_state.h"
  297.83 + #include "nouveau_surface.h"
  297.84 ++#include "nv04_pushbuf.h"
  297.85 + 
  297.86 + #define DRIVER_DATE	"20091015"
  297.87 + #define DRIVER_AUTHOR	"Nouveau"
  297.88 +--
  297.89 +cgit v0.8.3-6-g21f6
   298.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   298.2 +++ b/mesa12/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   298.3 @@ -0,0 +1,1 @@
   298.4 +#-p1|mesa-12.0.patch
   299.1 --- a/microperl/receipt	Wed May 09 17:03:28 2018 +0300
   299.2 +++ b/microperl/receipt	Thu May 10 21:12:00 2018 +0300
   299.3 @@ -14,8 +14,6 @@
   299.4  SIBLINGS="perl"
   299.5  
   299.6  compile_rules() {
   299.7 -#	cp Makefile.micro Makefile.micro.orig
   299.8 -	patch -p1 -i $stuff/microperl.patch
   299.9  	sed -i "s|usr/local|usr|; s|perl5/5.24|perl5/5.24.0|; s|unknown|$HOST_SYSTEM|" \
  299.10  		uconfig.sh
  299.11  
   300.1 --- a/microperl/stuff/microperl.patch	Wed May 09 17:03:28 2018 +0300
   300.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   300.3 @@ -1,40 +0,0 @@
   300.4 ---- a/Makefile.micro
   300.5 -+++ b/Makefile.micro
   300.6 -@@ -1,7 +1,7 @@
   300.7 - LD = $(CC)
   300.8 - CCFLAGS = -c
   300.9 - DEFINES = -DPERL_CORE -DPERL_MICRO -DSTANDARD_C -DPERL_USE_SAFE_PUTENV \
  300.10 --	  -DNO_MATHOMS
  300.11 -+	  -DNO_MATHOMS -DUSE_PERLIO
  300.12 - OPTIMIZE = 
  300.13 - CFLAGS = $(DEFINES) $(OPTIMIZE)
  300.14 - LDFLAGS = 
  300.15 -@@ -14,7 +14,7 @@
  300.16 - 
  300.17 - all:	microperl
  300.18 - 
  300.19 --O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \
  300.20 -+O = uav$(_O) ucaretx$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \
  300.21 - 	uglobals$(_O) ugv$(_O) uhv$(_O) umro$(_O)\
  300.22 - 	umg$(_O) uperlmain$(_O) uop$(_O) ureentr$(_O) \
  300.23 - 	upad$(_O) uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \
  300.24 -@@ -66,6 +66,9 @@
  300.25 - 
  300.26 - uav$(_O):	$(HE) av.c
  300.27 - 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) av.c
  300.28 -+
  300.29 -+ucaretx$(_O):	$(HE) caretx.c
  300.30 -+	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) caretx.c
  300.31 - 
  300.32 - udeb$(_O):	$(HE) deb.c
  300.33 - 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) deb.c
  300.34 ---- a/EXTERN.h
  300.35 -+++ b/EXTERN.h
  300.36 -@@ -57,3 +57,7 @@
  300.37 - #define INIT(x)
  300.38 - 
  300.39 - #undef DOINIT
  300.40 -+
  300.41 -+#define I_LIMITS
  300.42 -+#define I_FCNTL
  300.43 -+#define I_FLOAT
   301.1 --- a/microperl/stuff/miniperlmain.patch	Wed May 09 17:03:28 2018 +0300
   301.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   301.3 @@ -1,16 +0,0 @@
   301.4 ---- miniperlmain.c.orig
   301.5 -+++ miniperlmain.c
   301.6 -@@ -117,13 +117,6 @@
   301.7 -     if (!exitstatus)
   301.8 -         perl_run(my_perl);
   301.9 - 
  301.10 --    /* Unregister our signal handler before destroying my_perl */
  301.11 --    for (i = 0; PL_sig_name[i]; i++) {
  301.12 --	if (rsignal_state(PL_sig_num[i]) == (Sighandler_t) PL_csighandlerp) {
  301.13 --	    rsignal(PL_sig_num[i], (Sighandler_t) SIG_DFL);
  301.14 --	}
  301.15 --    }
  301.16 --
  301.17 -     exitstatus = perl_destruct(my_perl);
  301.18 - 
  301.19 -     perl_free(my_perl);
   302.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   302.2 +++ b/microperl/stuff/patches/microperl.patch	Thu May 10 21:12:00 2018 +0300
   302.3 @@ -0,0 +1,40 @@
   302.4 +--- a/Makefile.micro
   302.5 ++++ b/Makefile.micro
   302.6 +@@ -1,7 +1,7 @@
   302.7 + LD = $(CC)
   302.8 + CCFLAGS = -c
   302.9 + DEFINES = -DPERL_CORE -DPERL_MICRO -DSTANDARD_C -DPERL_USE_SAFE_PUTENV \
  302.10 +-	  -DNO_MATHOMS
  302.11 ++	  -DNO_MATHOMS -DUSE_PERLIO
  302.12 + OPTIMIZE = 
  302.13 + CFLAGS = $(DEFINES) $(OPTIMIZE)
  302.14 + LDFLAGS = 
  302.15 +@@ -14,7 +14,7 @@
  302.16 + 
  302.17 + all:	microperl
  302.18 + 
  302.19 +-O = uav$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \
  302.20 ++O = uav$(_O) ucaretx$(_O) udeb$(_O) udoio$(_O) udoop$(_O) udquote$(_O) udump$(_O) \
  302.21 + 	uglobals$(_O) ugv$(_O) uhv$(_O) umro$(_O)\
  302.22 + 	umg$(_O) uperlmain$(_O) uop$(_O) ureentr$(_O) \
  302.23 + 	upad$(_O) uperl$(_O) uperlio$(_O) uperly$(_O) upp$(_O) \
  302.24 +@@ -66,6 +66,9 @@
  302.25 + 
  302.26 + uav$(_O):	$(HE) av.c
  302.27 + 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) av.c
  302.28 ++
  302.29 ++ucaretx$(_O):	$(HE) caretx.c
  302.30 ++	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) caretx.c
  302.31 + 
  302.32 + udeb$(_O):	$(HE) deb.c
  302.33 + 	$(CC) $(CCFLAGS) -o $@ $(CFLAGS) deb.c
  302.34 +--- a/EXTERN.h
  302.35 ++++ b/EXTERN.h
  302.36 +@@ -57,3 +57,7 @@
  302.37 + #define INIT(x)
  302.38 + 
  302.39 + #undef DOINIT
  302.40 ++
  302.41 ++#define I_LIMITS
  302.42 ++#define I_FCNTL
  302.43 ++#define I_FLOAT
   303.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   303.2 +++ b/microperl/stuff/patches/miniperlmain.patch	Thu May 10 21:12:00 2018 +0300
   303.3 @@ -0,0 +1,16 @@
   303.4 +--- miniperlmain.c.orig
   303.5 ++++ miniperlmain.c
   303.6 +@@ -117,13 +117,6 @@
   303.7 +     if (!exitstatus)
   303.8 +         perl_run(my_perl);
   303.9 + 
  303.10 +-    /* Unregister our signal handler before destroying my_perl */
  303.11 +-    for (i = 0; PL_sig_name[i]; i++) {
  303.12 +-	if (rsignal_state(PL_sig_num[i]) == (Sighandler_t) PL_csighandlerp) {
  303.13 +-	    rsignal(PL_sig_num[i], (Sighandler_t) SIG_DFL);
  303.14 +-	}
  303.15 +-    }
  303.16 +-
  303.17 +     exitstatus = perl_destruct(my_perl);
  303.18 + 
  303.19 +     perl_free(my_perl);
   304.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   304.2 +++ b/microperl/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   304.3 @@ -0,0 +1,1 @@
   304.4 +-p1|microperl.patch
   305.1 --- a/moserial/receipt	Wed May 09 17:03:28 2018 +0300
   305.2 +++ b/moserial/receipt	Thu May 10 21:12:00 2018 +0300
   305.3 @@ -14,9 +14,6 @@
   305.4  BUILD_DEPENDS="GConf-dev gnome-doc-utils intltool vala gtk+-dev"
   305.5  
   305.6  compile_rules() {
   305.7 -	# removing help
   305.8 -	patch -Np3 -i $stuff/glade.patch
   305.9 -
  305.10  	./configure \
  305.11  		--disable-scrollkeeper \
  305.12  		$CONFIGURE_ARGS &&
   306.1 --- a/moserial/stuff/glade.patch	Wed May 09 17:03:28 2018 +0300
   306.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   306.3 @@ -1,53 +0,0 @@
   306.4 ---- moserial/source/moserial-2.32.1/data/glade/moserial.glade
   306.5 -+++ moserial.new/source/moserial-2.32.1/data/glade/moserial.glade
   306.6 -@@ -204,26 +204,6 @@
   306.7 - 		      <property name="use_stock">True</property>
   306.8 - 		    </widget>
   306.9 - 		  </child>
  306.10 --
  306.11 --		  <child>
  306.12 --		    <widget class="GtkImageMenuItem" id="menubar_contents">
  306.13 --		      <property name="visible">True</property>
  306.14 --		      <property name="label" translatable="yes">_Contents</property>
  306.15 --		      <property name="use_underline">True</property>
  306.16 --		      <accelerator key="F1" modifiers="0" signal="activate"/>
  306.17 --
  306.18 --		      <child internal-child="image">
  306.19 --			<widget class="GtkImage" id="menu-item-image4">
  306.20 --			  <property name="stock">gtk-help</property>
  306.21 --			  <property name="icon_size">4</property>
  306.22 --			  <property name="xalign">0.5</property>
  306.23 --			  <property name="yalign">0.5</property>
  306.24 --			  <property name="xpad">0</property>
  306.25 --			  <property name="ypad">0</property>
  306.26 --			</widget>
  306.27 --		      </child>
  306.28 --		    </widget>
  306.29 --		  </child>
  306.30 - 		</widget>
  306.31 - 	      </child>
  306.32 - 	    </widget>
  306.33 -@@ -388,22 +368,7 @@
  306.34 - 	    </packing>
  306.35 - 	  </child>
  306.36 - 
  306.37 --	  <child>
  306.38 --	    <widget class="GtkToolButton" id="toolbar_help">
  306.39 --	      <property name="visible">True</property>
  306.40 --	      <property name="tooltip" translatable="yes">Help</property>
  306.41 --	      <property name="label" translatable="yes">Help</property>
  306.42 --	      <property name="use_underline">True</property>
  306.43 --	      <property name="stock_id">gtk-help</property>
  306.44 --	      <property name="visible_horizontal">True</property>
  306.45 --	      <property name="visible_vertical">True</property>
  306.46 --	      <property name="is_important">True</property>
  306.47 --	    </widget>
  306.48 --	    <packing>
  306.49 --	      <property name="expand">False</property>
  306.50 --	      <property name="homogeneous">True</property>
  306.51 --	    </packing>
  306.52 --	  </child>
  306.53 -+
  306.54 - 	</widget>
  306.55 - 	<packing>
  306.56 - 	  <property name="padding">0</property>
   307.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   307.2 +++ b/moserial/stuff/patches/glade.patch	Thu May 10 21:12:00 2018 +0300
   307.3 @@ -0,0 +1,53 @@
   307.4 +--- moserial/source/moserial-2.32.1/data/glade/moserial.glade
   307.5 ++++ moserial.new/source/moserial-2.32.1/data/glade/moserial.glade
   307.6 +@@ -204,26 +204,6 @@
   307.7 + 		      <property name="use_stock">True</property>
   307.8 + 		    </widget>
   307.9 + 		  </child>
  307.10 +-
  307.11 +-		  <child>
  307.12 +-		    <widget class="GtkImageMenuItem" id="menubar_contents">
  307.13 +-		      <property name="visible">True</property>
  307.14 +-		      <property name="label" translatable="yes">_Contents</property>
  307.15 +-		      <property name="use_underline">True</property>
  307.16 +-		      <accelerator key="F1" modifiers="0" signal="activate"/>
  307.17 +-
  307.18 +-		      <child internal-child="image">
  307.19 +-			<widget class="GtkImage" id="menu-item-image4">
  307.20 +-			  <property name="stock">gtk-help</property>
  307.21 +-			  <property name="icon_size">4</property>
  307.22 +-			  <property name="xalign">0.5</property>
  307.23 +-			  <property name="yalign">0.5</property>
  307.24 +-			  <property name="xpad">0</property>
  307.25 +-			  <property name="ypad">0</property>
  307.26 +-			</widget>
  307.27 +-		      </child>
  307.28 +-		    </widget>
  307.29 +-		  </child>
  307.30 + 		</widget>
  307.31 + 	      </child>
  307.32 + 	    </widget>
  307.33 +@@ -388,22 +368,7 @@
  307.34 + 	    </packing>
  307.35 + 	  </child>
  307.36 + 
  307.37 +-	  <child>
  307.38 +-	    <widget class="GtkToolButton" id="toolbar_help">
  307.39 +-	      <property name="visible">True</property>
  307.40 +-	      <property name="tooltip" translatable="yes">Help</property>
  307.41 +-	      <property name="label" translatable="yes">Help</property>
  307.42 +-	      <property name="use_underline">True</property>
  307.43 +-	      <property name="stock_id">gtk-help</property>
  307.44 +-	      <property name="visible_horizontal">True</property>
  307.45 +-	      <property name="visible_vertical">True</property>
  307.46 +-	      <property name="is_important">True</property>
  307.47 +-	    </widget>
  307.48 +-	    <packing>
  307.49 +-	      <property name="expand">False</property>
  307.50 +-	      <property name="homogeneous">True</property>
  307.51 +-	    </packing>
  307.52 +-	  </child>
  307.53 ++
  307.54 + 	</widget>
  307.55 + 	<packing>
  307.56 + 	  <property name="padding">0</property>
   308.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   308.2 +++ b/moserial/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   308.3 @@ -0,0 +1,2 @@
   308.4 +# removing help
   308.5 +-Np3|glade.patch
   309.1 --- a/mplayerplug-in/receipt	Wed May 09 17:03:28 2018 +0300
   309.2 +++ b/mplayerplug-in/receipt	Thu May 10 21:12:00 2018 +0300
   309.3 @@ -31,15 +31,7 @@
   309.4  	grep -q slitaz-hack include/npplat.h || sed -i \
   309.5  		's/ne _NPPLAT_H_/ne _NPPLAT_H_\n#include "slitaz-hack.h"/' \
   309.6  		include/npplat.h
   309.7 -	while read file; do
   309.8 -		[ -f done.$file ] && continue
   309.9 -		echo "Apply $file..."
  309.10 -		patch -p1 < $stuff/$PACKAGE-$VERSION-$file || return 1
  309.11 -		touch done.$file
  309.12 -	done <<EOT
  309.13 -glibc210.u
  309.14 -static-iid-accessor.u
  309.15 -EOT
  309.16 +
  309.17  	make distclean
  309.18  	touch install.sh
  309.19  	get_firefox_version
   310.1 --- a/mplayerplug-in/stuff/mplayerplug-in-3.55-glibc210.u	Wed May 09 17:03:28 2018 +0300
   310.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   310.3 @@ -1,63 +0,0 @@
   310.4 ---- mplayerplug-in-3.55/Source/plugin-list.cpp
   310.5 -+++ mplayerplug-in-3.55/Source/plugin-list.cpp
   310.6 -@@ -132,9 +132,9 @@ void insert_area(Node * parent, char *ta
   310.7 - 
   310.8 - void find_area_tags(const char *smilbuffer, Node * parent)
   310.9 - {
  310.10 --    char *startarea;
  310.11 --    char *endvideo;
  310.12 --    char *start;
  310.13 -+    const char *startarea;
  310.14 -+    const char *endvideo;
  310.15 -+    const char *start;
  310.16 - 
  310.17 -     int tagtime = 0;
  310.18 -     char tagtarget[128];
  310.19 ---- mplayerplug-in-3.55/Source/plugin-setup.h
  310.20 -+++ mplayerplug-in-3.55/Source/plugin-setup.h
  310.21 -@@ -174,7 +174,7 @@ char *getURLHostname(char *url);
  310.22 - char *getURLFilename(const char *url);
  310.23 - int isMms(char *url, int nomediacache);
  310.24 - void mmsToHttp(char *dest, char *src);
  310.25 --int sendCommand(nsPluginInstance * instance, char *command);
  310.26 -+int sendCommand(nsPluginInstance * instance, const char *command);
  310.27 - int URLcmp(const char *url1, const char *url2);
  310.28 - extern void remove_quotes(char *url);
  310.29 - void killmplayer(nsPluginInstance * instance);
  310.30 ---- mplayerplug-in-3.55/Source/plugin-support.cpp
  310.31 -+++ mplayerplug-in-3.55/Source/plugin-support.cpp
  310.32 -@@ -109,7 +109,7 @@ char *getURLFilename(const char *url)
  310.33 - {
  310.34 - 
  310.35 -     char *filename;
  310.36 --    char *tmp;
  310.37 -+    const char *tmp;
  310.38 -     int len;
  310.39 - 
  310.40 -     if (DEBUG > 1)
  310.41 -@@ -454,7 +454,7 @@ void remove_quotes(char *url)
  310.42 - // in cleanup routines (like destroyCB and shut), when we know that
  310.43 - // the player thread is not running, it is safe to call without locking
  310.44 - 
  310.45 --int sendCommand(nsPluginInstance * instance, char *command)
  310.46 -+int sendCommand(nsPluginInstance * instance, const char *command)
  310.47 - {
  310.48 -     int retval;
  310.49 -     char buffer[1024];
  310.50 -	 
  310.51 ---- mplayerplug-in-3.55/Source/plugin-ui.cpp	Thu Jun 12 14:18:01 2008
  310.52 -+++ mplayerplug-in-3.55/Source/plugin-ui.cpp	Fri Jun 12 14:25:35 2009
  310.53 -@@ -283,12 +283,7 @@
  310.54 -     int term, chop;
  310.55 -     int PercentRedraw;
  310.56 - 
  310.57 --    if (0) {
  310.58 --	printf("Widget: %p\n", w);
  310.59 --	printf("Message: %s\n", message);
  310.60 --    }
  310.61 --
  310.62 --    if (DEBUG > 1)
  310.63 -+	if (DEBUG > 1)
  310.64 - 	printf("state = %i, height = %i width = %i\n", instance->state,
  310.65 - 	       instance->movie_height, instance->movie_width);
  310.66 - 
   311.1 --- a/mplayerplug-in/stuff/mplayerplug-in-3.55-static-iid-accessor.u	Wed May 09 17:03:28 2018 +0300
   311.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   311.3 @@ -1,38 +0,0 @@
   311.4 ---- mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h
   311.5 -+++ mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h
   311.6 -@@ -25,7 +25,7 @@
   311.7 - class NS_NO_VTABLE nsIScriptableWMPPlugin : public nsISupports {
   311.8 -  public: 
   311.9 - 
  311.10 --  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID)
  311.11 -+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID)
  311.12 - 
  311.13 -   /* void play (); */
  311.14 -   NS_IMETHOD Play(void) = 0;
  311.15 -@@ -38,6 +38,8 @@
  311.16 - 
  311.17 - };
  311.18 - 
  311.19 -+NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableWMPPlugin, NS_ISCRIPTABLEWMPPLUGIN_IID)
  311.20 -+
  311.21 - /* Use this macro when declaring classes that implement this interface. */
  311.22 - #define NS_DECL_NSISCRIPTABLEWMPPLUGIN \
  311.23 -   NS_IMETHOD Play(void); \
  311.24 -@@ -120,7 +122,7 @@
  311.25 - class NS_NO_VTABLE nsIScriptableMplayerPlugin : public nsISupports {
  311.26 -  public: 
  311.27 - 
  311.28 --  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID)
  311.29 -+  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID)
  311.30 - 
  311.31 -   /* void Play (); */
  311.32 -   NS_IMETHOD Play(void) = 0;
  311.33 -@@ -249,6 +251,8 @@
  311.34 - 
  311.35 - };
  311.36 - 
  311.37 -+NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableMplayerPlugin, NS_ISCRIPTABLEMPLAYERPLUGIN_IID)
  311.38 -+
  311.39 - /* Use this macro when declaring classes that implement this interface. */
  311.40 - #define NS_DECL_NSISCRIPTABLEMPLAYERPLUGIN \
  311.41 -   NS_IMETHOD Play(void); \
   312.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   312.2 +++ b/mplayerplug-in/stuff/patches/mplayerplug-in-3.55-glibc210.u	Thu May 10 21:12:00 2018 +0300
   312.3 @@ -0,0 +1,63 @@
   312.4 +--- mplayerplug-in-3.55/Source/plugin-list.cpp
   312.5 ++++ mplayerplug-in-3.55/Source/plugin-list.cpp
   312.6 +@@ -132,9 +132,9 @@ void insert_area(Node * parent, char *ta
   312.7 + 
   312.8 + void find_area_tags(const char *smilbuffer, Node * parent)
   312.9 + {
  312.10 +-    char *startarea;
  312.11 +-    char *endvideo;
  312.12 +-    char *start;
  312.13 ++    const char *startarea;
  312.14 ++    const char *endvideo;
  312.15 ++    const char *start;
  312.16 + 
  312.17 +     int tagtime = 0;
  312.18 +     char tagtarget[128];
  312.19 +--- mplayerplug-in-3.55/Source/plugin-setup.h
  312.20 ++++ mplayerplug-in-3.55/Source/plugin-setup.h
  312.21 +@@ -174,7 +174,7 @@ char *getURLHostname(char *url);
  312.22 + char *getURLFilename(const char *url);
  312.23 + int isMms(char *url, int nomediacache);
  312.24 + void mmsToHttp(char *dest, char *src);
  312.25 +-int sendCommand(nsPluginInstance * instance, char *command);
  312.26 ++int sendCommand(nsPluginInstance * instance, const char *command);
  312.27 + int URLcmp(const char *url1, const char *url2);
  312.28 + extern void remove_quotes(char *url);
  312.29 + void killmplayer(nsPluginInstance * instance);
  312.30 +--- mplayerplug-in-3.55/Source/plugin-support.cpp
  312.31 ++++ mplayerplug-in-3.55/Source/plugin-support.cpp
  312.32 +@@ -109,7 +109,7 @@ char *getURLFilename(const char *url)
  312.33 + {
  312.34 + 
  312.35 +     char *filename;
  312.36 +-    char *tmp;
  312.37 ++    const char *tmp;
  312.38 +     int len;
  312.39 + 
  312.40 +     if (DEBUG > 1)
  312.41 +@@ -454,7 +454,7 @@ void remove_quotes(char *url)
  312.42 + // in cleanup routines (like destroyCB and shut), when we know that
  312.43 + // the player thread is not running, it is safe to call without locking
  312.44 + 
  312.45 +-int sendCommand(nsPluginInstance * instance, char *command)
  312.46 ++int sendCommand(nsPluginInstance * instance, const char *command)
  312.47 + {
  312.48 +     int retval;
  312.49 +     char buffer[1024];
  312.50 +	 
  312.51 +--- mplayerplug-in-3.55/Source/plugin-ui.cpp	Thu Jun 12 14:18:01 2008
  312.52 ++++ mplayerplug-in-3.55/Source/plugin-ui.cpp	Fri Jun 12 14:25:35 2009
  312.53 +@@ -283,12 +283,7 @@
  312.54 +     int term, chop;
  312.55 +     int PercentRedraw;
  312.56 + 
  312.57 +-    if (0) {
  312.58 +-	printf("Widget: %p\n", w);
  312.59 +-	printf("Message: %s\n", message);
  312.60 +-    }
  312.61 +-
  312.62 +-    if (DEBUG > 1)
  312.63 ++	if (DEBUG > 1)
  312.64 + 	printf("state = %i, height = %i width = %i\n", instance->state,
  312.65 + 	       instance->movie_height, instance->movie_width);
  312.66 + 
   313.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   313.2 +++ b/mplayerplug-in/stuff/patches/mplayerplug-in-3.55-static-iid-accessor.u	Thu May 10 21:12:00 2018 +0300
   313.3 @@ -0,0 +1,38 @@
   313.4 +--- mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h
   313.5 ++++ mplayerplug-in-3.55/Source/nsIScriptableMplayerPlugin.h
   313.6 +@@ -25,7 +25,7 @@
   313.7 + class NS_NO_VTABLE nsIScriptableWMPPlugin : public nsISupports {
   313.8 +  public: 
   313.9 + 
  313.10 +-  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID)
  313.11 ++  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEWMPPLUGIN_IID)
  313.12 + 
  313.13 +   /* void play (); */
  313.14 +   NS_IMETHOD Play(void) = 0;
  313.15 +@@ -38,6 +38,8 @@
  313.16 + 
  313.17 + };
  313.18 + 
  313.19 ++NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableWMPPlugin, NS_ISCRIPTABLEWMPPLUGIN_IID)
  313.20 ++
  313.21 + /* Use this macro when declaring classes that implement this interface. */
  313.22 + #define NS_DECL_NSISCRIPTABLEWMPPLUGIN \
  313.23 +   NS_IMETHOD Play(void); \
  313.24 +@@ -120,7 +122,7 @@
  313.25 + class NS_NO_VTABLE nsIScriptableMplayerPlugin : public nsISupports {
  313.26 +  public: 
  313.27 + 
  313.28 +-  NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID)
  313.29 ++  NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISCRIPTABLEMPLAYERPLUGIN_IID)
  313.30 + 
  313.31 +   /* void Play (); */
  313.32 +   NS_IMETHOD Play(void) = 0;
  313.33 +@@ -249,6 +251,8 @@
  313.34 + 
  313.35 + };
  313.36 + 
  313.37 ++NS_DEFINE_STATIC_IID_ACCESSOR(nsIScriptableMplayerPlugin, NS_ISCRIPTABLEMPLAYERPLUGIN_IID)
  313.38 ++
  313.39 + /* Use this macro when declaring classes that implement this interface. */
  313.40 + #define NS_DECL_NSISCRIPTABLEMPLAYERPLUGIN \
  313.41 +   NS_IMETHOD Play(void); \
   314.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   314.2 +++ b/mplayerplug-in/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   314.3 @@ -0,0 +1,2 @@
   314.4 +-p1|mplayerplug-in-3.55-glibc210.u
   314.5 +-p1|mplayerplug-in-3.55-static-iid-accessor.u
   315.1 --- a/mtpaint/receipt	Wed May 09 17:03:28 2018 +0300
   315.2 +++ b/mtpaint/receipt	Thu May 10 21:12:00 2018 +0300
   315.3 @@ -15,7 +15,6 @@
   315.4  BUILD_DEPENDS="gtk+-dev libpng16-dev lcms-dev zlib-dev gettext"
   315.5  
   315.6  compile_rules() {
   315.7 -	patch -p0 < $stuff/mtpaint.patch
   315.8  	sed 's/mem_undo_limit,\t32/mem_undo_limit,\t64/' -i $src/src/mainwindow.c
   315.9  
  315.10  	case "$ARCH" in
   316.1 --- a/mtpaint/stuff/mtpaint.patch	Wed May 09 17:03:28 2018 +0300
   316.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   316.3 @@ -1,13 +0,0 @@
   316.4 ---- src/spawn.c.orig
   316.5 -+++ src/spawn.c
   316.6 -@@ -411,8 +411,8 @@
   316.7 - 		{"View EXIF data (leafpad)", "exif %f | leafpad"},
   316.8 - 		{"View filesystem data (xterm)", "xterm -hold -e ls -l %f"},
   316.9 - 		{"Edit in Gimp", "gimp %f"},
  316.10 --		{"View in GQview", "gqview %f"},
  316.11 --		{"Print image", "kprinter %f"},
  316.12 -+		{"View in GPicView", "gpicview %f"},
  316.13 -+		{"Print image", "yad --print --type=IMAGE --print-add-preview --filename=%f"},
  316.14 - 		{"Email image", "seamonkey -compose attachment=file://%f"},
  316.15 - 		{"Send image to Firefox", "firefox %f"},
  316.16 - 		{"Send image to OpenOffice", "soffice %f"},
   317.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   317.2 +++ b/mtpaint/stuff/patches/mtpaint.patch	Thu May 10 21:12:00 2018 +0300
   317.3 @@ -0,0 +1,13 @@
   317.4 +--- src/spawn.c.orig
   317.5 ++++ src/spawn.c
   317.6 +@@ -411,8 +411,8 @@
   317.7 + 		{"View EXIF data (leafpad)", "exif %f | leafpad"},
   317.8 + 		{"View filesystem data (xterm)", "xterm -hold -e ls -l %f"},
   317.9 + 		{"Edit in Gimp", "gimp %f"},
  317.10 +-		{"View in GQview", "gqview %f"},
  317.11 +-		{"Print image", "kprinter %f"},
  317.12 ++		{"View in GPicView", "gpicview %f"},
  317.13 ++		{"Print image", "yad --print --type=IMAGE --print-add-preview --filename=%f"},
  317.14 + 		{"Email image", "seamonkey -compose attachment=file://%f"},
  317.15 + 		{"Send image to Firefox", "firefox %f"},
  317.16 + 		{"Send image to OpenOffice", "soffice %f"},
   318.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   318.2 +++ b/mtpaint/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   318.3 @@ -0,0 +1,1 @@
   318.4 +-p0|mtpaint.patch
   319.1 --- a/mupdf/receipt	Wed May 09 17:03:28 2018 +0300
   319.2 +++ b/mupdf/receipt	Thu May 10 21:12:00 2018 +0300
   319.3 @@ -36,10 +36,6 @@
   319.4  EOT
   319.5  			ln -s /usr/include/freetype2/freetype/ /usr/include/freetype
   319.6  			;;
   319.7 -		*)
   319.8 -			# apply debian 1.4-1 patch
   319.9 -			patch -p1 < $stuff/use_openjpeg_1.5.patch
  319.10 -			;;
  319.11  	esac
  319.12  	make ${ARCH_ARGS} build=release &&
  319.13  	make ${ARCH_ARGS} build=release prefix=/usr install
   320.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   320.2 +++ b/mupdf/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   320.3 @@ -0,0 +1,2 @@
   320.4 +# apply debian 1.4-1 patch
   320.5 +-p1|use_openjpeg_1.5.patch
   321.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   321.2 +++ b/mupdf/stuff/patches/use_openjpeg_1.5.patch	Thu May 10 21:12:00 2018 +0300
   321.3 @@ -0,0 +1,149 @@
   321.4 +commit a7341e98ef48d6041028b7294d1acc13665b04ba
   321.5 +Author: Quoc-Viet Nguyen <afelion@gmail.com>
   321.6 +Date:   Fri Apr 18 23:48:29 2014 +1000
   321.7 +
   321.8 +    Use openjpeg 1.5 rather than 2.0
   321.9 +---
  321.10 + source/fitz/load-jpx.c | 104 +++++++++----------------------------------------
  321.11 + 1 file changed, 18 insertions(+), 86 deletions(-)
  321.12 +
  321.13 +diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
  321.14 +index dfb89f4..d27b5de 100644
  321.15 +--- a/source/fitz/load-jpx.c
  321.16 ++++ b/source/fitz/load-jpx.c
  321.17 +@@ -605,41 +605,6 @@
  321.18 + 	/* fz_warn("openjpeg info: %s", msg); */
  321.19 + }
  321.20 + 
  321.21 +-static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data)
  321.22 +-{
  321.23 +-	stream_block *sb = (stream_block *)p_user_data;
  321.24 +-	OPJ_SIZE_T len;
  321.25 +-
  321.26 +-	len = sb->size - sb->pos;
  321.27 +-	if (len == 0)
  321.28 +-		return (OPJ_SIZE_T)-1; /* End of file! */
  321.29 +-	if (len > p_nb_bytes)
  321.30 +-		len = p_nb_bytes;
  321.31 +-	memcpy(p_buffer, sb->data + sb->pos, len);
  321.32 +-	sb->pos += len;
  321.33 +-	return len;
  321.34 +-}
  321.35 +-
  321.36 +-static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data)
  321.37 +-{
  321.38 +-	stream_block *sb = (stream_block *)p_user_data;
  321.39 +-
  321.40 +-	if (skip > (OPJ_OFF_T)(sb->size - sb->pos))
  321.41 +-		skip = (OPJ_OFF_T)(sb->size - sb->pos);
  321.42 +-	sb->pos += skip;
  321.43 +-	return sb->pos;
  321.44 +-}
  321.45 +-
  321.46 +-static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data)
  321.47 +-{
  321.48 +-	stream_block *sb = (stream_block *)p_user_data;
  321.49 +-
  321.50 +-	if (seek_pos > (OPJ_OFF_T)sb->size)
  321.51 +-		return OPJ_FALSE;
  321.52 +-	sb->pos = seek_pos;
  321.53 +-	return OPJ_TRUE;
  321.54 +-}
  321.55 +-
  321.56 + static int
  321.57 + l2subfactor(fz_context *ctx, unsigned int max_w, unsigned int w)
  321.58 + {
  321.59 +@@ -656,10 +621,11 @@
  321.60 + jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta)
  321.61 + {
  321.62 + 	fz_pixmap *img;
  321.63 ++	opj_event_mgr_t evtmgr;
  321.64 + 	opj_dparameters_t params;
  321.65 +-	opj_codec_t *codec;
  321.66 ++	opj_dinfo_t *codec;
  321.67 + 	opj_image_t *jpx;
  321.68 +-	opj_stream_t *stream;
  321.69 ++	opj_cio_t *stream;
  321.70 + 	unsigned char *p;
  321.71 + 	OPJ_CODEC_FORMAT format;
  321.72 + 	int a, n, w, h, depth, sgnd;
  321.73 +@@ -677,55 +643,30 @@
  321.74 + 
  321.75 + 	/* Check for SOC marker -- if found we have a bare J2K stream */
  321.76 + 	if (data[0] == 0xFF && data[1] == 0x4F)
  321.77 +-		format = OPJ_CODEC_J2K;
  321.78 ++		format = CODEC_J2K;
  321.79 + 	else
  321.80 +-		format = OPJ_CODEC_JP2;
  321.81 ++		format = CODEC_JP2;
  321.82 + 
  321.83 ++	memset(&evtmgr, 0, sizeof(evtmgr));
  321.84 ++	evtmgr.error_handler = fz_opj_error_callback;
  321.85 ++	evtmgr.warning_handler = fz_opj_warning_callback;
  321.86 ++	evtmgr.info_handler = fz_opj_info_callback;
  321.87 ++
  321.88 + 	opj_set_default_decoder_parameters(&params);
  321.89 + 	if (fz_colorspace_is_indexed(ctx, defcs))
  321.90 + 		params.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
  321.91 + 
  321.92 + 	codec = opj_create_decompress(format);
  321.93 +-	opj_set_info_handler(codec, fz_opj_info_callback, ctx);
  321.94 +-	opj_set_warning_handler(codec, fz_opj_warning_callback, ctx);
  321.95 +-	opj_set_error_handler(codec, fz_opj_error_callback, ctx);
  321.96 +-	if (!opj_setup_decoder(codec, &params))
  321.97 +-	{
  321.98 +-		opj_destroy_codec(codec);
  321.99 +-		fz_throw(ctx, FZ_ERROR_GENERIC, "j2k decode failed");
 321.100 +-	}
 321.101 ++	opj_set_event_mgr((opj_common_ptr)codec, &evtmgr, ctx);
 321.102 ++	opj_setup_decoder(codec, &params);
 321.103 + 
 321.104 +-	stream = opj_stream_default_create(OPJ_TRUE);
 321.105 +-	sb.data = data;
 321.106 +-	sb.pos = 0;
 321.107 +-	sb.size = size;
 321.108 ++	stream = opj_cio_open((opj_common_ptr)codec, data, size);
 321.109 + 
 321.110 +-	opj_stream_set_read_function(stream, fz_opj_stream_read);
 321.111 +-	opj_stream_set_skip_function(stream, fz_opj_stream_skip);
 321.112 +-	opj_stream_set_seek_function(stream, fz_opj_stream_seek);
 321.113 +-	opj_stream_set_user_data(stream, &sb, NULL);
 321.114 +-	/* Set the length to avoid an assert */
 321.115 +-	opj_stream_set_user_data_length(stream, size);
 321.116 ++	jpx = opj_decode(codec, stream);
 321.117 + 
 321.118 +-	if (!opj_read_header(stream, codec, &jpx))
 321.119 +-	{
 321.120 +-		opj_stream_destroy(stream);
 321.121 +-		opj_destroy_codec(codec);
 321.122 +-		fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to read JPX header");
 321.123 +-	}
 321.124 ++	opj_cio_close(stream);
 321.125 ++	opj_destroy_decompress(codec);
 321.126 + 
 321.127 +-	if (!opj_decode(codec, stream, jpx))
 321.128 +-	{
 321.129 +-		opj_stream_destroy(stream);
 321.130 +-		opj_destroy_codec(codec);
 321.131 +-		opj_image_destroy(jpx);
 321.132 +-		fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to decode JPX image");
 321.133 +-	}
 321.134 +-
 321.135 +-	opj_stream_destroy(stream);
 321.136 +-	opj_destroy_codec(codec);
 321.137 +-
 321.138 +-	/* jpx should never be NULL here, but check anyway */
 321.139 + 	if (!jpx)
 321.140 + 		fz_throw(ctx, FZ_ERROR_GENERIC, "opj_decode failed");
 321.141 + 
 321.142 +@@ -733,8 +674,8 @@
 321.143 + 	depth = jpx->comps[0].prec;
 321.144 + 	sgnd = jpx->comps[0].sgnd;
 321.145 + 
 321.146 +-	if (jpx->color_space == OPJ_CLRSPC_SRGB && n == 4) { n = 3; a = 1; }
 321.147 +-	else if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 4) { n = 3; a = 1; }
 321.148 ++	if (jpx->color_space == CLRSPC_SRGB && n == 4) { n = 3; a = 1; }
 321.149 ++	else if (jpx->color_space == CLRSPC_SYCC && n == 4) { n = 3; a = 1; }
 321.150 + 	else if (n == 2) { n = 1; a = 1; }
 321.151 + 	else if (n > 4) { n = 4; a = 1; }
 321.152 + 	else { a = 0; }
   322.1 --- a/mupdf/stuff/use_openjpeg_1.5.patch	Wed May 09 17:03:28 2018 +0300
   322.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   322.3 @@ -1,149 +0,0 @@
   322.4 -commit a7341e98ef48d6041028b7294d1acc13665b04ba
   322.5 -Author: Quoc-Viet Nguyen <afelion@gmail.com>
   322.6 -Date:   Fri Apr 18 23:48:29 2014 +1000
   322.7 -
   322.8 -    Use openjpeg 1.5 rather than 2.0
   322.9 ----
  322.10 - source/fitz/load-jpx.c | 104 +++++++++----------------------------------------
  322.11 - 1 file changed, 18 insertions(+), 86 deletions(-)
  322.12 -
  322.13 -diff --git a/source/fitz/load-jpx.c b/source/fitz/load-jpx.c
  322.14 -index dfb89f4..d27b5de 100644
  322.15 ---- a/source/fitz/load-jpx.c
  322.16 -+++ b/source/fitz/load-jpx.c
  322.17 -@@ -605,41 +605,6 @@
  322.18 - 	/* fz_warn("openjpeg info: %s", msg); */
  322.19 - }
  322.20 - 
  322.21 --static OPJ_SIZE_T fz_opj_stream_read(void * p_buffer, OPJ_SIZE_T p_nb_bytes, void * p_user_data)
  322.22 --{
  322.23 --	stream_block *sb = (stream_block *)p_user_data;
  322.24 --	OPJ_SIZE_T len;
  322.25 --
  322.26 --	len = sb->size - sb->pos;
  322.27 --	if (len == 0)
  322.28 --		return (OPJ_SIZE_T)-1; /* End of file! */
  322.29 --	if (len > p_nb_bytes)
  322.30 --		len = p_nb_bytes;
  322.31 --	memcpy(p_buffer, sb->data + sb->pos, len);
  322.32 --	sb->pos += len;
  322.33 --	return len;
  322.34 --}
  322.35 --
  322.36 --static OPJ_OFF_T fz_opj_stream_skip(OPJ_OFF_T skip, void * p_user_data)
  322.37 --{
  322.38 --	stream_block *sb = (stream_block *)p_user_data;
  322.39 --
  322.40 --	if (skip > (OPJ_OFF_T)(sb->size - sb->pos))
  322.41 --		skip = (OPJ_OFF_T)(sb->size - sb->pos);
  322.42 --	sb->pos += skip;
  322.43 --	return sb->pos;
  322.44 --}
  322.45 --
  322.46 --static OPJ_BOOL fz_opj_stream_seek(OPJ_OFF_T seek_pos, void * p_user_data)
  322.47 --{
  322.48 --	stream_block *sb = (stream_block *)p_user_data;
  322.49 --
  322.50 --	if (seek_pos > (OPJ_OFF_T)sb->size)
  322.51 --		return OPJ_FALSE;
  322.52 --	sb->pos = seek_pos;
  322.53 --	return OPJ_TRUE;
  322.54 --}
  322.55 --
  322.56 - static int
  322.57 - l2subfactor(fz_context *ctx, unsigned int max_w, unsigned int w)
  322.58 - {
  322.59 -@@ -656,10 +621,11 @@
  322.60 - jpx_read_image(fz_context *ctx, fz_jpxd *state, unsigned char *data, size_t size, fz_colorspace *defcs, int onlymeta)
  322.61 - {
  322.62 - 	fz_pixmap *img;
  322.63 -+	opj_event_mgr_t evtmgr;
  322.64 - 	opj_dparameters_t params;
  322.65 --	opj_codec_t *codec;
  322.66 -+	opj_dinfo_t *codec;
  322.67 - 	opj_image_t *jpx;
  322.68 --	opj_stream_t *stream;
  322.69 -+	opj_cio_t *stream;
  322.70 - 	unsigned char *p;
  322.71 - 	OPJ_CODEC_FORMAT format;
  322.72 - 	int a, n, w, h, depth, sgnd;
  322.73 -@@ -677,55 +643,30 @@
  322.74 - 
  322.75 - 	/* Check for SOC marker -- if found we have a bare J2K stream */
  322.76 - 	if (data[0] == 0xFF && data[1] == 0x4F)
  322.77 --		format = OPJ_CODEC_J2K;
  322.78 -+		format = CODEC_J2K;
  322.79 - 	else
  322.80 --		format = OPJ_CODEC_JP2;
  322.81 -+		format = CODEC_JP2;
  322.82 - 
  322.83 -+	memset(&evtmgr, 0, sizeof(evtmgr));
  322.84 -+	evtmgr.error_handler = fz_opj_error_callback;
  322.85 -+	evtmgr.warning_handler = fz_opj_warning_callback;
  322.86 -+	evtmgr.info_handler = fz_opj_info_callback;
  322.87 -+
  322.88 - 	opj_set_default_decoder_parameters(&params);
  322.89 - 	if (fz_colorspace_is_indexed(ctx, defcs))
  322.90 - 		params.flags |= OPJ_DPARAMETERS_IGNORE_PCLR_CMAP_CDEF_FLAG;
  322.91 - 
  322.92 - 	codec = opj_create_decompress(format);
  322.93 --	opj_set_info_handler(codec, fz_opj_info_callback, ctx);
  322.94 --	opj_set_warning_handler(codec, fz_opj_warning_callback, ctx);
  322.95 --	opj_set_error_handler(codec, fz_opj_error_callback, ctx);
  322.96 --	if (!opj_setup_decoder(codec, &params))
  322.97 --	{
  322.98 --		opj_destroy_codec(codec);
  322.99 --		fz_throw(ctx, FZ_ERROR_GENERIC, "j2k decode failed");
 322.100 --	}
 322.101 -+	opj_set_event_mgr((opj_common_ptr)codec, &evtmgr, ctx);
 322.102 -+	opj_setup_decoder(codec, &params);
 322.103 - 
 322.104 --	stream = opj_stream_default_create(OPJ_TRUE);
 322.105 --	sb.data = data;
 322.106 --	sb.pos = 0;
 322.107 --	sb.size = size;
 322.108 -+	stream = opj_cio_open((opj_common_ptr)codec, data, size);
 322.109 - 
 322.110 --	opj_stream_set_read_function(stream, fz_opj_stream_read);
 322.111 --	opj_stream_set_skip_function(stream, fz_opj_stream_skip);
 322.112 --	opj_stream_set_seek_function(stream, fz_opj_stream_seek);
 322.113 --	opj_stream_set_user_data(stream, &sb, NULL);
 322.114 --	/* Set the length to avoid an assert */
 322.115 --	opj_stream_set_user_data_length(stream, size);
 322.116 -+	jpx = opj_decode(codec, stream);
 322.117 - 
 322.118 --	if (!opj_read_header(stream, codec, &jpx))
 322.119 --	{
 322.120 --		opj_stream_destroy(stream);
 322.121 --		opj_destroy_codec(codec);
 322.122 --		fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to read JPX header");
 322.123 --	}
 322.124 -+	opj_cio_close(stream);
 322.125 -+	opj_destroy_decompress(codec);
 322.126 - 
 322.127 --	if (!opj_decode(codec, stream, jpx))
 322.128 --	{
 322.129 --		opj_stream_destroy(stream);
 322.130 --		opj_destroy_codec(codec);
 322.131 --		opj_image_destroy(jpx);
 322.132 --		fz_throw(ctx, FZ_ERROR_GENERIC, "Failed to decode JPX image");
 322.133 --	}
 322.134 --
 322.135 --	opj_stream_destroy(stream);
 322.136 --	opj_destroy_codec(codec);
 322.137 --
 322.138 --	/* jpx should never be NULL here, but check anyway */
 322.139 - 	if (!jpx)
 322.140 - 		fz_throw(ctx, FZ_ERROR_GENERIC, "opj_decode failed");
 322.141 - 
 322.142 -@@ -733,8 +674,8 @@
 322.143 - 	depth = jpx->comps[0].prec;
 322.144 - 	sgnd = jpx->comps[0].sgnd;
 322.145 - 
 322.146 --	if (jpx->color_space == OPJ_CLRSPC_SRGB && n == 4) { n = 3; a = 1; }
 322.147 --	else if (jpx->color_space == OPJ_CLRSPC_SYCC && n == 4) { n = 3; a = 1; }
 322.148 -+	if (jpx->color_space == CLRSPC_SRGB && n == 4) { n = 3; a = 1; }
 322.149 -+	else if (jpx->color_space == CLRSPC_SYCC && n == 4) { n = 3; a = 1; }
 322.150 - 	else if (n == 2) { n = 1; a = 1; }
 322.151 - 	else if (n > 4) { n = 4; a = 1; }
 322.152 - 	else { a = 0; }
   323.1 --- a/musique/receipt	Wed May 09 17:03:28 2018 +0300
   323.2 +++ b/musique/receipt	Thu May 10 21:12:00 2018 +0300
   323.3 @@ -18,9 +18,8 @@
   323.4  # Rules to configure and make the package.
   323.5  compile_rules()
   323.6  {
   323.7 -	# put default icons to resources (instead of to hicolor icon theme)
   323.8 +	# put default icons to resources (instead of to hicolor icon theme) + patch
   323.9  	cp -a $stuff/*.png $src/images
  323.10 -	patch -p0 < $stuff/icons.diff
  323.11  
  323.12  	mkdir build; cd build
  323.13  	qmake PREFIX=/usr ../musique.pro &&
   324.1 --- a/musique/stuff/icons.diff	Wed May 09 17:03:28 2018 +0300
   324.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   324.3 @@ -1,21 +0,0 @@
   324.4 ---- resources.qrc
   324.5 -+++ resources.qrc
   324.6 -@@ -8,5 +8,18 @@
   324.7 -         <file>images/item/track.png</file>
   324.8 -         <file>style.css</file>
   324.9 -         <file>images/sort.png</file>
  324.10 -+        <file>images/audio-volume-high.png</file>
  324.11 -+        <file>images/audio-volume-muted.png</file>
  324.12 -+        <file>images/edit-clear.png</file>
  324.13 -+        <file>images/go-previous.png</file>
  324.14 -+        <file>images/gtk-info.png</file>
  324.15 -+        <file>images/list-add.png</file>
  324.16 -+        <file>images/media-playback-start.png</file>
  324.17 -+        <file>images/media-playback-stop.png</file>
  324.18 -+        <file>images/media-playlist-repeat.png</file>
  324.19 -+        <file>images/media-playlist-shuffle.png</file>
  324.20 -+        <file>images/media-skip-backward.png</file>
  324.21 -+        <file>images/media-skip-forward.png</file>
  324.22 -+        <file>images/view-restore.png</file>
  324.23 -     </qresource>
  324.24 - </RCC>
   325.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   325.2 +++ b/musique/stuff/patches/icons.diff	Thu May 10 21:12:00 2018 +0300
   325.3 @@ -0,0 +1,21 @@
   325.4 +--- resources.qrc
   325.5 ++++ resources.qrc
   325.6 +@@ -8,5 +8,18 @@
   325.7 +         <file>images/item/track.png</file>
   325.8 +         <file>style.css</file>
   325.9 +         <file>images/sort.png</file>
  325.10 ++        <file>images/audio-volume-high.png</file>
  325.11 ++        <file>images/audio-volume-muted.png</file>
  325.12 ++        <file>images/edit-clear.png</file>
  325.13 ++        <file>images/go-previous.png</file>
  325.14 ++        <file>images/gtk-info.png</file>
  325.15 ++        <file>images/list-add.png</file>
  325.16 ++        <file>images/media-playback-start.png</file>
  325.17 ++        <file>images/media-playback-stop.png</file>
  325.18 ++        <file>images/media-playlist-repeat.png</file>
  325.19 ++        <file>images/media-playlist-shuffle.png</file>
  325.20 ++        <file>images/media-skip-backward.png</file>
  325.21 ++        <file>images/media-skip-forward.png</file>
  325.22 ++        <file>images/view-restore.png</file>
  325.23 +     </qresource>
  325.24 + </RCC>
   326.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   326.2 +++ b/musique/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   326.3 @@ -0,0 +1,1 @@
   326.4 +-p0|icons.diff
   327.1 --- a/ndoutils/receipt	Wed May 09 17:03:28 2018 +0300
   327.2 +++ b/ndoutils/receipt	Thu May 10 21:12:00 2018 +0300
   327.3 @@ -14,15 +14,6 @@
   327.4  BUILD_DEPENDS="mysql-dev"
   327.5  
   327.6  compile_rules() {
   327.7 -	while read patch_file; do
   327.8 -		if [ ! -f done.$patch_file ]; then
   327.9 -			patch -p1 < $stuff/$patch_file || exit 1
  327.10 -			touch done.$patch_file
  327.11 -		fi
  327.12 -	done <<EOT
  327.13 -$PACKAGE-$VERSION-Makefiles.in.u
  327.14 -EOT
  327.15 -
  327.16  	./configure \
  327.17  		--with-ndo2db-user=nagios \
  327.18  		--with-ndo2db-group=nagios \
   328.1 --- a/ndoutils/stuff/ndoutils-1.4b9-Makefile.in.u	Wed May 09 17:03:28 2018 +0300
   328.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   328.3 @@ -1,11 +0,0 @@
   328.4 ---- ndoutils-1.4b9-ori/Makefile	Sat Jun 12 09:56:33 2010
   328.5 -+++ ndoutils-1.4b9/Makefile	Sat Jun 12 09:57:06 2010
   328.6 -@@ -17,7 +17,7 @@
   328.7 - BINDIR=${exec_prefix}/bin
   328.8 - LIBEXECDIR=${exec_prefix}/libexec
   328.9 - INSTALL=/usr/bin/install -c
  328.10 --INSTALL_OPTS=-o nagios -g nagios
  328.11 -+INSTALL_OPTS=
  328.12 - INIT_DIR=/etc/init.d
  328.13 - INIT_OPTS=-o root -g root
  328.14 - 
   329.1 --- a/ndoutils/stuff/ndoutils-1.4b9-Makefiles.in.u	Wed May 09 17:03:28 2018 +0300
   329.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   329.3 @@ -1,42 +0,0 @@
   329.4 ---- ndoutils-1.4b9-ori/Makefile.in	Tue Sep 15 14:04:34 2009
   329.5 -+++ ndoutils-1.4b9/Makefile.in	Sat Jun 12 10:47:30 2010
   329.6 -@@ -17,7 +17,7 @@
   329.7 - BINDIR=@bindir@
   329.8 - LIBEXECDIR=@libexecdir@
   329.9 - INSTALL=@INSTALL@
  329.10 --INSTALL_OPTS=@INSTALL_OPTS@
  329.11 -+INSTALL_OPTS=
  329.12 - INIT_DIR=@init_dir@
  329.13 - INIT_OPTS=-o root -g root
  329.14 - 
  329.15 -@@ -32,8 +32,8 @@
  329.16 - 
  329.17 - install-config:
  329.18 - 	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
  329.19 --	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndo2db.cfg-sample $(DESTDIR)$(CFGDIR)
  329.20 --	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndomod.cfg-sample $(DESTDIR)$(CFGDIR)
  329.21 -+	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndo2db.cfg-sample $(DESTDIR)$(CFGDIR)/ndo2db.cfg
  329.22 -+	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndomod.cfg-sample $(DESTDIR)$(CFGDIR)/ndomod.cfg
  329.23 - 	@echo ""
  329.24 - 	@echo "*** Config files installed ***"
  329.25 - 	@echo ""
  329.26 ---- ndoutils-1.4b9-ori/src/Makefile.in	Tue Sep 15 14:04:35 2009
  329.27 -+++ ndoutils-1.4b9/src/Makefile.in	Sat Jun 12 10:53:40 2010
  329.28 -@@ -16,7 +16,7 @@
  329.29 - LIBEXECDIR=@libexecdir@
  329.30 - CGIDIR=@sbindir@
  329.31 - INSTALL=@INSTALL@
  329.32 --INSTALL_OPTS=@INSTALL_OPTS@
  329.33 -+INSTALL_OPTS=
  329.34 - 
  329.35 - CC=@CC@
  329.36 - 
  329.37 -@@ -130,6 +130,7 @@
  329.38 - 
  329.39 - install-3x:
  329.40 - 	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
  329.41 -+	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR)
  329.42 - 	$(INSTALL) -m 755 $(INSTALL_OPTS) ndo2db-3x $(DESTDIR)$(BINDIR)/ndo2db
  329.43 --	$(INSTALL) -m 755 $(INSTALL_OPTS) ndomod-3x.o $(DESTDIR)$(BINDIR)/ndomod.o
  329.44 -+	$(INSTALL) -m 755 $(INSTALL_OPTS) ndomod-3x.o $(DESTDIR)$(LIBEXECDIR)/ndomod.o
  329.45 - 
   330.1 --- a/ndoutils/stuff/ndoutils-1.5.2-Makefiles.in.u	Wed May 09 17:03:28 2018 +0300
   330.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   330.3 @@ -1,42 +0,0 @@
   330.4 ---- ndoutils-1.4b9-ori/Makefile.in	Tue Sep 15 14:04:34 2009
   330.5 -+++ ndoutils-1.4b9/Makefile.in	Sat Jun 12 10:47:30 2010
   330.6 -@@ -17,7 +17,7 @@
   330.7 - BINDIR=@bindir@
   330.8 - LIBEXECDIR=@libexecdir@
   330.9 - INSTALL=@INSTALL@
  330.10 --INSTALL_OPTS=@INSTALL_OPTS@
  330.11 -+INSTALL_OPTS=
  330.12 - INIT_DIR=@init_dir@
  330.13 - INIT_OPTS=-o root -g root
  330.14 - 
  330.15 -@@ -32,8 +32,8 @@
  330.16 - 
  330.17 - install-config:
  330.18 - 	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
  330.19 --	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndo2db.cfg-sample $(DESTDIR)$(CFGDIR)
  330.20 --	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndomod.cfg-sample $(DESTDIR)$(CFGDIR)
  330.21 -+	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndo2db.cfg-sample $(DESTDIR)$(CFGDIR)/ndo2db.cfg
  330.22 -+	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndomod.cfg-sample $(DESTDIR)$(CFGDIR)/ndomod.cfg
  330.23 - 	@echo ""
  330.24 - 	@echo "*** Config files installed ***"
  330.25 - 	@echo ""
  330.26 ---- ndoutils-1.4b9-ori/src/Makefile.in	Tue Sep 15 14:04:35 2009
  330.27 -+++ ndoutils-1.4b9/src/Makefile.in	Sat Jun 12 10:53:40 2010
  330.28 -@@ -16,7 +16,7 @@
  330.29 - LIBEXECDIR=@libexecdir@
  330.30 - CGIDIR=@sbindir@
  330.31 - INSTALL=@INSTALL@
  330.32 --INSTALL_OPTS=@INSTALL_OPTS@
  330.33 -+INSTALL_OPTS=
  330.34 - 
  330.35 - CC=@CC@
  330.36 - 
  330.37 -@@ -130,6 +130,7 @@
  330.38 - 
  330.39 - install-3x:
  330.40 - 	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
  330.41 -+	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR)
  330.42 - 	$(INSTALL) -m 755 $(INSTALL_OPTS) ndo2db-3x $(DESTDIR)$(BINDIR)/ndo2db
  330.43 --	$(INSTALL) -m 755 $(INSTALL_OPTS) ndomod-3x.o $(DESTDIR)$(BINDIR)/ndomod.o
  330.44 -+	$(INSTALL) -m 755 $(INSTALL_OPTS) ndomod-3x.o $(DESTDIR)$(LIBEXECDIR)/ndomod.o
  330.45 - 
   331.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   331.2 +++ b/ndoutils/stuff/patches/ndoutils-1.5.2-Makefiles.in.u	Thu May 10 21:12:00 2018 +0300
   331.3 @@ -0,0 +1,42 @@
   331.4 +--- ndoutils-1.4b9-ori/Makefile.in	Tue Sep 15 14:04:34 2009
   331.5 ++++ ndoutils-1.4b9/Makefile.in	Sat Jun 12 10:47:30 2010
   331.6 +@@ -17,7 +17,7 @@
   331.7 + BINDIR=@bindir@
   331.8 + LIBEXECDIR=@libexecdir@
   331.9 + INSTALL=@INSTALL@
  331.10 +-INSTALL_OPTS=@INSTALL_OPTS@
  331.11 ++INSTALL_OPTS=
  331.12 + INIT_DIR=@init_dir@
  331.13 + INIT_OPTS=-o root -g root
  331.14 + 
  331.15 +@@ -32,8 +32,8 @@
  331.16 + 
  331.17 + install-config:
  331.18 + 	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(CFGDIR)
  331.19 +-	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndo2db.cfg-sample $(DESTDIR)$(CFGDIR)
  331.20 +-	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndomod.cfg-sample $(DESTDIR)$(CFGDIR)
  331.21 ++	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndo2db.cfg-sample $(DESTDIR)$(CFGDIR)/ndo2db.cfg
  331.22 ++	$(INSTALL) -b -m 664 $(INSTALL_OPTS) config/ndomod.cfg-sample $(DESTDIR)$(CFGDIR)/ndomod.cfg
  331.23 + 	@echo ""
  331.24 + 	@echo "*** Config files installed ***"
  331.25 + 	@echo ""
  331.26 +--- ndoutils-1.4b9-ori/src/Makefile.in	Tue Sep 15 14:04:35 2009
  331.27 ++++ ndoutils-1.4b9/src/Makefile.in	Sat Jun 12 10:53:40 2010
  331.28 +@@ -16,7 +16,7 @@
  331.29 + LIBEXECDIR=@libexecdir@
  331.30 + CGIDIR=@sbindir@
  331.31 + INSTALL=@INSTALL@
  331.32 +-INSTALL_OPTS=@INSTALL_OPTS@
  331.33 ++INSTALL_OPTS=
  331.34 + 
  331.35 + CC=@CC@
  331.36 + 
  331.37 +@@ -130,6 +130,7 @@
  331.38 + 
  331.39 + install-3x:
  331.40 + 	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(BINDIR)
  331.41 ++	$(INSTALL) -m 775 $(INSTALL_OPTS) -d $(DESTDIR)$(LIBEXECDIR)
  331.42 + 	$(INSTALL) -m 755 $(INSTALL_OPTS) ndo2db-3x $(DESTDIR)$(BINDIR)/ndo2db
  331.43 +-	$(INSTALL) -m 755 $(INSTALL_OPTS) ndomod-3x.o $(DESTDIR)$(BINDIR)/ndomod.o
  331.44 ++	$(INSTALL) -m 755 $(INSTALL_OPTS) ndomod-3x.o $(DESTDIR)$(LIBEXECDIR)/ndomod.o
  331.45 + 
   332.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   332.2 +++ b/ndoutils/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   332.3 @@ -0,0 +1,1 @@
   332.4 +-p1|ndoutils-1.5.2-Makefiles.in.u
   333.1 --- a/notecase/receipt	Wed May 09 17:03:28 2018 +0300
   333.2 +++ b/notecase/receipt	Thu May 10 21:12:00 2018 +0300
   333.3 @@ -16,7 +16,6 @@
   333.4  
   333.5  compile_rules() {
   333.6  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lX11"
   333.7 -	busybox patch -p1 -i $stuff/notecase-1.9.8_gcc4.u || return 1
   333.8  
   333.9  	sed -i s/'install -D'/'install'/ Makefile
  333.10  	sed -i 's/^DEBSIZE:=.*/DEBSIZE:=0/' Makefile*
   334.1 --- a/notecase/stuff/notecase-1.9.8_gcc4.u	Wed May 09 17:03:28 2018 +0300
   334.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   334.3 @@ -1,20 +0,0 @@
   334.4 ---- notecase-1.9.8-ori/src/_unx/ExecuteFile.cpp	Fri Oct 24 18:54:50 2008
   334.5 -+++ notecase-1.9.8/src/_unx/ExecuteFile.cpp	Thu Sep 24 19:00:03 2009
   334.6 -@@ -15,6 +15,7 @@
   334.7 - #include <vector>
   334.8 - #include <algorithm>
   334.9 - #include <string.h>
  334.10 -+#include <cstdio>
  334.11 - 
  334.12 - #if defined(HAVE_GNOME_VFS)
  334.13 -  #include <libgnomevfs/gnome-vfs.h>
  334.14 ---- notecase-1.9.8-ori/src/lib/IniFile.cpp	Fri Oct 24 18:54:50 2008
  334.15 -+++ notecase-1.9.8/src/lib/IniFile.cpp	Thu Sep 24 18:50:13 2009
  334.16 -@@ -9,6 +9,7 @@
  334.17 - #include "IniFile.h"
  334.18 - #include <algorithm>    //find() function
  334.19 - #include <string>
  334.20 -+#include <cstdio>
  334.21 - #include "File64.h"
  334.22 - #include "FilePath.h"
  334.23 - #include "debug.h"
   335.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   335.2 +++ b/notecase/stuff/patches/notecase-1.9.8_gcc4.u	Thu May 10 21:12:00 2018 +0300
   335.3 @@ -0,0 +1,20 @@
   335.4 +--- notecase-1.9.8-ori/src/_unx/ExecuteFile.cpp	Fri Oct 24 18:54:50 2008
   335.5 ++++ notecase-1.9.8/src/_unx/ExecuteFile.cpp	Thu Sep 24 19:00:03 2009
   335.6 +@@ -15,6 +15,7 @@
   335.7 + #include <vector>
   335.8 + #include <algorithm>
   335.9 + #include <string.h>
  335.10 ++#include <cstdio>
  335.11 + 
  335.12 + #if defined(HAVE_GNOME_VFS)
  335.13 +  #include <libgnomevfs/gnome-vfs.h>
  335.14 +--- notecase-1.9.8-ori/src/lib/IniFile.cpp	Fri Oct 24 18:54:50 2008
  335.15 ++++ notecase-1.9.8/src/lib/IniFile.cpp	Thu Sep 24 18:50:13 2009
  335.16 +@@ -9,6 +9,7 @@
  335.17 + #include "IniFile.h"
  335.18 + #include <algorithm>    //find() function
  335.19 + #include <string>
  335.20 ++#include <cstdio>
  335.21 + #include "File64.h"
  335.22 + #include "FilePath.h"
  335.23 + #include "debug.h"
   336.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   336.2 +++ b/notecase/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   336.3 @@ -0,0 +1,1 @@
   336.4 +-p1|notecase-1.9.8_gcc4.u
   337.1 --- a/nvclock/receipt	Wed May 09 17:03:28 2018 +0300
   337.2 +++ b/nvclock/receipt	Thu May 10 21:12:00 2018 +0300
   337.3 @@ -17,7 +17,6 @@
   337.4  	[ -d $PACKAGE$VERSION ] && mv $PACKAGE$VERSION $PACKAGE-$VERSION
   337.5  	sed -i 's|prefix}/man|prefix}/share/man|' Makefile*
   337.6  	autoreconf
   337.7 -	patch -Np1 -i $stuff/$PACKAGE-$VERSION-install.patch
   337.8  
   337.9  	./configure \
  337.10  		--prefix=/usr \
   338.1 --- a/nvclock/stuff/nvclock-0.8b4-install.patch	Wed May 09 17:03:28 2018 +0300
   338.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   338.3 @@ -1,14 +0,0 @@
   338.4 -diff -upNr nvclock-0.8b4/src/Makefile.in.orig nvclock-0.8b4/src/Makefile.in
   338.5 ---- nvclock-0.8b4/src/Makefile.in.orig	Sat Jan  3 12:02:54 2009
   338.6 -+++ nvclock-0.8b4/src/Makefile.in	Thu May  6 08:40:39 2010
   338.7 -@@ -50,8 +50,8 @@
   338.8 - install: install-recursive install-app
   338.9 - install-app:
  338.10 - 	mkdir -p $(bindir)
  338.11 --	$(INSTALL) -c nvclock $(DESTDIR)$(bindir)/nvclock
  338.12 --	$(INSTALL) -c smartdimmer $(DESTDIR)$(bindir)/smartdimmer
  338.13 -+	$(INSTALL) -c nvclock $(bindir)/nvclock
  338.14 -+	$(INSTALL) -c smartdimmer $(bindir)/smartdimmer
  338.15 - 
  338.16 - 
  338.17 - uninstall: uninstall-recursive uninstall-app
   339.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   339.2 +++ b/nvclock/stuff/patches/nvclock-0.8b4-install.patch	Thu May 10 21:12:00 2018 +0300
   339.3 @@ -0,0 +1,14 @@
   339.4 +diff -upNr nvclock-0.8b4/src/Makefile.in.orig nvclock-0.8b4/src/Makefile.in
   339.5 +--- nvclock-0.8b4/src/Makefile.in.orig	Sat Jan  3 12:02:54 2009
   339.6 ++++ nvclock-0.8b4/src/Makefile.in	Thu May  6 08:40:39 2010
   339.7 +@@ -50,8 +50,8 @@
   339.8 + install: install-recursive install-app
   339.9 + install-app:
  339.10 + 	mkdir -p $(bindir)
  339.11 +-	$(INSTALL) -c nvclock $(DESTDIR)$(bindir)/nvclock
  339.12 +-	$(INSTALL) -c smartdimmer $(DESTDIR)$(bindir)/smartdimmer
  339.13 ++	$(INSTALL) -c nvclock $(bindir)/nvclock
  339.14 ++	$(INSTALL) -c smartdimmer $(bindir)/smartdimmer
  339.15 + 
  339.16 + 
  339.17 + uninstall: uninstall-recursive uninstall-app
   340.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   340.2 +++ b/nvclock/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   340.3 @@ -0,0 +1,1 @@
   340.4 +nvclock-0.8b4-install.patch
   341.1 --- a/ocsinventory-agent/receipt	Wed May 09 17:03:28 2018 +0300
   341.2 +++ b/ocsinventory-agent/receipt	Thu May 10 21:12:00 2018 +0300
   341.3 @@ -23,12 +23,6 @@
   341.4  
   341.5  	# don't run postinstall script
   341.6  	rm -f run-postinst
   341.7 -	for p in $stuff/ocsinventory-agent-1.1.2.1.u
   341.8 -	do
   341.9 -		[ -f done.$(basename $p) ] && continue
  341.10 -		patch -p1 -i $p || return 1
  341.11 -		touch done.$(basename $p)
  341.12 -	done
  341.13  	perl Makefile.PL
  341.14  	rm -f run-postinst
  341.15  	make && make DESTDIR=$DESTDIR install
   342.1 --- a/ocsinventory-agent/stuff/Drives.pm.u	Wed May 09 17:03:28 2018 +0300
   342.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   342.3 @@ -1,47 +0,0 @@
   342.4 ---- Ocsinventory-Agent-1.0.1.ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm	Fri Mar  6 19:02:57 2009
   342.5 -+++ Ocsinventory-Agent-1.0.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm	Sun Jul 12 22:29:32 2009
   342.6 -@@ -1,9 +1,11 @@
   342.7 - package Ocsinventory::Agent::Backend::OS::Linux::Drives;
   342.8 -+# Modified bye Erjo <erjo@slitaz.org>
   342.9 -+# Busybox df applet as no -T -P options.
  342.10 - 
  342.11 - use strict;
  342.12 - sub check {
  342.13 -   return unless can_run ("df");
  342.14 --  my $df = `df -TP`;
  342.15 -+  my $df = `df -k`;
  342.16 -   return 1 if $df =~ /\w+/;
  342.17 -   0
  342.18 - }
  342.19 -@@ -19,14 +21,14 @@
  342.20 -   my $volumn;
  342.21 - 
  342.22 - 
  342.23 --  foreach(`df -TP`) { # TODO retrive error
  342.24 --    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){
  342.25 -+  foreach(`df -k`) { # TODO retrive error
  342.26 -+    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){
  342.27 -       $free = sprintf("%i",($4/1024)); 
  342.28 --      $filesystem = $2;
  342.29 --      $total = sprintf("%i",($3/1024));
  342.30 --      $type = $1;
  342.31 --      $volumn = $5;
  342.32 --
  342.33 -+      $filesystem = $1;
  342.34 -+      $total = sprintf("%i",($2/1024));
  342.35 -+      $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;;
  342.36 -+      $volumn = $6;
  342.37 -+	  
  342.38 - # no virtual FS
  342.39 -       next if ($type =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/);
  342.40 -       next if ($filesystem =~ /^(tmpfs)$/);
  342.41 -@@ -36,8 +38,7 @@
  342.42 - 	  FILESYSTEM => $filesystem,
  342.43 - 	  TOTAL => $total,
  342.44 - 	  TYPE => $type,
  342.45 --	  VOLUMN =>
  342.46 --	  $volumn
  342.47 -+	  VOLUMN => $volumn
  342.48 - 	})
  342.49 -     }
  342.50 -   }
   343.1 --- a/ocsinventory-agent/stuff/manifest.u	Wed May 09 17:03:28 2018 +0300
   343.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   343.3 @@ -1,10 +0,0 @@
   343.4 ---- Ocsinventory-Agent-1.0.1.ori/MANIFEST	Sun Mar 22 20:19:28 2009
   343.5 -+++ Ocsinventory-Agent-1.0.1/MANIFEST	Sun Jul 12 22:31:59 2009
   343.6 -@@ -71,6 +71,7 @@
   343.7 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging.pm
   343.8 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm
   343.9 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm
  343.10 -+lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm
  343.11 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm
  343.12 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm
  343.13 - lib/Ocsinventory/Agent/Backend/OS/Generic/Screen.pm
   344.1 --- a/ocsinventory-agent/stuff/ocsinventory-agent-1.1.2.1.u	Wed May 09 17:03:28 2018 +0300
   344.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   344.3 @@ -1,49 +0,0 @@
   344.4 ---- Ocsinventory-Agent-1.1.2.1-ori/MANIFEST
   344.5 -+++ Ocsinventory-Agent-1.1.2.1/MANIFEST
   344.6 -@@ -75,6 +75,7 @@
   344.7 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm
   344.8 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/ByHand.pm
   344.9 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm
  344.10 -+lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm
  344.11 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm
  344.12 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Pacman.pm
  344.13 - lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm
  344.14 ---- Ocsinventory-Agent-1.1.2.1-ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm
  344.15 -+++ Ocsinventory-Agent-1.1.2.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm
  344.16 -@@ -3,7 +3,7 @@
  344.17 - use strict;
  344.18 - sub check {
  344.19 -   return unless can_run ("df");
  344.20 --  my $df = `df -TP`;
  344.21 -+  my $df = `df -k`;
  344.22 -   return 1 if $df =~ /\w+/;
  344.23 -   0
  344.24 - }
  344.25 -@@ -58,7 +58,7 @@
  344.26 -     }
  344.27 -   }
  344.28 -   
  344.29 --  foreach(`df -TP`) { # TODO retrive error
  344.30 -+  foreach(`df -k`) { # TODO retrive error
  344.31 -     my $createdate;
  344.32 -     my $free;
  344.33 -     my $filesystem;
  344.34 -@@ -68,12 +68,12 @@
  344.35 -     my $volumn;
  344.36 -     my $serial;
  344.37 - 
  344.38 --    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){
  344.39 --      $free = sprintf("%i",($4/1024));
  344.40 --      $filesystem = $2;
  344.41 --      $total = sprintf("%i",($3/1024));
  344.42 --      $type = $5;
  344.43 --      $volumn = $1;
  344.44 -+    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){
  344.45 -+		$free = sprintf("%i",($4/1024));
  344.46 -+		$filesystem = $1;
  344.47 -+		$total = sprintf("%i",($2/1024));
  344.48 -+      	$type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;;
  344.49 -+      	$volumn = $6;
  344.50 - 
  344.51 - # no virtual FS
  344.52 -       next if ($filesystem =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/);
   345.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   345.2 +++ b/ocsinventory-agent/stuff/patches/Drives.pm.u	Thu May 10 21:12:00 2018 +0300
   345.3 @@ -0,0 +1,47 @@
   345.4 +--- Ocsinventory-Agent-1.0.1.ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm	Fri Mar  6 19:02:57 2009
   345.5 ++++ Ocsinventory-Agent-1.0.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm	Sun Jul 12 22:29:32 2009
   345.6 +@@ -1,9 +1,11 @@
   345.7 + package Ocsinventory::Agent::Backend::OS::Linux::Drives;
   345.8 ++# Modified bye Erjo <erjo@slitaz.org>
   345.9 ++# Busybox df applet as no -T -P options.
  345.10 + 
  345.11 + use strict;
  345.12 + sub check {
  345.13 +   return unless can_run ("df");
  345.14 +-  my $df = `df -TP`;
  345.15 ++  my $df = `df -k`;
  345.16 +   return 1 if $df =~ /\w+/;
  345.17 +   0
  345.18 + }
  345.19 +@@ -19,14 +21,14 @@
  345.20 +   my $volumn;
  345.21 + 
  345.22 + 
  345.23 +-  foreach(`df -TP`) { # TODO retrive error
  345.24 +-    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){
  345.25 ++  foreach(`df -k`) { # TODO retrive error
  345.26 ++    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){
  345.27 +       $free = sprintf("%i",($4/1024)); 
  345.28 +-      $filesystem = $2;
  345.29 +-      $total = sprintf("%i",($3/1024));
  345.30 +-      $type = $1;
  345.31 +-      $volumn = $5;
  345.32 +-
  345.33 ++      $filesystem = $1;
  345.34 ++      $total = sprintf("%i",($2/1024));
  345.35 ++      $type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;;
  345.36 ++      $volumn = $6;
  345.37 ++	  
  345.38 + # no virtual FS
  345.39 +       next if ($type =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/);
  345.40 +       next if ($filesystem =~ /^(tmpfs)$/);
  345.41 +@@ -36,8 +38,7 @@
  345.42 + 	  FILESYSTEM => $filesystem,
  345.43 + 	  TOTAL => $total,
  345.44 + 	  TYPE => $type,
  345.45 +-	  VOLUMN =>
  345.46 +-	  $volumn
  345.47 ++	  VOLUMN => $volumn
  345.48 + 	})
  345.49 +     }
  345.50 +   }
   346.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   346.2 +++ b/ocsinventory-agent/stuff/patches/manifest.u	Thu May 10 21:12:00 2018 +0300
   346.3 @@ -0,0 +1,10 @@
   346.4 +--- Ocsinventory-Agent-1.0.1.ori/MANIFEST	Sun Mar 22 20:19:28 2009
   346.5 ++++ Ocsinventory-Agent-1.0.1/MANIFEST	Sun Jul 12 22:31:59 2009
   346.6 +@@ -71,6 +71,7 @@
   346.7 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging.pm
   346.8 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm
   346.9 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm
  346.10 ++lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm
  346.11 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm
  346.12 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm
  346.13 + lib/Ocsinventory/Agent/Backend/OS/Generic/Screen.pm
   347.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   347.2 +++ b/ocsinventory-agent/stuff/patches/ocsinventory-agent-1.1.2.1.u	Thu May 10 21:12:00 2018 +0300
   347.3 @@ -0,0 +1,49 @@
   347.4 +--- Ocsinventory-Agent-1.1.2.1-ori/MANIFEST
   347.5 ++++ Ocsinventory-Agent-1.1.2.1/MANIFEST
   347.6 +@@ -75,6 +75,7 @@
   347.7 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/BSDpkg.pm
   347.8 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/ByHand.pm
   347.9 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Deb.pm
  347.10 ++lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Tazpkg.pm
  347.11 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Gentoo.pm
  347.12 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/Pacman.pm
  347.13 + lib/Ocsinventory/Agent/Backend/OS/Generic/Packaging/RPM.pm
  347.14 +--- Ocsinventory-Agent-1.1.2.1-ori/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm
  347.15 ++++ Ocsinventory-Agent-1.1.2.1/lib/Ocsinventory/Agent/Backend/OS/Linux/Drives.pm
  347.16 +@@ -3,7 +3,7 @@
  347.17 + use strict;
  347.18 + sub check {
  347.19 +   return unless can_run ("df");
  347.20 +-  my $df = `df -TP`;
  347.21 ++  my $df = `df -k`;
  347.22 +   return 1 if $df =~ /\w+/;
  347.23 +   0
  347.24 + }
  347.25 +@@ -58,7 +58,7 @@
  347.26 +     }
  347.27 +   }
  347.28 +   
  347.29 +-  foreach(`df -TP`) { # TODO retrive error
  347.30 ++  foreach(`df -k`) { # TODO retrive error
  347.31 +     my $createdate;
  347.32 +     my $free;
  347.33 +     my $filesystem;
  347.34 +@@ -68,12 +68,12 @@
  347.35 +     my $volumn;
  347.36 +     my $serial;
  347.37 + 
  347.38 +-    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\s+(?:\S+)\s+(\S+)\n/){
  347.39 +-      $free = sprintf("%i",($4/1024));
  347.40 +-      $filesystem = $2;
  347.41 +-      $total = sprintf("%i",($3/1024));
  347.42 +-      $type = $5;
  347.43 +-      $volumn = $1;
  347.44 ++    if(/^(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\s+(\S+)\n/){
  347.45 ++		$free = sprintf("%i",($4/1024));
  347.46 ++		$filesystem = $1;
  347.47 ++		$total = sprintf("%i",($2/1024));
  347.48 ++      	$type = `grep ^$1 /etc/mtab | cut -d " " -f 3`;;
  347.49 ++      	$volumn = $6;
  347.50 + 
  347.51 + # no virtual FS
  347.52 +       next if ($filesystem =~ /^(tmpfs|usbfs|proc|devpts|devshm|udev)$/);
   348.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   348.2 +++ b/ocsinventory-agent/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   348.3 @@ -0,0 +1,1 @@
   348.4 +-p1|ocsinventory-agent-1.1.2.1.u
   349.1 --- a/opencpn/receipt	Wed May 09 17:03:28 2018 +0300
   349.2 +++ b/opencpn/receipt	Thu May 10 21:12:00 2018 +0300
   349.3 @@ -17,8 +17,6 @@
   349.4  	# Binutils 2.22 break many packages build without LDFLAGS set correctly.
   349.5  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
   349.6  
   349.7 -	busybox patch -p0 -i $stuff/glib.u
   349.8 -
   349.9  	./configure $CONFIGURE_ARGS &&
  349.10  	fix libtool &&
  349.11  	make &&
   350.1 --- a/opencpn/stuff/glib.u	Wed May 09 17:03:28 2018 +0300
   350.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   350.3 @@ -1,14 +0,0 @@
   350.4 -Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883
   350.5 -
   350.6 ---- include/dychart.h
   350.7 -+++ include/dychart.h
   350.8 -@@ -211,7 +211,9 @@
   350.9 - 
  350.10 - #ifdef __WXGTK__
  350.11 - #ifdef ocpnUSE_GTK_OPTIMIZE
  350.12 -+#define GSocket GlibGSocket
  350.13 -     #include <gtk/gtk.h>
  350.14 -+#undef GSocket
  350.15 - #endif
  350.16 - #endif
  350.17 - 
   351.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   351.2 +++ b/opencpn/stuff/patches/glib.u	Thu May 10 21:12:00 2018 +0300
   351.3 @@ -0,0 +1,14 @@
   351.4 +Both glib and wx define GSocket, see http://trac.wxwidgets.org/ticket/10883
   351.5 +
   351.6 +--- include/dychart.h
   351.7 ++++ include/dychart.h
   351.8 +@@ -211,7 +211,9 @@
   351.9 + 
  351.10 + #ifdef __WXGTK__
  351.11 + #ifdef ocpnUSE_GTK_OPTIMIZE
  351.12 ++#define GSocket GlibGSocket
  351.13 +     #include <gtk/gtk.h>
  351.14 ++#undef GSocket
  351.15 + #endif
  351.16 + #endif
  351.17 + 
   352.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   352.2 +++ b/opencpn/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   352.3 @@ -0,0 +1,1 @@
   352.4 +-p0|glib.u
   353.1 --- a/openspades/receipt	Wed May 09 17:03:28 2018 +0300
   353.2 +++ b/openspades/receipt	Thu May 10 21:12:00 2018 +0300
   353.3 @@ -19,7 +19,6 @@
   353.4  # Rules to configure and make the package.
   353.5  compile_rules()
   353.6  {
   353.7 -	patch -p1 -i $stuff/$PACKAGE-$VERSION.patch
   353.8  	export CXX=/usr/bin/i486-slitaz-linux-g++-49
   353.9  
  353.10  	mkdir build; cd build
   354.1 --- a/openspades/stuff/openspades-0.0.12.patch	Wed May 09 17:03:28 2018 +0300
   354.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   354.3 @@ -1,32 +0,0 @@
   354.4 ---- a/Sources/Client/Client_Input.cpp
   354.5 -+++ b/Sources/Client/Client_Input.cpp
   354.6 -@@ -38,6 +38,7 @@
   354.7 - 
   354.8 - #include "NetClient.h"
   354.9 - 
  354.10 -+using namespace std;
  354.11 - 
  354.12 - SPADES_SETTING(cg_mouseSensitivity, "1");
  354.13 - SPADES_SETTING(cg_zoomedMouseSensScale, "0.6");
  354.14 ---- a/Sources/Client/Corpse.cpp
  354.15 -+++ b/Sources/Client/Corpse.cpp
  354.16 -@@ -27,6 +27,8 @@
  354.17 - #include "../Core/Debug.h"
  354.18 - #include "../Core/Settings.h"
  354.19 - 
  354.20 -+using namespace std;
  354.21 -+
  354.22 - SPADES_SETTING(r_corpseLineCollision, "1");
  354.23 - 
  354.24 - namespace spades {
  354.25 ---- a/Sources/Draw/SWMapRenderer.cpp
  354.26 -+++ b/Sources/Draw/SWMapRenderer.cpp
  354.27 -@@ -31,6 +31,8 @@
  354.28 - #include "SWUtils.h"
  354.29 - #include <cstdint>
  354.30 - 
  354.31 -+using namespace std;
  354.32 -+
  354.33 - SPADES_SETTING(r_swUndersampling, "0");
  354.34 - 
  354.35 - namespace spades {
   355.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   355.2 +++ b/openspades/stuff/patches/openspades-0.0.12.patch	Thu May 10 21:12:00 2018 +0300
   355.3 @@ -0,0 +1,32 @@
   355.4 +--- a/Sources/Client/Client_Input.cpp
   355.5 ++++ b/Sources/Client/Client_Input.cpp
   355.6 +@@ -38,6 +38,7 @@
   355.7 + 
   355.8 + #include "NetClient.h"
   355.9 + 
  355.10 ++using namespace std;
  355.11 + 
  355.12 + SPADES_SETTING(cg_mouseSensitivity, "1");
  355.13 + SPADES_SETTING(cg_zoomedMouseSensScale, "0.6");
  355.14 +--- a/Sources/Client/Corpse.cpp
  355.15 ++++ b/Sources/Client/Corpse.cpp
  355.16 +@@ -27,6 +27,8 @@
  355.17 + #include "../Core/Debug.h"
  355.18 + #include "../Core/Settings.h"
  355.19 + 
  355.20 ++using namespace std;
  355.21 ++
  355.22 + SPADES_SETTING(r_corpseLineCollision, "1");
  355.23 + 
  355.24 + namespace spades {
  355.25 +--- a/Sources/Draw/SWMapRenderer.cpp
  355.26 ++++ b/Sources/Draw/SWMapRenderer.cpp
  355.27 +@@ -31,6 +31,8 @@
  355.28 + #include "SWUtils.h"
  355.29 + #include <cstdint>
  355.30 + 
  355.31 ++using namespace std;
  355.32 ++
  355.33 + SPADES_SETTING(r_swUndersampling, "0");
  355.34 + 
  355.35 + namespace spades {
   356.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   356.2 +++ b/openspades/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   356.3 @@ -0,0 +1,1 @@
   356.4 +-p1|openspades-0.0.12.patch
   357.1 --- a/ovz-web-panel/receipt	Wed May 09 17:03:28 2018 +0300
   357.2 +++ b/ovz-web-panel/receipt	Thu May 10 21:12:00 2018 +0300
   357.3 @@ -15,18 +15,6 @@
   357.4  # Rules to configure and make the package.
   357.5  compile_rules()
   357.6  {
   357.7 -	# Apply patches
   357.8 -	while read patch_file; do
   357.9 -		if [ -f done.$patch_file ]; then
  357.10 -			echo "Skipping $patch_file"
  357.11 -			continue
  357.12 -		fi
  357.13 -		echo "Apply $patch_file"
  357.14 -		patch -p1 < $stuff/$patch_file || return 1
  357.15 -		touch done.$patch_file
  357.16 -	done <<EOT
  357.17 -owp-${VERSION}.u
  357.18 -EOT
  357.19  	mkdir $DESTDIR
  357.20  	mv * $DESTDIR 2> /dev/null || true
  357.21  }
   358.1 --- a/ovz-web-panel/stuff/hardware_server.rb.u	Wed May 09 17:03:28 2018 +0300
   358.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   358.3 @@ -1,11 +0,0 @@
   358.4 ---- ovz-web-panel-ori/app/models/hardware_server.rb	Fri Nov 19 18:54:08 2010
   358.5 -+++ ovz-web-panel/app/models/hardware_server.rb	Fri Dec 31 23:59:40 2010
   358.6 -@@ -174,7 +174,7 @@
   358.7 -   end
   358.8 -   
   358.9 -   def sync_backups
  358.10 --    backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
  358.11 -+    backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output']
  358.12 -     backups_list = backups_list.split("\n")
  358.13 -     # remove totals line
  358.14 -     backups_list.shift
   359.1 --- a/ovz-web-panel/stuff/owp-1.7.u	Wed May 09 17:03:28 2018 +0300
   359.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   359.3 @@ -1,22 +0,0 @@
   359.4 ---- ovz-web-panel-ori/app/models/hardware_server.rb	Fri Nov 19 18:54:08 2010
   359.5 -+++ ovz-web-panel/app/models/hardware_server.rb	Fri Dec 31 23:59:40 2010
   359.6 -@@ -174,7 +174,7 @@
   359.7 -   end
   359.8 -   
   359.9 -   def sync_backups
  359.10 --    backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
  359.11 -+    backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output']
  359.12 -     backups_list = backups_list.split("\n")
  359.13 -     # remove totals line
  359.14 -     backups_list.shift
  359.15 ---- ovz-web-panel-ori/script/owp	Mon Oct 25 19:09:40 2010
  359.16 -+++ ovz-web-panel/script/owp	Sat Jan  1 01:08:42 2011
  359.17 -@@ -61,7 +61,7 @@
  359.18 - 
  359.19 - stop() {
  359.20 -   echo "Stopping OpenVZ Web Panel server"
  359.21 --  PANEL_APP_PID=`ps auxww | grep ruby | grep script/server | awk '{ print $2 }'`
  359.22 -+  PANEL_APP_PID=`ps  | grep ruby | grep script/server | awk '{ print $1 }'`
  359.23 -   [ -n "$PANEL_APP_PID" ] && kill -2 $PANEL_APP_PID
  359.24 -   [ "$ENVIRONMENT" = "HW-NODE" ] && ruby $INSTALL_DIR/utils/hw-daemon/hw-daemon.rb stop
  359.25 -   ruby $INSTALL_DIR/utils/watchdog/watchdog.rb stop
   360.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   360.2 +++ b/ovz-web-panel/stuff/patches/hardware_server.rb.u	Thu May 10 21:12:00 2018 +0300
   360.3 @@ -0,0 +1,11 @@
   360.4 +--- ovz-web-panel-ori/app/models/hardware_server.rb	Fri Nov 19 18:54:08 2010
   360.5 ++++ ovz-web-panel/app/models/hardware_server.rb	Fri Dec 31 23:59:40 2010
   360.6 +@@ -174,7 +174,7 @@
   360.7 +   end
   360.8 +   
   360.9 +   def sync_backups
  360.10 +-    backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
  360.11 ++    backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output']
  360.12 +     backups_list = backups_list.split("\n")
  360.13 +     # remove totals line
  360.14 +     backups_list.shift
   361.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   361.2 +++ b/ovz-web-panel/stuff/patches/owp-1.7.u	Thu May 10 21:12:00 2018 +0300
   361.3 @@ -0,0 +1,22 @@
   361.4 +--- ovz-web-panel-ori/app/models/hardware_server.rb	Fri Nov 19 18:54:08 2010
   361.5 ++++ ovz-web-panel/app/models/hardware_server.rb	Fri Dec 31 23:59:40 2010
   361.6 +@@ -174,7 +174,7 @@
   361.7 +   end
   361.8 +   
   361.9 +   def sync_backups
  361.10 +-    backups_list = rpc_client.exec('ls', "--block-size=M -s #{backups_dir}")['output']
  361.11 ++    backups_list = rpc_client.exec('ls', "-h -s #{backups_dir}")['output']
  361.12 +     backups_list = backups_list.split("\n")
  361.13 +     # remove totals line
  361.14 +     backups_list.shift
  361.15 +--- ovz-web-panel-ori/script/owp	Mon Oct 25 19:09:40 2010
  361.16 ++++ ovz-web-panel/script/owp	Sat Jan  1 01:08:42 2011
  361.17 +@@ -61,7 +61,7 @@
  361.18 + 
  361.19 + stop() {
  361.20 +   echo "Stopping OpenVZ Web Panel server"
  361.21 +-  PANEL_APP_PID=`ps auxww | grep ruby | grep script/server | awk '{ print $2 }'`
  361.22 ++  PANEL_APP_PID=`ps  | grep ruby | grep script/server | awk '{ print $1 }'`
  361.23 +   [ -n "$PANEL_APP_PID" ] && kill -2 $PANEL_APP_PID
  361.24 +   [ "$ENVIRONMENT" = "HW-NODE" ] && ruby $INSTALL_DIR/utils/hw-daemon/hw-daemon.rb stop
  361.25 +   ruby $INSTALL_DIR/utils/watchdog/watchdog.rb stop
   362.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   362.2 +++ b/ovz-web-panel/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   362.3 @@ -0,0 +1,1 @@
   362.4 +-p1|owp-1.7.u
   363.1 --- a/par2/receipt	Wed May 09 17:03:28 2018 +0300
   363.2 +++ b/par2/receipt	Thu May 10 21:12:00 2018 +0300
   363.3 @@ -16,9 +16,6 @@
   363.4  # Rules to configure and make the package.
   363.5  compile_rules()
   363.6  {
   363.7 -	cd $src
   363.8 -	#http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch
   363.9 -	patch -p1 < $stuff/par2cmdline-0.4-gcc4.patch || true
  363.10  	./configure --prefix=/usr --infodir=/usr/share/info \
  363.11  	--mandir=/usr/share/man \
  363.12  	$CONFIGURE_ARGS &&
   364.1 --- a/par2/stuff/par2cmdline-0.4-gcc4.patch	Wed May 09 17:03:28 2018 +0300
   364.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   364.3 @@ -1,62 +0,0 @@
   364.4 -Fix compilation with gcc-4.
   364.5 -
   364.6 -Patch by Dirk-Jan Heijs.
   364.7 -
   364.8 -http://bugs.gentoo.org/102391
   364.9 -http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287904
  364.10 -
  364.11 ---- par2cmdline-0.4/reedsolomon.cpp
  364.12 -+++ par2cmdline-0.4/reedsolomon.cpp
  364.13 -@@ -51,7 +51,7 @@
  364.14 -   }
  364.15 - }
  364.16 - 
  364.17 --bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
  364.18 -+template <> bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
  364.19 - {
  364.20 -   inputcount = (u32)present.size();
  364.21 - 
  364.22 -@@ -80,7 +80,7 @@
  364.23 -   return true;
  364.24 - }
  364.25 - 
  364.26 --bool ReedSolomon<Galois8>::SetInput(u32 count)
  364.27 -+template <> bool ReedSolomon<Galois8>::SetInput(u32 count)
  364.28 - {
  364.29 -   inputcount = count;
  364.30 - 
  364.31 -@@ -101,7 +101,7 @@
  364.32 -   return true;
  364.33 - }
  364.34 - 
  364.35 --bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  364.36 -+template <> bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  364.37 - {
  364.38 -   // Look up the appropriate element in the RS matrix
  364.39 -   Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex];
  364.40 -@@ -189,7 +189,7 @@
  364.41 - 
  364.42 - // Set which of the source files are present and which are missing
  364.43 - // and compute the base values to use for the vandermonde matrix.
  364.44 --bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
  364.45 -+template <> bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
  364.46 - {
  364.47 -   inputcount = (u32)present.size();
  364.48 - 
  364.49 -@@ -233,7 +233,7 @@
  364.50 - 
  364.51 - // Record that the specified number of source files are all present
  364.52 - // and compute the base values to use for the vandermonde matrix.
  364.53 --bool ReedSolomon<Galois16>::SetInput(u32 count)
  364.54 -+template <> bool ReedSolomon<Galois16>::SetInput(u32 count)
  364.55 - {
  364.56 -   inputcount = count;
  364.57 - 
  364.58 -@@ -267,7 +267,7 @@
  364.59 -   return true;
  364.60 - }
  364.61 - 
  364.62 --bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  364.63 -+template <> bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  364.64 - {
  364.65 -   // Look up the appropriate element in the RS matrix
   365.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   365.2 +++ b/par2/stuff/patches/par2cmdline-0.4-gcc4.patch	Thu May 10 21:12:00 2018 +0300
   365.3 @@ -0,0 +1,62 @@
   365.4 +Fix compilation with gcc-4.
   365.5 +
   365.6 +Patch by Dirk-Jan Heijs.
   365.7 +
   365.8 +http://bugs.gentoo.org/102391
   365.9 +http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=287904
  365.10 +
  365.11 +--- par2cmdline-0.4/reedsolomon.cpp
  365.12 ++++ par2cmdline-0.4/reedsolomon.cpp
  365.13 +@@ -51,7 +51,7 @@
  365.14 +   }
  365.15 + }
  365.16 + 
  365.17 +-bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
  365.18 ++template <> bool ReedSolomon<Galois8>::SetInput(const vector<bool> &present)
  365.19 + {
  365.20 +   inputcount = (u32)present.size();
  365.21 + 
  365.22 +@@ -80,7 +80,7 @@
  365.23 +   return true;
  365.24 + }
  365.25 + 
  365.26 +-bool ReedSolomon<Galois8>::SetInput(u32 count)
  365.27 ++template <> bool ReedSolomon<Galois8>::SetInput(u32 count)
  365.28 + {
  365.29 +   inputcount = count;
  365.30 + 
  365.31 +@@ -101,7 +101,7 @@
  365.32 +   return true;
  365.33 + }
  365.34 + 
  365.35 +-bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  365.36 ++template <> bool ReedSolomon<Galois8>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  365.37 + {
  365.38 +   // Look up the appropriate element in the RS matrix
  365.39 +   Galois8 factor = leftmatrix[outputindex * (datapresent + datamissing) + inputindex];
  365.40 +@@ -189,7 +189,7 @@
  365.41 + 
  365.42 + // Set which of the source files are present and which are missing
  365.43 + // and compute the base values to use for the vandermonde matrix.
  365.44 +-bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
  365.45 ++template <> bool ReedSolomon<Galois16>::SetInput(const vector<bool> &present)
  365.46 + {
  365.47 +   inputcount = (u32)present.size();
  365.48 + 
  365.49 +@@ -233,7 +233,7 @@
  365.50 + 
  365.51 + // Record that the specified number of source files are all present
  365.52 + // and compute the base values to use for the vandermonde matrix.
  365.53 +-bool ReedSolomon<Galois16>::SetInput(u32 count)
  365.54 ++template <> bool ReedSolomon<Galois16>::SetInput(u32 count)
  365.55 + {
  365.56 +   inputcount = count;
  365.57 + 
  365.58 +@@ -267,7 +267,7 @@
  365.59 +   return true;
  365.60 + }
  365.61 + 
  365.62 +-bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  365.63 ++template <> bool ReedSolomon<Galois16>::Process(size_t size, u32 inputindex, const void *inputbuffer, u32 outputindex, void *outputbuffer)
  365.64 + {
  365.65 +   // Look up the appropriate element in the RS matrix
   366.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   366.2 +++ b/par2/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   366.3 @@ -0,0 +1,2 @@
   366.4 +#http://sources.gentoo.org/viewcvs.py/gentoo-x86/app-arch/par2cmdline/files/par2cmdline-0.4-gcc4.patch
   366.5 +-p1|par2cmdline-0.4-gcc4.patch
   367.1 --- a/pcmanfm-legacy/receipt	Wed May 09 17:03:28 2018 +0300
   367.2 +++ b/pcmanfm-legacy/receipt	Thu May 10 21:12:00 2018 +0300
   367.3 @@ -20,11 +20,6 @@
   367.4  	# Binutils 2.22 break many packages build without LDFLAGS set correctly.
   367.5  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lXt"
   367.6  
   367.7 -	for i in  $stuff/*.patch; do
   367.8 -		[ -f done.$(basename $i) ] && continue
   367.9 -		patch -p0 < $i && touch done.$(basename $i) || return 1
  367.10 -	done
  367.11 -
  367.12  	cp $stuff/fr.po $src/po
  367.13  
  367.14  	./configure \
   368.1 --- a/pcmanfm-legacy/stuff/archiver-tazpkg-support.patch	Wed May 09 17:03:28 2018 +0300
   368.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   368.3 @@ -1,24 +0,0 @@
   368.4 ---- src/ptk/ptk-file-archiver.c	Sun May 25 14:59:12 2008
   368.5 -+++ src/ptk/ptk-file-archiver.c	Thu Jun 25 23:28:10 2009
   368.6 -@@ -10,6 +10,8 @@
   368.7 - *
   368.8 - */
   368.9 -
  368.10 -+/* 06-25-2009 Erjo: Add support for tazpkg */
  368.11 -+
  368.12 - #include <glib/gi18n.h>
  368.13 - #include <string.h>
  368.14 -
  368.15 -@@ -61,6 +63,12 @@
  368.16 -             "tar -xvf",
  368.17 -             ".tar", TRUE
  368.18 -         },
  368.19 -+		{
  368.20 -+            "application/x-tazpkg",
  368.21 -+            "tazpkg pack",
  368.22 -+            "tazpkg extract",
  368.23 -+            ".tazpkg", FALSE
  368.24 -+        }
  368.25 -         /*
  368.26 -         {
  368.27 -             "application/x-rar",
   369.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   369.2 +++ b/pcmanfm-legacy/stuff/patches/archiver-tazpkg-support.patch	Thu May 10 21:12:00 2018 +0300
   369.3 @@ -0,0 +1,24 @@
   369.4 +--- src/ptk/ptk-file-archiver.c	Sun May 25 14:59:12 2008
   369.5 ++++ src/ptk/ptk-file-archiver.c	Thu Jun 25 23:28:10 2009
   369.6 +@@ -10,6 +10,8 @@
   369.7 + *
   369.8 + */
   369.9 +
  369.10 ++/* 06-25-2009 Erjo: Add support for tazpkg */
  369.11 ++
  369.12 + #include <glib/gi18n.h>
  369.13 + #include <string.h>
  369.14 +
  369.15 +@@ -61,6 +63,12 @@
  369.16 +             "tar -xvf",
  369.17 +             ".tar", TRUE
  369.18 +         },
  369.19 ++		{
  369.20 ++            "application/x-tazpkg",
  369.21 ++            "tazpkg pack",
  369.22 ++            "tazpkg extract",
  369.23 ++            ".tazpkg", FALSE
  369.24 ++        }
  369.25 +         /*
  369.26 +         {
  369.27 +             "application/x-rar",
   370.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   370.2 +++ b/pcmanfm-legacy/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   370.3 @@ -0,0 +1,2 @@
   370.4 +-p0|archiver-tazpkg-support.patch
   370.5 +-p0|view.as.detailed.list.click.bug.patch
   371.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   371.2 +++ b/pcmanfm-legacy/stuff/patches/view.as.detailed.list.click.bug.patch	Thu May 10 21:12:00 2018 +0300
   371.3 @@ -0,0 +1,25 @@
   371.4 +--- src/exo/exo-tree-view.c.ORIG
   371.5 ++++ src/exo/exo-tree-view.c
   371.6 +@@ -364,20 +364,11 @@
   371.7 +       tree_view->priv->button_release_activates = (tree_view->priv->single_click && event->type == GDK_BUTTON_PRESS && event->button == 1
   371.8 +                                                    && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0);
   371.9 +     }
  371.10 +-
  371.11 +-  /* unfortunately GtkTreeView will unselect rows except the clicked one,
  371.12 +-   * which makes dragging from a GtkTreeView problematic. That's why we
  371.13 +-   * remember the selected paths here and restore them later.
  371.14 +-   */
  371.15 ++ 
  371.16 +   if (event->type == GDK_BUTTON_PRESS && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0
  371.17 +       && path != NULL && gtk_tree_selection_path_is_selected (selection, path))
  371.18 +     {
  371.19 +-      /* if no custom select function is set, we simply use exo_noop_false here,
  371.20 +-       * to tell the tree view that it may not alter the selection.
  371.21 +-       */
  371.22 +-      if (G_LIKELY (selection->user_func == NULL))
  371.23 +-        gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) exo_noop_false, NULL, NULL);
  371.24 +-      else
  371.25 ++
  371.26 +         selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
  371.27 +     }
  371.28 + 
   372.1 --- a/pcmanfm-legacy/stuff/view.as.detailed.list.click.bug.patch	Wed May 09 17:03:28 2018 +0300
   372.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   372.3 @@ -1,25 +0,0 @@
   372.4 ---- src/exo/exo-tree-view.c.ORIG
   372.5 -+++ src/exo/exo-tree-view.c
   372.6 -@@ -364,20 +364,11 @@
   372.7 -       tree_view->priv->button_release_activates = (tree_view->priv->single_click && event->type == GDK_BUTTON_PRESS && event->button == 1
   372.8 -                                                    && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0);
   372.9 -     }
  372.10 --
  372.11 --  /* unfortunately GtkTreeView will unselect rows except the clicked one,
  372.12 --   * which makes dragging from a GtkTreeView problematic. That's why we
  372.13 --   * remember the selected paths here and restore them later.
  372.14 --   */
  372.15 -+ 
  372.16 -   if (event->type == GDK_BUTTON_PRESS && (event->state & gtk_accelerator_get_default_mod_mask ()) == 0
  372.17 -       && path != NULL && gtk_tree_selection_path_is_selected (selection, path))
  372.18 -     {
  372.19 --      /* if no custom select function is set, we simply use exo_noop_false here,
  372.20 --       * to tell the tree view that it may not alter the selection.
  372.21 --       */
  372.22 --      if (G_LIKELY (selection->user_func == NULL))
  372.23 --        gtk_tree_selection_set_select_function (selection, (GtkTreeSelectionFunc) exo_noop_false, NULL, NULL);
  372.24 --      else
  372.25 -+
  372.26 -         selected_paths = gtk_tree_selection_get_selected_rows (selection, NULL);
  372.27 -     }
  372.28 - 
   373.1 --- a/php-auth-pam/receipt	Wed May 09 17:03:28 2018 +0300
   373.2 +++ b/php-auth-pam/receipt	Thu May 10 21:12:00 2018 +0300
   373.3 @@ -20,7 +20,6 @@
   373.4  		|| make ${PACKAGE}-${VERSION}.orig ${PACKAGE}-${VERSION}
   373.5  	cd $src
   373.6  	phpize
   373.7 -	patch -p1 < $stuff/php-auth-pam-Makefile.global0.4.u || exit 1
   373.8  	sed -i 's/^function_entry/zend_&/;s/pval /zval /' pam_auth.c # php 5.4
   373.9  	
  373.10  	./configure $CONFIGURE_ARGS \
   374.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   374.2 +++ b/php-auth-pam/stuff/patches/php-auth-pam-Makefile.global0.4.u	Thu May 10 21:12:00 2018 +0300
   374.3 @@ -0,0 +1,53 @@
   374.4 +--- php-auth-pam-0.4-ori/Makefile.global	Sat May  8 09:06:20 2010
   374.5 ++++ php-auth-pam-0.4/Makefile.global	Sat May  8 09:07:58 2010
   374.6 +@@ -24,7 +24,7 @@
   374.7 + 
   374.8 + install-sapi: $(OVERALL_TARGET)
   374.9 + 	@echo "Installing PHP SAPI module:       $(PHP_SAPI)"
  374.10 +-	-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
  374.11 ++	-@$(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(bindir)
  374.12 + 	-@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
  374.13 + 		for i in 0.0.0 0.0 0; do \
  374.14 + 			if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
  374.15 +@@ -37,19 +37,19 @@
  374.16 + 
  374.17 + install-modules: build-modules
  374.18 + 	@test -d modules && \
  374.19 +-	$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
  374.20 +-	@echo "Installing shared extensions:     $(INSTALL_ROOT)$(EXTENSION_DIR)/"
  374.21 ++	$(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)
  374.22 ++	@echo "Installing shared extensions:     $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)/"
  374.23 + 	@rm -f modules/*.la >/dev/null 2>&1
  374.24 +-	@$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
  374.25 ++	@$(INSTALL) modules/* $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)
  374.26 + 
  374.27 + install-headers:
  374.28 + 	-@if test "$(INSTALL_HEADERS)"; then \
  374.29 + 		for i in `echo $(INSTALL_HEADERS)`; do \
  374.30 + 			i=`$(top_srcdir)/build/shtool path -d $$i`; \
  374.31 +-			paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
  374.32 ++			paths="$$paths $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i"; \
  374.33 + 		done; \
  374.34 + 		$(mkinstalldirs) $$paths && \
  374.35 +-		echo "Installing header files:          $(INSTALL_ROOT)$(phpincludedir)/" && \
  374.36 ++		echo "Installing header files:          $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/" && \
  374.37 + 		for i in `echo $(INSTALL_HEADERS)`; do \
  374.38 + 			if test "$(PHP_PECL_EXTENSION)"; then \
  374.39 + 				src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
  374.40 +@@ -57,12 +57,12 @@
  374.41 + 				src=$$i; \
  374.42 + 			fi; \
  374.43 + 			if test -f "$(top_srcdir)/$$src"; then \
  374.44 +-				$(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
  374.45 ++				$(INSTALL_DATA) $(top_srcdir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \
  374.46 + 			elif test -f "$(top_builddir)/$$src"; then \
  374.47 +-				$(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
  374.48 ++				$(INSTALL_DATA) $(top_builddir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \
  374.49 + 			else \
  374.50 +-				(cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \
  374.51 +-				cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
  374.52 ++				(cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \
  374.53 ++				cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
  374.54 + 			fi \
  374.55 + 		done; \
  374.56 + 	fi
   375.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   375.2 +++ b/php-auth-pam/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   375.3 @@ -0,0 +1,1 @@
   375.4 +-p1|php-auth-pam-Makefile.global0.4.u
   376.1 --- a/php-auth-pam/stuff/php-auth-pam-Makefile.global0.4.u	Wed May 09 17:03:28 2018 +0300
   376.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   376.3 @@ -1,53 +0,0 @@
   376.4 ---- php-auth-pam-0.4-ori/Makefile.global	Sat May  8 09:06:20 2010
   376.5 -+++ php-auth-pam-0.4/Makefile.global	Sat May  8 09:07:58 2010
   376.6 -@@ -24,7 +24,7 @@
   376.7 - 
   376.8 - install-sapi: $(OVERALL_TARGET)
   376.9 - 	@echo "Installing PHP SAPI module:       $(PHP_SAPI)"
  376.10 --	-@$(mkinstalldirs) $(INSTALL_ROOT)$(bindir)
  376.11 -+	-@$(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(bindir)
  376.12 - 	-@if test ! -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME); then \
  376.13 - 		for i in 0.0.0 0.0 0; do \
  376.14 - 			if test -r $(phptempdir)/libphp$(PHP_MAJOR_VERSION).$(SHLIB_DL_SUFFIX_NAME).$$i; then \
  376.15 -@@ -37,19 +37,19 @@
  376.16 - 
  376.17 - install-modules: build-modules
  376.18 - 	@test -d modules && \
  376.19 --	$(mkinstalldirs) $(INSTALL_ROOT)$(EXTENSION_DIR)
  376.20 --	@echo "Installing shared extensions:     $(INSTALL_ROOT)$(EXTENSION_DIR)/"
  376.21 -+	$(mkinstalldirs) $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)
  376.22 -+	@echo "Installing shared extensions:     $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)/"
  376.23 - 	@rm -f modules/*.la >/dev/null 2>&1
  376.24 --	@$(INSTALL) modules/* $(INSTALL_ROOT)$(EXTENSION_DIR)
  376.25 -+	@$(INSTALL) modules/* $(DESTDIR)$(INSTALL_ROOT)$(EXTENSION_DIR)
  376.26 - 
  376.27 - install-headers:
  376.28 - 	-@if test "$(INSTALL_HEADERS)"; then \
  376.29 - 		for i in `echo $(INSTALL_HEADERS)`; do \
  376.30 - 			i=`$(top_srcdir)/build/shtool path -d $$i`; \
  376.31 --			paths="$$paths $(INSTALL_ROOT)$(phpincludedir)/$$i"; \
  376.32 -+			paths="$$paths $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i"; \
  376.33 - 		done; \
  376.34 - 		$(mkinstalldirs) $$paths && \
  376.35 --		echo "Installing header files:          $(INSTALL_ROOT)$(phpincludedir)/" && \
  376.36 -+		echo "Installing header files:          $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/" && \
  376.37 - 		for i in `echo $(INSTALL_HEADERS)`; do \
  376.38 - 			if test "$(PHP_PECL_EXTENSION)"; then \
  376.39 - 				src=`echo $$i | $(SED) -e "s#ext/$(PHP_PECL_EXTENSION)/##g"`; \
  376.40 -@@ -57,12 +57,12 @@
  376.41 - 				src=$$i; \
  376.42 - 			fi; \
  376.43 - 			if test -f "$(top_srcdir)/$$src"; then \
  376.44 --				$(INSTALL_DATA) $(top_srcdir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
  376.45 -+				$(INSTALL_DATA) $(top_srcdir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \
  376.46 - 			elif test -f "$(top_builddir)/$$src"; then \
  376.47 --				$(INSTALL_DATA) $(top_builddir)/$$src $(INSTALL_ROOT)$(phpincludedir)/$$i; \
  376.48 -+				$(INSTALL_DATA) $(top_builddir)/$$src $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \
  376.49 - 			else \
  376.50 --				(cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i; \
  376.51 --				cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
  376.52 -+				(cd $(top_srcdir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i; \
  376.53 -+				cd $(top_builddir)/$$src && $(INSTALL_DATA) *.h $(DESTDIR)$(INSTALL_ROOT)$(phpincludedir)/$$i) 2>/dev/null || true; \
  376.54 - 			fi \
  376.55 - 		done; \
  376.56 - 	fi
   377.1 --- a/portmidi/receipt	Wed May 09 17:03:28 2018 +0300
   377.2 +++ b/portmidi/receipt	Thu May 10 21:12:00 2018 +0300
   377.3 @@ -16,9 +16,6 @@
   377.4  # Rules to configure and make the package.
   377.5  compile_rules()
   377.6  {
   377.7 -	cd $src
   377.8 -	patch -Np1 -i $stuff/portmidi-217-Makefile.patch
   377.9 -
  377.10  	 # Prefix Fix
  377.11  	sed -i "s_\(/usr\)/local_\1_" \
  377.12  	*/CMakeLists.txt \
   378.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   378.2 +++ b/portmidi/stuff/patches/portmidi-217-Makefile.patch	Thu May 10 21:12:00 2018 +0300
   378.3 @@ -0,0 +1,77 @@
   378.4 +diff -Naur portmidi/CMakeLists.txt portmidi_patched/CMakeLists.txt
   378.5 +--- portmidi/CMakeLists.txt	2010-09-20 12:57:48.000000000 -0700
   378.6 ++++ portmidi_patched/CMakeLists.txt	2010-10-18 11:56:28.000000000 -0700
   378.7 +@@ -73,5 +73,4 @@
   378.8 + add_subdirectory(pm_dylib)
   378.9 + 
  378.10 + # Cannot figure out how to make an xcode Java application with CMake
  378.11 +-add_subdirectory(pm_java)
  378.12 + 
  378.13 +diff -Naur portmidi/pm_common/CMakeLists.txt portmidi_patched/pm_common/CMakeLists.txt
  378.14 +--- portmidi/pm_common/CMakeLists.txt	2010-09-20 12:57:48.000000000 -0700
  378.15 ++++ portmidi_patched/pm_common/CMakeLists.txt	2010-10-18 11:57:21.000000000 -0700
  378.16 +@@ -67,14 +67,6 @@
  378.17 +     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
  378.18 +   else(APPLE)
  378.19 +     # LINUX settings...
  378.20 +-    include(FindJNI)
  378.21 +-    message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
  378.22 +-    message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
  378.23 +-    message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
  378.24 +-    message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
  378.25 +-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
  378.26 +-    # libjvm.so is found relative to JAVA_INCLUDE_PATH:
  378.27 +-    set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
  378.28 + 
  378.29 +     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
  378.30 +     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
  378.31 +@@ -99,7 +91,6 @@
  378.32 +     set(PM_NEEDED_LIBS winmm.lib)
  378.33 +   endif(WIN32)
  378.34 + endif(UNIX)
  378.35 +-set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
  378.36 + 
  378.37 + # this completes the list of library sources by adding shared code
  378.38 + list(APPEND LIBSRC pmutil portmidi)
  378.39 +@@ -110,18 +101,10 @@
  378.40 + target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
  378.41 + 
  378.42 + # define the jni library
  378.43 +-include_directories(${JAVA_INCLUDE_PATHS})
  378.44 + 
  378.45 +-set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c)
  378.46 +-add_library(pmjni SHARED ${JNISRC})
  378.47 +-target_link_libraries(pmjni ${JNI_EXTRA_LIBS})
  378.48 +-set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib")
  378.49 + 
  378.50 + # install the libraries (Linux and Mac OS X command line)
  378.51 + if(UNIX)
  378.52 +-  INSTALL(TARGETS portmidi-static pmjni
  378.53 +-    LIBRARY DESTINATION /usr/local/lib
  378.54 +-    ARCHIVE DESTINATION /usr/local/lib)
  378.55 + # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
  378.56 + #  INSTALL(FILES portmidi.h ../porttime/porttime.h
  378.57 + #    DESTINATION /usr/local/include)
  378.58 +diff -Naur portmidi/pm_dylib/CMakeLists.txt portmidi_patched/pm_dylib/CMakeLists.txt
  378.59 +--- portmidi/pm_dylib/CMakeLists.txt	2009-11-19 21:41:09.000000000 -0800
  378.60 ++++ portmidi_patched/pm_dylib/CMakeLists.txt	2010-10-18 11:58:16.000000000 -0700
  378.61 +@@ -63,7 +63,6 @@
  378.62 +     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
  378.63 +   else(APPLE)
  378.64 +     # LINUX settings...
  378.65 +-    include(FindJNI)
  378.66 +     # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
  378.67 +     # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
  378.68 +     # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
  378.69 +@@ -75,11 +74,7 @@
  378.70 +     # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
  378.71 +     # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
  378.72 +     # because JAVA_INCLUDE_PATH2 is pretty obscure)
  378.73 +-    set(JAVA_INCLUDE_PATH  ${JAVA_INCLUDE_PATH-UNKNOWN}
  378.74 +-        CACHE STRING "where to find Java SDK include directory")
  378.75 +-    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
  378.76 +     # libjvm.so is found relative to JAVA_INCLUDE_PATH:
  378.77 +-    set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
  378.78 + 
  378.79 +     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
  378.80 +     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
   379.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   379.2 +++ b/portmidi/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   379.3 @@ -0,0 +1,1 @@
   379.4 +portmidi-217-Makefile.patch
   380.1 --- a/portmidi/stuff/portmidi-217-Makefile.patch	Wed May 09 17:03:28 2018 +0300
   380.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   380.3 @@ -1,77 +0,0 @@
   380.4 -diff -Naur portmidi/CMakeLists.txt portmidi_patched/CMakeLists.txt
   380.5 ---- portmidi/CMakeLists.txt	2010-09-20 12:57:48.000000000 -0700
   380.6 -+++ portmidi_patched/CMakeLists.txt	2010-10-18 11:56:28.000000000 -0700
   380.7 -@@ -73,5 +73,4 @@
   380.8 - add_subdirectory(pm_dylib)
   380.9 - 
  380.10 - # Cannot figure out how to make an xcode Java application with CMake
  380.11 --add_subdirectory(pm_java)
  380.12 - 
  380.13 -diff -Naur portmidi/pm_common/CMakeLists.txt portmidi_patched/pm_common/CMakeLists.txt
  380.14 ---- portmidi/pm_common/CMakeLists.txt	2010-09-20 12:57:48.000000000 -0700
  380.15 -+++ portmidi_patched/pm_common/CMakeLists.txt	2010-10-18 11:57:21.000000000 -0700
  380.16 -@@ -67,14 +67,6 @@
  380.17 -     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
  380.18 -   else(APPLE)
  380.19 -     # LINUX settings...
  380.20 --    include(FindJNI)
  380.21 --    message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
  380.22 --    message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
  380.23 --    message(STATUS "JAVA_INCLUDE_PATH2 is " ${JAVA_INCLUDE_PATH2})
  380.24 --    message(STATUS "JAVA_JVM_LIBRARY is " ${JAVA_JVM_LIBRARY})
  380.25 --    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH2})
  380.26 --    # libjvm.so is found relative to JAVA_INCLUDE_PATH:
  380.27 --    set(JAVAVM_LIB ${JAVA_JVM_LIBRARY}/libjvm.so)
  380.28 - 
  380.29 -     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
  380.30 -     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
  380.31 -@@ -99,7 +91,6 @@
  380.32 -     set(PM_NEEDED_LIBS winmm.lib)
  380.33 -   endif(WIN32)
  380.34 - endif(UNIX)
  380.35 --set(JNI_EXTRA_LIBS ${PM_NEEDED_LIBS} ${JAVA_JVM_LIBRARY})
  380.36 - 
  380.37 - # this completes the list of library sources by adding shared code
  380.38 - list(APPEND LIBSRC pmutil portmidi)
  380.39 -@@ -110,18 +101,10 @@
  380.40 - target_link_libraries(portmidi-static ${PM_NEEDED_LIBS})
  380.41 - 
  380.42 - # define the jni library
  380.43 --include_directories(${JAVA_INCLUDE_PATHS})
  380.44 - 
  380.45 --set(JNISRC ${LIBSRC} ../pm_java/pmjni/pmjni.c)
  380.46 --add_library(pmjni SHARED ${JNISRC})
  380.47 --target_link_libraries(pmjni ${JNI_EXTRA_LIBS})
  380.48 --set_target_properties(pmjni PROPERTIES EXECUTABLE_EXTENSION "jnilib")
  380.49 - 
  380.50 - # install the libraries (Linux and Mac OS X command line)
  380.51 - if(UNIX)
  380.52 --  INSTALL(TARGETS portmidi-static pmjni
  380.53 --    LIBRARY DESTINATION /usr/local/lib
  380.54 --    ARCHIVE DESTINATION /usr/local/lib)
  380.55 - # .h files installed by pm_dylib/CMakeLists.txt, so don't need them here
  380.56 - #  INSTALL(FILES portmidi.h ../porttime/porttime.h
  380.57 - #    DESTINATION /usr/local/include)
  380.58 -diff -Naur portmidi/pm_dylib/CMakeLists.txt portmidi_patched/pm_dylib/CMakeLists.txt
  380.59 ---- portmidi/pm_dylib/CMakeLists.txt	2009-11-19 21:41:09.000000000 -0800
  380.60 -+++ portmidi_patched/pm_dylib/CMakeLists.txt	2010-10-18 11:58:16.000000000 -0700
  380.61 -@@ -63,7 +63,6 @@
  380.62 -     message(STATUS "SYSROOT: " ${CMAKE_OSX_SYSROOT})
  380.63 -   else(APPLE)
  380.64 -     # LINUX settings...
  380.65 --    include(FindJNI)
  380.66 -     # message(STATUS "JAVA_JVM_LIB_PATH is " ${JAVA_JVM_LIB_PATH})
  380.67 -     # message(STATUS "JAVA_INCLUDE_PATH is " ${JAVA_INCLUDE_PATH})
  380.68 -     # note: should use JAVA_JVM_LIB_PATH, but it is not set properly
  380.69 -@@ -75,11 +74,7 @@
  380.70 -     # JAVA_INCLUDE_PATH2; if no, then we need to make both JAVA_INCLUDE_PATH
  380.71 -     # and JAVA_INCLUDE_PATH2 set by user (will need clear documentation
  380.72 -     # because JAVA_INCLUDE_PATH2 is pretty obscure)
  380.73 --    set(JAVA_INCLUDE_PATH  ${JAVA_INCLUDE_PATH-UNKNOWN}
  380.74 --        CACHE STRING "where to find Java SDK include directory")
  380.75 --    set(JAVA_INCLUDE_PATHS ${JAVA_INCLUDE_PATH} ${JAVA_INCLUDE_PATH}/linux)
  380.76 -     # libjvm.so is found relative to JAVA_INCLUDE_PATH:
  380.77 --    set(JAVAVM_LIB ${JAVA_INCLUDE_PATH}/../jre/lib/i386/client/libjvm.so)
  380.78 - 
  380.79 -     set(LINUXSRC pmlinuxalsa pmlinux finddefault)
  380.80 -     prepend_path(LIBSRC ../pm_linux/ ${LINUXSRC})
   381.1 --- a/procps/receipt	Wed May 09 17:03:28 2018 +0300
   381.2 +++ b/procps/receipt	Thu May 10 21:12:00 2018 +0300
   381.3 @@ -16,7 +16,6 @@
   381.4  # Rules to configure and make the package.
   381.5  compile_rules()
   381.6  {
   381.7 -	patch -Np1 -i $stuff/$PACKAGE-$VERSION+gmake-3.82.patch
   381.8  	make && make -j1 install
   381.9  }
  381.10  
   382.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   382.2 +++ b/procps/stuff/patches/procps-3.2.8+gmake-3.82.patch	Thu May 10 21:12:00 2018 +0300
   382.3 @@ -0,0 +1,14 @@
   382.4 +Index: procps-3.2.8/Makefile
   382.5 +===================================================================
   382.6 +--- procps-3.2.8.orig/Makefile
   382.7 ++++ procps-3.2.8/Makefile
   382.8 +@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES)
   382.9 + # want this rule first, use := on ALL, and ALL not filled in yet
  382.10 + all: do_all
  382.11 + 
  382.12 +--include */module.mk
  382.13 ++-include proc/module.mk
  382.14 ++-include ps/module.mk
  382.15 + 
  382.16 + do_all:    $(ALL)
  382.17 + 
   383.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   383.2 +++ b/procps/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   383.3 @@ -0,0 +1,1 @@
   383.4 +procps-3.2.8+gmake-3.82.patch
   384.1 --- a/procps/stuff/procps-3.2.8+gmake-3.82.patch	Wed May 09 17:03:28 2018 +0300
   384.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   384.3 @@ -1,14 +0,0 @@
   384.4 -Index: procps-3.2.8/Makefile
   384.5 -===================================================================
   384.6 ---- procps-3.2.8.orig/Makefile
   384.7 -+++ procps-3.2.8/Makefile
   384.8 -@@ -174,7 +174,8 @@ INSTALL := $(BINFILES) $(MANFILES)
   384.9 - # want this rule first, use := on ALL, and ALL not filled in yet
  384.10 - all: do_all
  384.11 - 
  384.12 ---include */module.mk
  384.13 -+-include proc/module.mk
  384.14 -+-include ps/module.mk
  384.15 - 
  384.16 - do_all:    $(ALL)
  384.17 - 
   385.1 --- a/python-pygame/receipt	Wed May 09 17:03:28 2018 +0300
   385.2 +++ b/python-pygame/receipt	Thu May 10 21:12:00 2018 +0300
   385.3 @@ -16,7 +16,6 @@
   385.4  SPLIT="python-pygame-dev"
   385.5  
   385.6  compile_rules() {
   385.7 -	patch -Np0 -i $stuff/config.patch
   385.8  	sed -i "s|linux/videodev.h|libv4l1-videodev.h|" src/camera.h
   385.9  	python config.py -auto &&
  385.10  	python setup.py install --root=$DESTDIR
   386.1 --- a/python-pygame/stuff/config.patch	Wed May 09 17:03:28 2018 +0300
   386.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   386.3 @@ -1,26 +0,0 @@
   386.4 -Index: config_unix.py
   386.5 -===================================================================
   386.6 ---- config_unix.py	(revision 2567)
   386.7 -+++ config_unix.py	(working copy)
   386.8 -@@ -174,7 +174,7 @@
   386.9 - 
  386.10 -     for d in DEPS[1:]:
  386.11 -         if not d.found:
  386.12 --            if not confirm("""
  386.13 -+            if "-auto" not in sys.argv and not confirm("""
  386.14 - Warning, some of the pygame dependencies were not found. Pygame can still
  386.15 - compile and install, but games that depend on those missing dependencies
  386.16 - will not run. Would you like to continue the configuration?"""):
  386.17 -Index: config_msys.py
  386.18 -===================================================================
  386.19 ---- config_msys.py	(revision 2567)
  386.20 -+++ config_msys.py	(working copy)
  386.21 -@@ -283,7 +283,7 @@
  386.22 -     
  386.23 -     for d in DEPS[1:]:
  386.24 -         if not d.found:
  386.25 --            if not confirm("""
  386.26 -+            if "-auto" not in sys.argv and not confirm("""
  386.27 - Warning, some of the pygame dependencies were not found. Pygame can still
  386.28 - compile and install, but games that depend on those missing dependencies
  386.29 - will not run. Would you like to continue the configuration?"""):
   387.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   387.2 +++ b/python-pygame/stuff/patches/config.patch	Thu May 10 21:12:00 2018 +0300
   387.3 @@ -0,0 +1,26 @@
   387.4 +Index: config_unix.py
   387.5 +===================================================================
   387.6 +--- config_unix.py	(revision 2567)
   387.7 ++++ config_unix.py	(working copy)
   387.8 +@@ -174,7 +174,7 @@
   387.9 + 
  387.10 +     for d in DEPS[1:]:
  387.11 +         if not d.found:
  387.12 +-            if not confirm("""
  387.13 ++            if "-auto" not in sys.argv and not confirm("""
  387.14 + Warning, some of the pygame dependencies were not found. Pygame can still
  387.15 + compile and install, but games that depend on those missing dependencies
  387.16 + will not run. Would you like to continue the configuration?"""):
  387.17 +Index: config_msys.py
  387.18 +===================================================================
  387.19 +--- config_msys.py	(revision 2567)
  387.20 ++++ config_msys.py	(working copy)
  387.21 +@@ -283,7 +283,7 @@
  387.22 +     
  387.23 +     for d in DEPS[1:]:
  387.24 +         if not d.found:
  387.25 +-            if not confirm("""
  387.26 ++            if "-auto" not in sys.argv and not confirm("""
  387.27 + Warning, some of the pygame dependencies were not found. Pygame can still
  387.28 + compile and install, but games that depend on those missing dependencies
  387.29 + will not run. Would you like to continue the configuration?"""):
   388.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   388.2 +++ b/python-pygame/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   388.3 @@ -0,0 +1,1 @@
   388.4 +-Np0|config.patch
   389.1 --- a/python-pyxml/receipt	Wed May 09 17:03:28 2018 +0300
   389.2 +++ b/python-pyxml/receipt	Thu May 10 21:12:00 2018 +0300
   389.3 @@ -17,7 +17,6 @@
   389.4  # Rules to configure and make the package.
   389.5  compile_rules()
   389.6  {
   389.7 -	patch -Np1 -i $stuff/fix-python2.6.patch
   389.8  	python setup.py build --with-xslt
   389.9  	python setup.py install --root=$DESTDIR
  389.10  }
   390.1 --- a/python-pyxml/stuff/fix-python2.6.patch	Wed May 09 17:03:28 2018 +0300
   390.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   390.3 @@ -1,28 +0,0 @@
   390.4 -diff -ur a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py
   390.5 ---- a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py	2003-03-11 15:01:34.000000000 +0100
   390.6 -+++ b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py	2009-05-25 16:32:26.000000000 +0200
   390.7 -@@ -24,8 +24,8 @@
   390.8 -         self._rel = rel
   390.9 -         nt = ParsedNodeTest.ParsedNodeTest('node', '')
  390.10 -         ppl = ParsedPredicateList.ParsedPredicateList([])
  390.11 --        as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  390.12 --        self._step = ParsedStep.ParsedStep(as, nt, ppl)
  390.13 -+        asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  390.14 -+        self._step = ParsedStep.ParsedStep(asp, nt, ppl)
  390.15 -         return
  390.16 - 
  390.17 -     def evaluate(self, context):
  390.18 -diff -ur a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py
  390.19 ---- a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py	2003-03-11 15:01:34.000000000 +0100
  390.20 -+++ b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py	2009-05-25 16:27:55.000000000 +0200
  390.21 -@@ -28,8 +28,8 @@
  390.22 -         self._right = right
  390.23 -         nt = ParsedNodeTest.ParsedNodeTest('node','')
  390.24 -         ppl = ParsedPredicateList.ParsedPredicateList([])
  390.25 --        as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  390.26 --        self._middle = ParsedStep.ParsedStep(as, nt, ppl)
  390.27 -+        asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  390.28 -+        self._middle = ParsedStep.ParsedStep(asp, nt, ppl)
  390.29 - 
  390.30 -     def evaluate(self, context):
  390.31 -         res = []
   391.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   391.2 +++ b/python-pyxml/stuff/patches/fix-python2.6.patch	Thu May 10 21:12:00 2018 +0300
   391.3 @@ -0,0 +1,28 @@
   391.4 +diff -ur a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py
   391.5 +--- a/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py	2003-03-11 15:01:34.000000000 +0100
   391.6 ++++ b/xml/xpath/ParsedAbbreviatedAbsoluteLocationPath.py	2009-05-25 16:32:26.000000000 +0200
   391.7 +@@ -24,8 +24,8 @@
   391.8 +         self._rel = rel
   391.9 +         nt = ParsedNodeTest.ParsedNodeTest('node', '')
  391.10 +         ppl = ParsedPredicateList.ParsedPredicateList([])
  391.11 +-        as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  391.12 +-        self._step = ParsedStep.ParsedStep(as, nt, ppl)
  391.13 ++        asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  391.14 ++        self._step = ParsedStep.ParsedStep(asp, nt, ppl)
  391.15 +         return
  391.16 + 
  391.17 +     def evaluate(self, context):
  391.18 +diff -ur a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py
  391.19 +--- a/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py	2003-03-11 15:01:34.000000000 +0100
  391.20 ++++ b/xml/xpath/ParsedAbbreviatedRelativeLocationPath.py	2009-05-25 16:27:55.000000000 +0200
  391.21 +@@ -28,8 +28,8 @@
  391.22 +         self._right = right
  391.23 +         nt = ParsedNodeTest.ParsedNodeTest('node','')
  391.24 +         ppl = ParsedPredicateList.ParsedPredicateList([])
  391.25 +-        as = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  391.26 +-        self._middle = ParsedStep.ParsedStep(as, nt, ppl)
  391.27 ++        asp = ParsedAxisSpecifier.ParsedAxisSpecifier('descendant-or-self')
  391.28 ++        self._middle = ParsedStep.ParsedStep(asp, nt, ppl)
  391.29 + 
  391.30 +     def evaluate(self, context):
  391.31 +         res = []
   392.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   392.2 +++ b/python-pyxml/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   392.3 @@ -0,0 +1,1 @@
   392.4 +fix-python2.6.patch
   393.1 --- a/qemu-light/receipt	Wed May 09 17:03:28 2018 +0300
   393.2 +++ b/qemu-light/receipt	Thu May 10 21:12:00 2018 +0300
   393.3 @@ -21,8 +21,6 @@
   393.4  		http://netassist.dl.sourceforge.net/project/edk2/OVMF/$UEFIZIP
   393.5  	unzip $SRC/$UEFIZIP OVMF.fd -d $DESTIDR/usr/share/qemu/ia32
   393.6  
   393.7 -	patch -p0 < $stuff/cloop.u
   393.8 -
   393.9  	TARGET="i386-softmmu"
  393.10  
  393.11  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
   394.1 --- a/qemu-light/stuff/cloop.u	Wed May 09 17:03:28 2018 +0300
   394.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   394.3 @@ -1,284 +0,0 @@
   394.4 ---- block/cloop.c
   394.5 -+++ block/cloop.c
   394.6 -@@ -29,11 +29,90 @@
   394.7 - /* Maximum compressed block size */
   394.8 - #define MAX_BLOCK_SIZE (64 * 1024 * 1024)
   394.9 - 
  394.10 -+typedef struct cloop_tail {
  394.11 -+	uint32_t table_size;
  394.12 -+	uint32_t index_size;
  394.13 -+	uint32_t num_blocks;
  394.14 -+} cloop_tail;
  394.15 -+
  394.16 -+typedef struct block_info {
  394.17 -+	uint64_t offset;	/* 64-bit offsets of compressed block */
  394.18 -+	uint32_t size;		/* 32-bit compressed block size */
  394.19 -+	uint32_t optidx;	/* 32-bit index number */
  394.20 -+} block_info;
  394.21 -+
  394.22 -+static inline int build_index(block_info *offsets, unsigned long n)
  394.23 -+{
  394.24 -+	uint32_t *ofs32 = (uint32_t *) offsets;
  394.25 -+	uint64_t *ofs64 = (uint64_t *) offsets;
  394.26 -+	
  394.27 -+	if (ofs32[0] == 0) {
  394.28 -+		if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */
  394.29 -+			while (n--) {
  394.30 -+				offsets[n].offset = be64_to_cpu(offsets[n].offset);
  394.31 -+				offsets[n].size = ntohl(offsets[n].size);
  394.32 -+        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  394.33 -+        				return n+1;
  394.34 -+			}
  394.35 -+		}
  394.36 -+		else { /* V2.0 */
  394.37 -+			uint64_t last = be64_to_cpu(ofs64[n - 1]);
  394.38 -+			while (n--) {
  394.39 -+				offsets[n].size = last - 
  394.40 -+					(offsets[n].offset = be64_to_cpu(ofs64[n])); 
  394.41 -+        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  394.42 -+        				return n+1;
  394.43 -+				last = offsets[n].offset;
  394.44 -+			}
  394.45 -+		}
  394.46 -+	}
  394.47 -+	else if (ofs32[1] == 0) { /* V1.0 */
  394.48 -+		uint64_t last = le64_to_cpu(ofs64[n - 1]);
  394.49 -+		while (n--) {
  394.50 -+			offsets[n].size = last - 
  394.51 -+				(offsets[n].offset = le64_to_cpu(ofs64[n])); 
  394.52 -+        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  394.53 -+        			return n+1;
  394.54 -+			last = offsets[n].offset;
  394.55 -+		}
  394.56 -+	}
  394.57 -+	else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */
  394.58 -+		uint64_t last = ntohl(ofs32[n - 1]);
  394.59 -+		while (n--) {
  394.60 -+			offsets[n].size = last - 
  394.61 -+				(offsets[n].offset = ntohl(ofs32[n])); 
  394.62 -+        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  394.63 -+        			return n+1;
  394.64 -+			last = offsets[n].offset;
  394.65 -+		}
  394.66 -+	}
  394.67 -+	else { /* V3.0 */
  394.68 -+		unsigned long i;
  394.69 -+		uint64_t j;
  394.70 -+		
  394.71 -+		for (i = n; i-- > 0; ) {
  394.72 -+			offsets[i].size = ntohl(ofs32[i]); 
  394.73 -+        		if (offsets[i].size > 2 * MAX_BLOCK_SIZE)
  394.74 -+        			return i+1;
  394.75 -+		}
  394.76 -+		for (i = 0, j = 128 + 4 + 4; i < n; i++) {
  394.77 -+			offsets[i].offset = j;
  394.78 -+			if (offsets[i].size & 0x80000000) {
  394.79 -+				unsigned long k = offsets[i].size & 0x7FFFFFFF;
  394.80 -+				offsets[i].offset = offsets[k].offset;
  394.81 -+				offsets[i].size = offsets[k].size;
  394.82 -+			}
  394.83 -+			else j += offsets[i].size;
  394.84 -+		}
  394.85 -+	}
  394.86 -+	return 0;
  394.87 -+}
  394.88 -+
  394.89 - typedef struct BDRVCloopState {
  394.90 -     CoMutex lock;
  394.91 -     uint32_t block_size;
  394.92 -     uint32_t n_blocks;
  394.93 --    uint64_t *offsets;
  394.94 -+    block_info *offsets;
  394.95 -     uint32_t sectors_per_block;
  394.96 -     uint32_t current_block;
  394.97 -     uint8_t *compressed_block;
  394.98 -@@ -43,17 +117,21 @@
  394.99 - 
 394.100 - static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename)
 394.101 - {
 394.102 --    const char *magic_version_2_0 = "#!/bin/sh\n"
 394.103 --        "#V2.0 Format\n"
 394.104 -+    static const uint8_t magic[] =
 394.105 -         "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n";
 394.106 --    int length = strlen(magic_version_2_0);
 394.107 --    if (length > buf_size) {
 394.108 --        length = buf_size;
 394.109 -+    int i, ret = 0, length = buf_size;
 394.110 -+    uint8_t c;
 394.111 -+
 394.112 -+    if (length > 127) {
 394.113 -+        length = 127;
 394.114 -     }
 394.115 --    if (!memcmp(magic_version_2_0, buf, length)) {
 394.116 --        return 2;
 394.117 -+    for (i = 0; i < length - sizeof(magic) + 1; i++) {
 394.118 -+	if (buf[i] != magic[0]) continue;
 394.119 -+	if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue;
 394.120 -+	ret = 2;
 394.121 -+	break;
 394.122 -     }
 394.123 --    return 0;
 394.124 -+    return ret;
 394.125 - }
 394.126 - 
 394.127 - static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
 394.128 -@@ -91,79 +169,97 @@
 394.129 -                    MAX_BLOCK_SIZE / (1024 * 1024));
 394.130 -         return -EINVAL;
 394.131 -     }
 394.132 --
 394.133 -     ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4);
 394.134 -     if (ret < 0) {
 394.135 -         return ret;
 394.136 -     }
 394.137 -     s->n_blocks = be32_to_cpu(s->n_blocks);
 394.138 - 
 394.139 --    /* read offsets */
 394.140 --    if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) {
 394.141 --        /* Prevent integer overflow */
 394.142 --        error_setg(errp, "n_blocks %u must be %zu or less",
 394.143 --                   s->n_blocks,
 394.144 --                   (UINT32_MAX - 1) / sizeof(uint64_t));
 394.145 --        return -EINVAL;
 394.146 --    }
 394.147 --    offsets_size = (s->n_blocks + 1) * sizeof(uint64_t);
 394.148 --    if (offsets_size > 512 * 1024 * 1024) {
 394.149 --        /* Prevent ridiculous offsets_size which causes memory allocation to
 394.150 --         * fail or overflows bdrv_pread() size.  In practice the 512 MB
 394.151 --         * offsets[] limit supports 16 TB images at 256 KB block size.
 394.152 --         */
 394.153 --        error_setg(errp, "image requires too many offsets, "
 394.154 --                   "try increasing block size");
 394.155 --        return -EINVAL;
 394.156 --    }
 394.157 --    s->offsets = g_malloc(offsets_size);
 394.158 -+    /* initialize zlib engine */
 394.159 -+    max_compressed_block_size =  s->block_size + s->block_size/1000 + 12 + 4;
 394.160 -+    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 394.161 -+    s->uncompressed_block = g_malloc(s->block_size);
 394.162 - 
 394.163 --    ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 394.164 --    if (ret < 0) {
 394.165 -+    if (inflateInit(&s->zstream) != Z_OK) {
 394.166 -+        ret = -EINVAL;
 394.167 -         goto fail;
 394.168 -     }
 394.169 - 
 394.170 --    for (i = 0; i < s->n_blocks + 1; i++) {
 394.171 --        uint64_t size;
 394.172 -+    /* read offsets */
 394.173 -+    if (s->n_blocks + 1 == 0) {
 394.174 -+        cloop_tail tail;
 394.175 -+        int64_t end = bdrv_getlength(bs->file);
 394.176 -+	void *p;
 394.177 -+	uint32_t toclen, len; 
 394.178 - 
 394.179 --        s->offsets[i] = be64_to_cpu(s->offsets[i]);
 394.180 --        if (i == 0) {
 394.181 --            continue;
 394.182 -+        ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail));
 394.183 -+        if (ret < 0) {
 394.184 -+            goto fail;
 394.185 -         }
 394.186 - 
 394.187 --        if (s->offsets[i] < s->offsets[i - 1]) {
 394.188 --            error_setg(errp, "offsets not monotonically increasing at "
 394.189 --                       "index %u, image file is corrupt", i);
 394.190 --            ret = -EINVAL;
 394.191 --            goto fail;
 394.192 -+        s->n_blocks = be32_to_cpu(tail.num_blocks);
 394.193 -+        offsets_size = s->n_blocks * sizeof(block_info);
 394.194 -+        if (offsets_size > 512 * 1024 * 1024) {
 394.195 -+            /* Prevent ridiculous offsets_size which causes memory allocation to
 394.196 -+             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 394.197 -+             * offsets[] limit supports 16 TB images at 256 KB block size.
 394.198 -+             */
 394.199 -+            error_setg(errp, "image requires too many offsets, "
 394.200 -+                       "try increasing block size");
 394.201 -+            return -EINVAL;
 394.202 -         }
 394.203 -+	len = be32_to_cpu(tail.table_size);
 394.204 -+	toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks;
 394.205 - 
 394.206 --        size = s->offsets[i] - s->offsets[i - 1];
 394.207 -+        s->offsets = g_malloc(offsets_size);
 394.208 -+	p = g_malloc(len);
 394.209 - 
 394.210 --        /* Compressed blocks should be smaller than the uncompressed block size
 394.211 --         * but maybe compression performed poorly so the compressed block is
 394.212 --         * actually bigger.  Clamp down on unrealistic values to prevent
 394.213 --         * ridiculous s->compressed_block allocation.
 394.214 --         */
 394.215 --        if (size > 2 * MAX_BLOCK_SIZE) {
 394.216 --            error_setg(errp, "invalid compressed block size at index %u, "
 394.217 --                       "image file is corrupt", i);
 394.218 -+        ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len);
 394.219 -+        if (ret < 0) {
 394.220 -+            goto fail;
 394.221 -+        }
 394.222 -+        s->zstream.next_in = p;
 394.223 -+        s->zstream.avail_in = len;
 394.224 -+        s->zstream.next_out = s->offsets;
 394.225 -+        s->zstream.avail_out = toclen;
 394.226 -+        ret = inflateReset(&s->zstream);
 394.227 -+        if (ret != Z_OK) {
 394.228 -             ret = -EINVAL;
 394.229 -             goto fail;
 394.230 -         }
 394.231 --
 394.232 --        if (size > max_compressed_block_size) {
 394.233 --            max_compressed_block_size = size;
 394.234 -+        ret = inflate(&s->zstream, Z_FINISH);
 394.235 -+        if (ret != Z_STREAM_END || s->zstream.total_out != toclen) {
 394.236 -+            ret = -EINVAL;
 394.237 -+            goto fail;
 394.238 -         }
 394.239 -+	g_free(p);
 394.240 -     }
 394.241 -+    else {
 394.242 -+        offsets_size = s->n_blocks * sizeof(block_info);
 394.243 -+        if (offsets_size > 512 * 1024 * 1024) {
 394.244 -+            /* Prevent ridiculous offsets_size which causes memory allocation to
 394.245 -+             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 394.246 -+             * offsets[] limit supports 16 TB images at 256 KB block size.
 394.247 -+             */
 394.248 -+            error_setg(errp, "image requires too many offsets, "
 394.249 -+                       "try increasing block size");
 394.250 -+            return -EINVAL;
 394.251 -+        }
 394.252 -+        s->offsets = g_malloc(offsets_size);
 394.253 - 
 394.254 --    /* initialize zlib engine */
 394.255 --    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 394.256 --    s->uncompressed_block = g_malloc(s->block_size);
 394.257 --    if (inflateInit(&s->zstream) != Z_OK) {
 394.258 -+        ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 394.259 -+        if (ret < 0) {
 394.260 -+            goto fail;
 394.261 -+        }
 394.262 -+    }
 394.263 -+    ret = build_index(s->offsets, s->n_blocks);
 394.264 -+    if (ret) {
 394.265 -+        error_setg(errp, "invalid compressed block size at index %u, "
 394.266 -+                   "image file is corrupt", ret-1);
 394.267 -         ret = -EINVAL;
 394.268 -         goto fail;
 394.269 -     }
 394.270 -+
 394.271 -     s->current_block = s->n_blocks;
 394.272 - 
 394.273 -     s->sectors_per_block = s->block_size/512;
 394.274 -@@ -184,10 +280,10 @@
 394.275 - 
 394.276 -     if (s->current_block != block_num) {
 394.277 -         int ret;
 394.278 --        uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num];
 394.279 -+        uint32_t bytes = s->offsets[block_num].size;
 394.280 - 
 394.281 --        ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block,
 394.282 --                         bytes);
 394.283 -+        ret = bdrv_pread(bs->file, s->offsets[block_num].offset,
 394.284 -+			 s->compressed_block, bytes);
 394.285 -         if (ret != bytes) {
 394.286 -             return -1;
 394.287 -         }
   395.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   395.2 +++ b/qemu-light/stuff/patches/cloop.u	Thu May 10 21:12:00 2018 +0300
   395.3 @@ -0,0 +1,284 @@
   395.4 +--- block/cloop.c
   395.5 ++++ block/cloop.c
   395.6 +@@ -29,11 +29,90 @@
   395.7 + /* Maximum compressed block size */
   395.8 + #define MAX_BLOCK_SIZE (64 * 1024 * 1024)
   395.9 + 
  395.10 ++typedef struct cloop_tail {
  395.11 ++	uint32_t table_size;
  395.12 ++	uint32_t index_size;
  395.13 ++	uint32_t num_blocks;
  395.14 ++} cloop_tail;
  395.15 ++
  395.16 ++typedef struct block_info {
  395.17 ++	uint64_t offset;	/* 64-bit offsets of compressed block */
  395.18 ++	uint32_t size;		/* 32-bit compressed block size */
  395.19 ++	uint32_t optidx;	/* 32-bit index number */
  395.20 ++} block_info;
  395.21 ++
  395.22 ++static inline int build_index(block_info *offsets, unsigned long n)
  395.23 ++{
  395.24 ++	uint32_t *ofs32 = (uint32_t *) offsets;
  395.25 ++	uint64_t *ofs64 = (uint64_t *) offsets;
  395.26 ++	
  395.27 ++	if (ofs32[0] == 0) {
  395.28 ++		if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */
  395.29 ++			while (n--) {
  395.30 ++				offsets[n].offset = be64_to_cpu(offsets[n].offset);
  395.31 ++				offsets[n].size = ntohl(offsets[n].size);
  395.32 ++        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  395.33 ++        				return n+1;
  395.34 ++			}
  395.35 ++		}
  395.36 ++		else { /* V2.0 */
  395.37 ++			uint64_t last = be64_to_cpu(ofs64[n - 1]);
  395.38 ++			while (n--) {
  395.39 ++				offsets[n].size = last - 
  395.40 ++					(offsets[n].offset = be64_to_cpu(ofs64[n])); 
  395.41 ++        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  395.42 ++        				return n+1;
  395.43 ++				last = offsets[n].offset;
  395.44 ++			}
  395.45 ++		}
  395.46 ++	}
  395.47 ++	else if (ofs32[1] == 0) { /* V1.0 */
  395.48 ++		uint64_t last = le64_to_cpu(ofs64[n - 1]);
  395.49 ++		while (n--) {
  395.50 ++			offsets[n].size = last - 
  395.51 ++				(offsets[n].offset = le64_to_cpu(ofs64[n])); 
  395.52 ++        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  395.53 ++        			return n+1;
  395.54 ++			last = offsets[n].offset;
  395.55 ++		}
  395.56 ++	}
  395.57 ++	else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */
  395.58 ++		uint64_t last = ntohl(ofs32[n - 1]);
  395.59 ++		while (n--) {
  395.60 ++			offsets[n].size = last - 
  395.61 ++				(offsets[n].offset = ntohl(ofs32[n])); 
  395.62 ++        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  395.63 ++        			return n+1;
  395.64 ++			last = offsets[n].offset;
  395.65 ++		}
  395.66 ++	}
  395.67 ++	else { /* V3.0 */
  395.68 ++		unsigned long i;
  395.69 ++		uint64_t j;
  395.70 ++		
  395.71 ++		for (i = n; i-- > 0; ) {
  395.72 ++			offsets[i].size = ntohl(ofs32[i]); 
  395.73 ++        		if (offsets[i].size > 2 * MAX_BLOCK_SIZE)
  395.74 ++        			return i+1;
  395.75 ++		}
  395.76 ++		for (i = 0, j = 128 + 4 + 4; i < n; i++) {
  395.77 ++			offsets[i].offset = j;
  395.78 ++			if (offsets[i].size & 0x80000000) {
  395.79 ++				unsigned long k = offsets[i].size & 0x7FFFFFFF;
  395.80 ++				offsets[i].offset = offsets[k].offset;
  395.81 ++				offsets[i].size = offsets[k].size;
  395.82 ++			}
  395.83 ++			else j += offsets[i].size;
  395.84 ++		}
  395.85 ++	}
  395.86 ++	return 0;
  395.87 ++}
  395.88 ++
  395.89 + typedef struct BDRVCloopState {
  395.90 +     CoMutex lock;
  395.91 +     uint32_t block_size;
  395.92 +     uint32_t n_blocks;
  395.93 +-    uint64_t *offsets;
  395.94 ++    block_info *offsets;
  395.95 +     uint32_t sectors_per_block;
  395.96 +     uint32_t current_block;
  395.97 +     uint8_t *compressed_block;
  395.98 +@@ -43,17 +117,21 @@
  395.99 + 
 395.100 + static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename)
 395.101 + {
 395.102 +-    const char *magic_version_2_0 = "#!/bin/sh\n"
 395.103 +-        "#V2.0 Format\n"
 395.104 ++    static const uint8_t magic[] =
 395.105 +         "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n";
 395.106 +-    int length = strlen(magic_version_2_0);
 395.107 +-    if (length > buf_size) {
 395.108 +-        length = buf_size;
 395.109 ++    int i, ret = 0, length = buf_size;
 395.110 ++    uint8_t c;
 395.111 ++
 395.112 ++    if (length > 127) {
 395.113 ++        length = 127;
 395.114 +     }
 395.115 +-    if (!memcmp(magic_version_2_0, buf, length)) {
 395.116 +-        return 2;
 395.117 ++    for (i = 0; i < length - sizeof(magic) + 1; i++) {
 395.118 ++	if (buf[i] != magic[0]) continue;
 395.119 ++	if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue;
 395.120 ++	ret = 2;
 395.121 ++	break;
 395.122 +     }
 395.123 +-    return 0;
 395.124 ++    return ret;
 395.125 + }
 395.126 + 
 395.127 + static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
 395.128 +@@ -91,79 +169,97 @@
 395.129 +                    MAX_BLOCK_SIZE / (1024 * 1024));
 395.130 +         return -EINVAL;
 395.131 +     }
 395.132 +-
 395.133 +     ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4);
 395.134 +     if (ret < 0) {
 395.135 +         return ret;
 395.136 +     }
 395.137 +     s->n_blocks = be32_to_cpu(s->n_blocks);
 395.138 + 
 395.139 +-    /* read offsets */
 395.140 +-    if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) {
 395.141 +-        /* Prevent integer overflow */
 395.142 +-        error_setg(errp, "n_blocks %u must be %zu or less",
 395.143 +-                   s->n_blocks,
 395.144 +-                   (UINT32_MAX - 1) / sizeof(uint64_t));
 395.145 +-        return -EINVAL;
 395.146 +-    }
 395.147 +-    offsets_size = (s->n_blocks + 1) * sizeof(uint64_t);
 395.148 +-    if (offsets_size > 512 * 1024 * 1024) {
 395.149 +-        /* Prevent ridiculous offsets_size which causes memory allocation to
 395.150 +-         * fail or overflows bdrv_pread() size.  In practice the 512 MB
 395.151 +-         * offsets[] limit supports 16 TB images at 256 KB block size.
 395.152 +-         */
 395.153 +-        error_setg(errp, "image requires too many offsets, "
 395.154 +-                   "try increasing block size");
 395.155 +-        return -EINVAL;
 395.156 +-    }
 395.157 +-    s->offsets = g_malloc(offsets_size);
 395.158 ++    /* initialize zlib engine */
 395.159 ++    max_compressed_block_size =  s->block_size + s->block_size/1000 + 12 + 4;
 395.160 ++    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 395.161 ++    s->uncompressed_block = g_malloc(s->block_size);
 395.162 + 
 395.163 +-    ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 395.164 +-    if (ret < 0) {
 395.165 ++    if (inflateInit(&s->zstream) != Z_OK) {
 395.166 ++        ret = -EINVAL;
 395.167 +         goto fail;
 395.168 +     }
 395.169 + 
 395.170 +-    for (i = 0; i < s->n_blocks + 1; i++) {
 395.171 +-        uint64_t size;
 395.172 ++    /* read offsets */
 395.173 ++    if (s->n_blocks + 1 == 0) {
 395.174 ++        cloop_tail tail;
 395.175 ++        int64_t end = bdrv_getlength(bs->file);
 395.176 ++	void *p;
 395.177 ++	uint32_t toclen, len; 
 395.178 + 
 395.179 +-        s->offsets[i] = be64_to_cpu(s->offsets[i]);
 395.180 +-        if (i == 0) {
 395.181 +-            continue;
 395.182 ++        ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail));
 395.183 ++        if (ret < 0) {
 395.184 ++            goto fail;
 395.185 +         }
 395.186 + 
 395.187 +-        if (s->offsets[i] < s->offsets[i - 1]) {
 395.188 +-            error_setg(errp, "offsets not monotonically increasing at "
 395.189 +-                       "index %u, image file is corrupt", i);
 395.190 +-            ret = -EINVAL;
 395.191 +-            goto fail;
 395.192 ++        s->n_blocks = be32_to_cpu(tail.num_blocks);
 395.193 ++        offsets_size = s->n_blocks * sizeof(block_info);
 395.194 ++        if (offsets_size > 512 * 1024 * 1024) {
 395.195 ++            /* Prevent ridiculous offsets_size which causes memory allocation to
 395.196 ++             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 395.197 ++             * offsets[] limit supports 16 TB images at 256 KB block size.
 395.198 ++             */
 395.199 ++            error_setg(errp, "image requires too many offsets, "
 395.200 ++                       "try increasing block size");
 395.201 ++            return -EINVAL;
 395.202 +         }
 395.203 ++	len = be32_to_cpu(tail.table_size);
 395.204 ++	toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks;
 395.205 + 
 395.206 +-        size = s->offsets[i] - s->offsets[i - 1];
 395.207 ++        s->offsets = g_malloc(offsets_size);
 395.208 ++	p = g_malloc(len);
 395.209 + 
 395.210 +-        /* Compressed blocks should be smaller than the uncompressed block size
 395.211 +-         * but maybe compression performed poorly so the compressed block is
 395.212 +-         * actually bigger.  Clamp down on unrealistic values to prevent
 395.213 +-         * ridiculous s->compressed_block allocation.
 395.214 +-         */
 395.215 +-        if (size > 2 * MAX_BLOCK_SIZE) {
 395.216 +-            error_setg(errp, "invalid compressed block size at index %u, "
 395.217 +-                       "image file is corrupt", i);
 395.218 ++        ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len);
 395.219 ++        if (ret < 0) {
 395.220 ++            goto fail;
 395.221 ++        }
 395.222 ++        s->zstream.next_in = p;
 395.223 ++        s->zstream.avail_in = len;
 395.224 ++        s->zstream.next_out = s->offsets;
 395.225 ++        s->zstream.avail_out = toclen;
 395.226 ++        ret = inflateReset(&s->zstream);
 395.227 ++        if (ret != Z_OK) {
 395.228 +             ret = -EINVAL;
 395.229 +             goto fail;
 395.230 +         }
 395.231 +-
 395.232 +-        if (size > max_compressed_block_size) {
 395.233 +-            max_compressed_block_size = size;
 395.234 ++        ret = inflate(&s->zstream, Z_FINISH);
 395.235 ++        if (ret != Z_STREAM_END || s->zstream.total_out != toclen) {
 395.236 ++            ret = -EINVAL;
 395.237 ++            goto fail;
 395.238 +         }
 395.239 ++	g_free(p);
 395.240 +     }
 395.241 ++    else {
 395.242 ++        offsets_size = s->n_blocks * sizeof(block_info);
 395.243 ++        if (offsets_size > 512 * 1024 * 1024) {
 395.244 ++            /* Prevent ridiculous offsets_size which causes memory allocation to
 395.245 ++             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 395.246 ++             * offsets[] limit supports 16 TB images at 256 KB block size.
 395.247 ++             */
 395.248 ++            error_setg(errp, "image requires too many offsets, "
 395.249 ++                       "try increasing block size");
 395.250 ++            return -EINVAL;
 395.251 ++        }
 395.252 ++        s->offsets = g_malloc(offsets_size);
 395.253 + 
 395.254 +-    /* initialize zlib engine */
 395.255 +-    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 395.256 +-    s->uncompressed_block = g_malloc(s->block_size);
 395.257 +-    if (inflateInit(&s->zstream) != Z_OK) {
 395.258 ++        ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 395.259 ++        if (ret < 0) {
 395.260 ++            goto fail;
 395.261 ++        }
 395.262 ++    }
 395.263 ++    ret = build_index(s->offsets, s->n_blocks);
 395.264 ++    if (ret) {
 395.265 ++        error_setg(errp, "invalid compressed block size at index %u, "
 395.266 ++                   "image file is corrupt", ret-1);
 395.267 +         ret = -EINVAL;
 395.268 +         goto fail;
 395.269 +     }
 395.270 ++
 395.271 +     s->current_block = s->n_blocks;
 395.272 + 
 395.273 +     s->sectors_per_block = s->block_size/512;
 395.274 +@@ -184,10 +280,10 @@
 395.275 + 
 395.276 +     if (s->current_block != block_num) {
 395.277 +         int ret;
 395.278 +-        uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num];
 395.279 ++        uint32_t bytes = s->offsets[block_num].size;
 395.280 + 
 395.281 +-        ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block,
 395.282 +-                         bytes);
 395.283 ++        ret = bdrv_pread(bs->file, s->offsets[block_num].offset,
 395.284 ++			 s->compressed_block, bytes);
 395.285 +         if (ret != bytes) {
 395.286 +             return -1;
 395.287 +         }
   396.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   396.2 +++ b/qemu-light/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   396.3 @@ -0,0 +1,1 @@
   396.4 +-p0|cloop.u
   397.1 --- a/qemu/receipt	Wed May 09 17:03:28 2018 +0300
   397.2 +++ b/qemu/receipt	Thu May 10 21:12:00 2018 +0300
   397.3 @@ -29,8 +29,6 @@
   397.4  	mkdir -p                       $install/usr/share/qemu/x64/
   397.5  	unzip $SRC/$UEFIZIP OVMF.fd -d $install/usr/share/qemu/x64/
   397.6  
   397.7 -	patch -p0 < $stuff/cloop.u
   397.8 -
   397.9  	TARGET="i386-softmmu, x86_64-softmmu, \
  397.10  	arm-softmmu, ppc-softmmu, mips-softmmu"
  397.11  
   398.1 --- a/qemu/stuff/cloop.u	Wed May 09 17:03:28 2018 +0300
   398.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   398.3 @@ -1,284 +0,0 @@
   398.4 ---- block/cloop.c
   398.5 -+++ block/cloop.c
   398.6 -@@ -29,11 +29,90 @@
   398.7 - /* Maximum compressed block size */
   398.8 - #define MAX_BLOCK_SIZE (64 * 1024 * 1024)
   398.9 - 
  398.10 -+typedef struct cloop_tail {
  398.11 -+	uint32_t table_size;
  398.12 -+	uint32_t index_size;
  398.13 -+	uint32_t num_blocks;
  398.14 -+} cloop_tail;
  398.15 -+
  398.16 -+typedef struct block_info {
  398.17 -+	uint64_t offset;	/* 64-bit offsets of compressed block */
  398.18 -+	uint32_t size;		/* 32-bit compressed block size */
  398.19 -+	uint32_t optidx;	/* 32-bit index number */
  398.20 -+} block_info;
  398.21 -+
  398.22 -+static inline int build_index(block_info *offsets, unsigned long n)
  398.23 -+{
  398.24 -+	uint32_t *ofs32 = (uint32_t *) offsets;
  398.25 -+	uint64_t *ofs64 = (uint64_t *) offsets;
  398.26 -+	
  398.27 -+	if (ofs32[0] == 0) {
  398.28 -+		if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */
  398.29 -+			while (n--) {
  398.30 -+				offsets[n].offset = be64_to_cpu(offsets[n].offset);
  398.31 -+				offsets[n].size = ntohl(offsets[n].size);
  398.32 -+        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  398.33 -+        				return n+1;
  398.34 -+			}
  398.35 -+		}
  398.36 -+		else { /* V2.0 */
  398.37 -+			uint64_t last = be64_to_cpu(ofs64[n - 1]);
  398.38 -+			while (n--) {
  398.39 -+				offsets[n].size = last - 
  398.40 -+					(offsets[n].offset = be64_to_cpu(ofs64[n])); 
  398.41 -+        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  398.42 -+        				return n+1;
  398.43 -+				last = offsets[n].offset;
  398.44 -+			}
  398.45 -+		}
  398.46 -+	}
  398.47 -+	else if (ofs32[1] == 0) { /* V1.0 */
  398.48 -+		uint64_t last = le64_to_cpu(ofs64[n - 1]);
  398.49 -+		while (n--) {
  398.50 -+			offsets[n].size = last - 
  398.51 -+				(offsets[n].offset = le64_to_cpu(ofs64[n])); 
  398.52 -+        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  398.53 -+        			return n+1;
  398.54 -+			last = offsets[n].offset;
  398.55 -+		}
  398.56 -+	}
  398.57 -+	else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */
  398.58 -+		uint64_t last = ntohl(ofs32[n - 1]);
  398.59 -+		while (n--) {
  398.60 -+			offsets[n].size = last - 
  398.61 -+				(offsets[n].offset = ntohl(ofs32[n])); 
  398.62 -+        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  398.63 -+        			return n+1;
  398.64 -+			last = offsets[n].offset;
  398.65 -+		}
  398.66 -+	}
  398.67 -+	else { /* V3.0 */
  398.68 -+		unsigned long i;
  398.69 -+		uint64_t j;
  398.70 -+		
  398.71 -+		for (i = n; i-- > 0; ) {
  398.72 -+			offsets[i].size = ntohl(ofs32[i]); 
  398.73 -+        		if (offsets[i].size > 2 * MAX_BLOCK_SIZE)
  398.74 -+        			return i+1;
  398.75 -+		}
  398.76 -+		for (i = 0, j = 128 + 4 + 4; i < n; i++) {
  398.77 -+			offsets[i].offset = j;
  398.78 -+			if (offsets[i].size & 0x80000000) {
  398.79 -+				unsigned long k = offsets[i].size & 0x7FFFFFFF;
  398.80 -+				offsets[i].offset = offsets[k].offset;
  398.81 -+				offsets[i].size = offsets[k].size;
  398.82 -+			}
  398.83 -+			else j += offsets[i].size;
  398.84 -+		}
  398.85 -+	}
  398.86 -+	return 0;
  398.87 -+}
  398.88 -+
  398.89 - typedef struct BDRVCloopState {
  398.90 -     CoMutex lock;
  398.91 -     uint32_t block_size;
  398.92 -     uint32_t n_blocks;
  398.93 --    uint64_t *offsets;
  398.94 -+    block_info *offsets;
  398.95 -     uint32_t sectors_per_block;
  398.96 -     uint32_t current_block;
  398.97 -     uint8_t *compressed_block;
  398.98 -@@ -43,17 +117,21 @@
  398.99 - 
 398.100 - static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename)
 398.101 - {
 398.102 --    const char *magic_version_2_0 = "#!/bin/sh\n"
 398.103 --        "#V2.0 Format\n"
 398.104 -+    static const uint8_t magic[] =
 398.105 -         "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n";
 398.106 --    int length = strlen(magic_version_2_0);
 398.107 --    if (length > buf_size) {
 398.108 --        length = buf_size;
 398.109 -+    int i, ret = 0, length = buf_size;
 398.110 -+    uint8_t c;
 398.111 -+
 398.112 -+    if (length > 127) {
 398.113 -+        length = 127;
 398.114 -     }
 398.115 --    if (!memcmp(magic_version_2_0, buf, length)) {
 398.116 --        return 2;
 398.117 -+    for (i = 0; i < length - sizeof(magic) + 1; i++) {
 398.118 -+	if (buf[i] != magic[0]) continue;
 398.119 -+	if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue;
 398.120 -+	ret = 2;
 398.121 -+	break;
 398.122 -     }
 398.123 --    return 0;
 398.124 -+    return ret;
 398.125 - }
 398.126 - 
 398.127 - static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
 398.128 -@@ -91,79 +169,97 @@
 398.129 -                    MAX_BLOCK_SIZE / (1024 * 1024));
 398.130 -         return -EINVAL;
 398.131 -     }
 398.132 --
 398.133 -     ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4);
 398.134 -     if (ret < 0) {
 398.135 -         return ret;
 398.136 -     }
 398.137 -     s->n_blocks = be32_to_cpu(s->n_blocks);
 398.138 - 
 398.139 --    /* read offsets */
 398.140 --    if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) {
 398.141 --        /* Prevent integer overflow */
 398.142 --        error_setg(errp, "n_blocks %u must be %zu or less",
 398.143 --                   s->n_blocks,
 398.144 --                   (UINT32_MAX - 1) / sizeof(uint64_t));
 398.145 --        return -EINVAL;
 398.146 --    }
 398.147 --    offsets_size = (s->n_blocks + 1) * sizeof(uint64_t);
 398.148 --    if (offsets_size > 512 * 1024 * 1024) {
 398.149 --        /* Prevent ridiculous offsets_size which causes memory allocation to
 398.150 --         * fail or overflows bdrv_pread() size.  In practice the 512 MB
 398.151 --         * offsets[] limit supports 16 TB images at 256 KB block size.
 398.152 --         */
 398.153 --        error_setg(errp, "image requires too many offsets, "
 398.154 --                   "try increasing block size");
 398.155 --        return -EINVAL;
 398.156 --    }
 398.157 --    s->offsets = g_malloc(offsets_size);
 398.158 -+    /* initialize zlib engine */
 398.159 -+    max_compressed_block_size =  s->block_size + s->block_size/1000 + 12 + 4;
 398.160 -+    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 398.161 -+    s->uncompressed_block = g_malloc(s->block_size);
 398.162 - 
 398.163 --    ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 398.164 --    if (ret < 0) {
 398.165 -+    if (inflateInit(&s->zstream) != Z_OK) {
 398.166 -+        ret = -EINVAL;
 398.167 -         goto fail;
 398.168 -     }
 398.169 - 
 398.170 --    for (i = 0; i < s->n_blocks + 1; i++) {
 398.171 --        uint64_t size;
 398.172 -+    /* read offsets */
 398.173 -+    if (s->n_blocks + 1 == 0) {
 398.174 -+        cloop_tail tail;
 398.175 -+        int64_t end = bdrv_getlength(bs->file);
 398.176 -+	void *p;
 398.177 -+	uint32_t toclen, len; 
 398.178 - 
 398.179 --        s->offsets[i] = be64_to_cpu(s->offsets[i]);
 398.180 --        if (i == 0) {
 398.181 --            continue;
 398.182 -+        ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail));
 398.183 -+        if (ret < 0) {
 398.184 -+            goto fail;
 398.185 -         }
 398.186 - 
 398.187 --        if (s->offsets[i] < s->offsets[i - 1]) {
 398.188 --            error_setg(errp, "offsets not monotonically increasing at "
 398.189 --                       "index %u, image file is corrupt", i);
 398.190 --            ret = -EINVAL;
 398.191 --            goto fail;
 398.192 -+        s->n_blocks = be32_to_cpu(tail.num_blocks);
 398.193 -+        offsets_size = s->n_blocks * sizeof(block_info);
 398.194 -+        if (offsets_size > 512 * 1024 * 1024) {
 398.195 -+            /* Prevent ridiculous offsets_size which causes memory allocation to
 398.196 -+             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 398.197 -+             * offsets[] limit supports 16 TB images at 256 KB block size.
 398.198 -+             */
 398.199 -+            error_setg(errp, "image requires too many offsets, "
 398.200 -+                       "try increasing block size");
 398.201 -+            return -EINVAL;
 398.202 -         }
 398.203 -+	len = be32_to_cpu(tail.table_size);
 398.204 -+	toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks;
 398.205 - 
 398.206 --        size = s->offsets[i] - s->offsets[i - 1];
 398.207 -+        s->offsets = g_malloc(offsets_size);
 398.208 -+	p = g_malloc(len);
 398.209 - 
 398.210 --        /* Compressed blocks should be smaller than the uncompressed block size
 398.211 --         * but maybe compression performed poorly so the compressed block is
 398.212 --         * actually bigger.  Clamp down on unrealistic values to prevent
 398.213 --         * ridiculous s->compressed_block allocation.
 398.214 --         */
 398.215 --        if (size > 2 * MAX_BLOCK_SIZE) {
 398.216 --            error_setg(errp, "invalid compressed block size at index %u, "
 398.217 --                       "image file is corrupt", i);
 398.218 -+        ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len);
 398.219 -+        if (ret < 0) {
 398.220 -+            goto fail;
 398.221 -+        }
 398.222 -+        s->zstream.next_in = p;
 398.223 -+        s->zstream.avail_in = len;
 398.224 -+        s->zstream.next_out = s->offsets;
 398.225 -+        s->zstream.avail_out = toclen;
 398.226 -+        ret = inflateReset(&s->zstream);
 398.227 -+        if (ret != Z_OK) {
 398.228 -             ret = -EINVAL;
 398.229 -             goto fail;
 398.230 -         }
 398.231 --
 398.232 --        if (size > max_compressed_block_size) {
 398.233 --            max_compressed_block_size = size;
 398.234 -+        ret = inflate(&s->zstream, Z_FINISH);
 398.235 -+        if (ret != Z_STREAM_END || s->zstream.total_out != toclen) {
 398.236 -+            ret = -EINVAL;
 398.237 -+            goto fail;
 398.238 -         }
 398.239 -+	g_free(p);
 398.240 -     }
 398.241 -+    else {
 398.242 -+        offsets_size = s->n_blocks * sizeof(block_info);
 398.243 -+        if (offsets_size > 512 * 1024 * 1024) {
 398.244 -+            /* Prevent ridiculous offsets_size which causes memory allocation to
 398.245 -+             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 398.246 -+             * offsets[] limit supports 16 TB images at 256 KB block size.
 398.247 -+             */
 398.248 -+            error_setg(errp, "image requires too many offsets, "
 398.249 -+                       "try increasing block size");
 398.250 -+            return -EINVAL;
 398.251 -+        }
 398.252 -+        s->offsets = g_malloc(offsets_size);
 398.253 - 
 398.254 --    /* initialize zlib engine */
 398.255 --    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 398.256 --    s->uncompressed_block = g_malloc(s->block_size);
 398.257 --    if (inflateInit(&s->zstream) != Z_OK) {
 398.258 -+        ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 398.259 -+        if (ret < 0) {
 398.260 -+            goto fail;
 398.261 -+        }
 398.262 -+    }
 398.263 -+    ret = build_index(s->offsets, s->n_blocks);
 398.264 -+    if (ret) {
 398.265 -+        error_setg(errp, "invalid compressed block size at index %u, "
 398.266 -+                   "image file is corrupt", ret-1);
 398.267 -         ret = -EINVAL;
 398.268 -         goto fail;
 398.269 -     }
 398.270 -+
 398.271 -     s->current_block = s->n_blocks;
 398.272 - 
 398.273 -     s->sectors_per_block = s->block_size/512;
 398.274 -@@ -184,10 +280,10 @@
 398.275 - 
 398.276 -     if (s->current_block != block_num) {
 398.277 -         int ret;
 398.278 --        uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num];
 398.279 -+        uint32_t bytes = s->offsets[block_num].size;
 398.280 - 
 398.281 --        ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block,
 398.282 --                         bytes);
 398.283 -+        ret = bdrv_pread(bs->file, s->offsets[block_num].offset,
 398.284 -+			 s->compressed_block, bytes);
 398.285 -         if (ret != bytes) {
 398.286 -             return -1;
 398.287 -         }
   399.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   399.2 +++ b/qemu/stuff/patches/cloop.u	Thu May 10 21:12:00 2018 +0300
   399.3 @@ -0,0 +1,284 @@
   399.4 +--- block/cloop.c
   399.5 ++++ block/cloop.c
   399.6 +@@ -29,11 +29,90 @@
   399.7 + /* Maximum compressed block size */
   399.8 + #define MAX_BLOCK_SIZE (64 * 1024 * 1024)
   399.9 + 
  399.10 ++typedef struct cloop_tail {
  399.11 ++	uint32_t table_size;
  399.12 ++	uint32_t index_size;
  399.13 ++	uint32_t num_blocks;
  399.14 ++} cloop_tail;
  399.15 ++
  399.16 ++typedef struct block_info {
  399.17 ++	uint64_t offset;	/* 64-bit offsets of compressed block */
  399.18 ++	uint32_t size;		/* 32-bit compressed block size */
  399.19 ++	uint32_t optidx;	/* 32-bit index number */
  399.20 ++} block_info;
  399.21 ++
  399.22 ++static inline int build_index(block_info *offsets, unsigned long n)
  399.23 ++{
  399.24 ++	uint32_t *ofs32 = (uint32_t *) offsets;
  399.25 ++	uint64_t *ofs64 = (uint64_t *) offsets;
  399.26 ++	
  399.27 ++	if (ofs32[0] == 0) {
  399.28 ++		if (ofs32[2]) { /* ACCELERATED KNOPPIX V1.0 */
  399.29 ++			while (n--) {
  399.30 ++				offsets[n].offset = be64_to_cpu(offsets[n].offset);
  399.31 ++				offsets[n].size = ntohl(offsets[n].size);
  399.32 ++        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  399.33 ++        				return n+1;
  399.34 ++			}
  399.35 ++		}
  399.36 ++		else { /* V2.0 */
  399.37 ++			uint64_t last = be64_to_cpu(ofs64[n - 1]);
  399.38 ++			while (n--) {
  399.39 ++				offsets[n].size = last - 
  399.40 ++					(offsets[n].offset = be64_to_cpu(ofs64[n])); 
  399.41 ++        			if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  399.42 ++        				return n+1;
  399.43 ++				last = offsets[n].offset;
  399.44 ++			}
  399.45 ++		}
  399.46 ++	}
  399.47 ++	else if (ofs32[1] == 0) { /* V1.0 */
  399.48 ++		uint64_t last = le64_to_cpu(ofs64[n - 1]);
  399.49 ++		while (n--) {
  399.50 ++			offsets[n].size = last - 
  399.51 ++				(offsets[n].offset = le64_to_cpu(ofs64[n])); 
  399.52 ++        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  399.53 ++        			return n+1;
  399.54 ++			last = offsets[n].offset;
  399.55 ++		}
  399.56 ++	}
  399.57 ++	else if (ntohl(ofs32[0]) == (4*n) + 0x8C) { /* V0.68 */
  399.58 ++		uint64_t last = ntohl(ofs32[n - 1]);
  399.59 ++		while (n--) {
  399.60 ++			offsets[n].size = last - 
  399.61 ++				(offsets[n].offset = ntohl(ofs32[n])); 
  399.62 ++        		if (offsets[n].size > 2 * MAX_BLOCK_SIZE)
  399.63 ++        			return n+1;
  399.64 ++			last = offsets[n].offset;
  399.65 ++		}
  399.66 ++	}
  399.67 ++	else { /* V3.0 */
  399.68 ++		unsigned long i;
  399.69 ++		uint64_t j;
  399.70 ++		
  399.71 ++		for (i = n; i-- > 0; ) {
  399.72 ++			offsets[i].size = ntohl(ofs32[i]); 
  399.73 ++        		if (offsets[i].size > 2 * MAX_BLOCK_SIZE)
  399.74 ++        			return i+1;
  399.75 ++		}
  399.76 ++		for (i = 0, j = 128 + 4 + 4; i < n; i++) {
  399.77 ++			offsets[i].offset = j;
  399.78 ++			if (offsets[i].size & 0x80000000) {
  399.79 ++				unsigned long k = offsets[i].size & 0x7FFFFFFF;
  399.80 ++				offsets[i].offset = offsets[k].offset;
  399.81 ++				offsets[i].size = offsets[k].size;
  399.82 ++			}
  399.83 ++			else j += offsets[i].size;
  399.84 ++		}
  399.85 ++	}
  399.86 ++	return 0;
  399.87 ++}
  399.88 ++
  399.89 + typedef struct BDRVCloopState {
  399.90 +     CoMutex lock;
  399.91 +     uint32_t block_size;
  399.92 +     uint32_t n_blocks;
  399.93 +-    uint64_t *offsets;
  399.94 ++    block_info *offsets;
  399.95 +     uint32_t sectors_per_block;
  399.96 +     uint32_t current_block;
  399.97 +     uint8_t *compressed_block;
  399.98 +@@ -43,17 +117,21 @@
  399.99 + 
 399.100 + static int cloop_probe(const uint8_t *buf, int buf_size, const char *filename)
 399.101 + {
 399.102 +-    const char *magic_version_2_0 = "#!/bin/sh\n"
 399.103 +-        "#V2.0 Format\n"
 399.104 ++    static const uint8_t magic[] =
 399.105 +         "modprobe cloop file=$0 && mount -r -t iso9660 /dev/cloop $1\n";
 399.106 +-    int length = strlen(magic_version_2_0);
 399.107 +-    if (length > buf_size) {
 399.108 +-        length = buf_size;
 399.109 ++    int i, ret = 0, length = buf_size;
 399.110 ++    uint8_t c;
 399.111 ++
 399.112 ++    if (length > 127) {
 399.113 ++        length = 127;
 399.114 +     }
 399.115 +-    if (!memcmp(magic_version_2_0, buf, length)) {
 399.116 +-        return 2;
 399.117 ++    for (i = 0; i < length - sizeof(magic) + 1; i++) {
 399.118 ++	if (buf[i] != magic[0]) continue;
 399.119 ++	if (strncmp(buf + i, magic, sizeof(magic) - 1)) continue;
 399.120 ++	ret = 2;
 399.121 ++	break;
 399.122 +     }
 399.123 +-    return 0;
 399.124 ++    return ret;
 399.125 + }
 399.126 + 
 399.127 + static int cloop_open(BlockDriverState *bs, QDict *options, int flags,
 399.128 +@@ -91,79 +169,97 @@
 399.129 +                    MAX_BLOCK_SIZE / (1024 * 1024));
 399.130 +         return -EINVAL;
 399.131 +     }
 399.132 +-
 399.133 +     ret = bdrv_pread(bs->file, 128 + 4, &s->n_blocks, 4);
 399.134 +     if (ret < 0) {
 399.135 +         return ret;
 399.136 +     }
 399.137 +     s->n_blocks = be32_to_cpu(s->n_blocks);
 399.138 + 
 399.139 +-    /* read offsets */
 399.140 +-    if (s->n_blocks > (UINT32_MAX - 1) / sizeof(uint64_t)) {
 399.141 +-        /* Prevent integer overflow */
 399.142 +-        error_setg(errp, "n_blocks %u must be %zu or less",
 399.143 +-                   s->n_blocks,
 399.144 +-                   (UINT32_MAX - 1) / sizeof(uint64_t));
 399.145 +-        return -EINVAL;
 399.146 +-    }
 399.147 +-    offsets_size = (s->n_blocks + 1) * sizeof(uint64_t);
 399.148 +-    if (offsets_size > 512 * 1024 * 1024) {
 399.149 +-        /* Prevent ridiculous offsets_size which causes memory allocation to
 399.150 +-         * fail or overflows bdrv_pread() size.  In practice the 512 MB
 399.151 +-         * offsets[] limit supports 16 TB images at 256 KB block size.
 399.152 +-         */
 399.153 +-        error_setg(errp, "image requires too many offsets, "
 399.154 +-                   "try increasing block size");
 399.155 +-        return -EINVAL;
 399.156 +-    }
 399.157 +-    s->offsets = g_malloc(offsets_size);
 399.158 ++    /* initialize zlib engine */
 399.159 ++    max_compressed_block_size =  s->block_size + s->block_size/1000 + 12 + 4;
 399.160 ++    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 399.161 ++    s->uncompressed_block = g_malloc(s->block_size);
 399.162 + 
 399.163 +-    ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 399.164 +-    if (ret < 0) {
 399.165 ++    if (inflateInit(&s->zstream) != Z_OK) {
 399.166 ++        ret = -EINVAL;
 399.167 +         goto fail;
 399.168 +     }
 399.169 + 
 399.170 +-    for (i = 0; i < s->n_blocks + 1; i++) {
 399.171 +-        uint64_t size;
 399.172 ++    /* read offsets */
 399.173 ++    if (s->n_blocks + 1 == 0) {
 399.174 ++        cloop_tail tail;
 399.175 ++        int64_t end = bdrv_getlength(bs->file);
 399.176 ++	void *p;
 399.177 ++	uint32_t toclen, len; 
 399.178 + 
 399.179 +-        s->offsets[i] = be64_to_cpu(s->offsets[i]);
 399.180 +-        if (i == 0) {
 399.181 +-            continue;
 399.182 ++        ret = bdrv_pread(bs->file, end - sizeof(tail), &tail, sizeof(tail));
 399.183 ++        if (ret < 0) {
 399.184 ++            goto fail;
 399.185 +         }
 399.186 + 
 399.187 +-        if (s->offsets[i] < s->offsets[i - 1]) {
 399.188 +-            error_setg(errp, "offsets not monotonically increasing at "
 399.189 +-                       "index %u, image file is corrupt", i);
 399.190 +-            ret = -EINVAL;
 399.191 +-            goto fail;
 399.192 ++        s->n_blocks = be32_to_cpu(tail.num_blocks);
 399.193 ++        offsets_size = s->n_blocks * sizeof(block_info);
 399.194 ++        if (offsets_size > 512 * 1024 * 1024) {
 399.195 ++            /* Prevent ridiculous offsets_size which causes memory allocation to
 399.196 ++             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 399.197 ++             * offsets[] limit supports 16 TB images at 256 KB block size.
 399.198 ++             */
 399.199 ++            error_setg(errp, "image requires too many offsets, "
 399.200 ++                       "try increasing block size");
 399.201 ++            return -EINVAL;
 399.202 +         }
 399.203 ++	len = be32_to_cpu(tail.table_size);
 399.204 ++	toclen = (be32_to_cpu(tail.index_size) & 255) * s->n_blocks;
 399.205 + 
 399.206 +-        size = s->offsets[i] - s->offsets[i - 1];
 399.207 ++        s->offsets = g_malloc(offsets_size);
 399.208 ++	p = g_malloc(len);
 399.209 + 
 399.210 +-        /* Compressed blocks should be smaller than the uncompressed block size
 399.211 +-         * but maybe compression performed poorly so the compressed block is
 399.212 +-         * actually bigger.  Clamp down on unrealistic values to prevent
 399.213 +-         * ridiculous s->compressed_block allocation.
 399.214 +-         */
 399.215 +-        if (size > 2 * MAX_BLOCK_SIZE) {
 399.216 +-            error_setg(errp, "invalid compressed block size at index %u, "
 399.217 +-                       "image file is corrupt", i);
 399.218 ++        ret = bdrv_pread(bs->file, end - sizeof(tail) - len, p, len);
 399.219 ++        if (ret < 0) {
 399.220 ++            goto fail;
 399.221 ++        }
 399.222 ++        s->zstream.next_in = p;
 399.223 ++        s->zstream.avail_in = len;
 399.224 ++        s->zstream.next_out = s->offsets;
 399.225 ++        s->zstream.avail_out = toclen;
 399.226 ++        ret = inflateReset(&s->zstream);
 399.227 ++        if (ret != Z_OK) {
 399.228 +             ret = -EINVAL;
 399.229 +             goto fail;
 399.230 +         }
 399.231 +-
 399.232 +-        if (size > max_compressed_block_size) {
 399.233 +-            max_compressed_block_size = size;
 399.234 ++        ret = inflate(&s->zstream, Z_FINISH);
 399.235 ++        if (ret != Z_STREAM_END || s->zstream.total_out != toclen) {
 399.236 ++            ret = -EINVAL;
 399.237 ++            goto fail;
 399.238 +         }
 399.239 ++	g_free(p);
 399.240 +     }
 399.241 ++    else {
 399.242 ++        offsets_size = s->n_blocks * sizeof(block_info);
 399.243 ++        if (offsets_size > 512 * 1024 * 1024) {
 399.244 ++            /* Prevent ridiculous offsets_size which causes memory allocation to
 399.245 ++             * fail or overflows bdrv_pread() size.  In practice the 512 MB
 399.246 ++             * offsets[] limit supports 16 TB images at 256 KB block size.
 399.247 ++             */
 399.248 ++            error_setg(errp, "image requires too many offsets, "
 399.249 ++                       "try increasing block size");
 399.250 ++            return -EINVAL;
 399.251 ++        }
 399.252 ++        s->offsets = g_malloc(offsets_size);
 399.253 + 
 399.254 +-    /* initialize zlib engine */
 399.255 +-    s->compressed_block = g_malloc(max_compressed_block_size + 1);
 399.256 +-    s->uncompressed_block = g_malloc(s->block_size);
 399.257 +-    if (inflateInit(&s->zstream) != Z_OK) {
 399.258 ++        ret = bdrv_pread(bs->file, 128 + 4 + 4, s->offsets, offsets_size);
 399.259 ++        if (ret < 0) {
 399.260 ++            goto fail;
 399.261 ++        }
 399.262 ++    }
 399.263 ++    ret = build_index(s->offsets, s->n_blocks);
 399.264 ++    if (ret) {
 399.265 ++        error_setg(errp, "invalid compressed block size at index %u, "
 399.266 ++                   "image file is corrupt", ret-1);
 399.267 +         ret = -EINVAL;
 399.268 +         goto fail;
 399.269 +     }
 399.270 ++
 399.271 +     s->current_block = s->n_blocks;
 399.272 + 
 399.273 +     s->sectors_per_block = s->block_size/512;
 399.274 +@@ -184,10 +280,10 @@
 399.275 + 
 399.276 +     if (s->current_block != block_num) {
 399.277 +         int ret;
 399.278 +-        uint32_t bytes = s->offsets[block_num + 1] - s->offsets[block_num];
 399.279 ++        uint32_t bytes = s->offsets[block_num].size;
 399.280 + 
 399.281 +-        ret = bdrv_pread(bs->file, s->offsets[block_num], s->compressed_block,
 399.282 +-                         bytes);
 399.283 ++        ret = bdrv_pread(bs->file, s->offsets[block_num].offset,
 399.284 ++			 s->compressed_block, bytes);
 399.285 +         if (ret != bytes) {
 399.286 +             return -1;
 399.287 +         }
   400.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   400.2 +++ b/qemu/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   400.3 @@ -0,0 +1,1 @@
   400.4 +-p0|cloop.u
   401.1 --- a/qtpanel/receipt	Wed May 09 17:03:28 2018 +0300
   401.2 +++ b/qtpanel/receipt	Thu May 10 21:12:00 2018 +0300
   401.3 @@ -17,7 +17,7 @@
   401.4  # Rules to configure and make the package.
   401.5  compile_rules()
   401.6  {
   401.7 -	patch -i $stuff/p.diff --merge		#sed -i 's|ddd ddMMM hh:mm||' clockapplet.cpp
   401.8 +	#sed -i 's|ddd ddMMM hh:mm||' clockapplet.cpp
   401.9  	mkdir b; cd b
  401.10  	cmake -DCMAKE_BUILD_TYPE=MinSizeRel ..;	make
  401.11  	mkdir -p $install/usr/bin
   402.1 --- a/qtpanel/stuff/p.diff	Wed May 09 17:03:28 2018 +0300
   402.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   402.3 @@ -1,71 +0,0 @@
   402.4 ---- orig/applicationsmenuapplet.cpp
   402.5 -+++ edit/applicationsmenuapplet.cpp
   402.6 -@@ -96 +96 @@
   402.7 --	return QSize(m_textItem->boundingRect().size().width() + 16, m_textItem->boundingRect().size().height());
   402.8 -+	return QSize(m_textItem->boundingRect().size().width() + 8, m_textItem->boundingRect().size().height());
   402.9 ---- orig/clockapplet.cpp
  402.10 -+++ edit/clockapplet.cpp
  402.11 -@@ -42 +42 @@
  402.12 --	m_text = dateTimeNow.toString();
  402.13 -+	m_text = dateTimeNow.toString("ddd ddMMM hh:mm");
  402.14 -@@ -50 +50 @@
  402.15 --	return QSize(m_textItem->boundingRect().width() + 16, m_textItem->boundingRect().height() + 16);
  402.16 -+	return QSize(m_textItem->boundingRect().width() + 2, m_textItem->boundingRect().height() + 16);
  402.17 ---- orig/dockapplet.cpp
  402.18 -+++ edit/dockapplet.cpp
  402.19 -@@ -8,0 +9 @@
  402.20 -+#include <QtGui/QWheelEvent>
  402.21 -@@ -56 +57 @@
  402.22 --	QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(36));
  402.23 -+	QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(25));
  402.24 -@@ -60,2 +61,2 @@
  402.25 --	m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(16)));
  402.26 --	m_iconItem->setPos(adjustHardcodedPixelSize(8), m_targetSize.height()/2 - adjustHardcodedPixelSize(8));
  402.27 -+	m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(22)));
  402.28 -+	m_iconItem->setPos(adjustHardcodedPixelSize(4), m_targetSize.height()/8 + adjustHardcodedPixelSize(2));
  402.29 -@@ -162 +163 @@
  402.30 --	return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height() - 1);
  402.31 -+	return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height());
  402.32 -@@ -244,0 +246,24 @@
  402.33 -+		}
  402.34 -+	}
  402.35 -+}
  402.36 -+
  402.37 -+void DockItem::wheelEvent(QGraphicsSceneWheelEvent *event)
  402.38 -+{
  402.39 -+	int numDegrees = event->delta() / 8;
  402.40 -+	int numSteps = numDegrees / 15;
  402.41 -+
  402.42 -+	// Ignore accidental scroll events if currently dragging.
  402.43 -+	if(m_dragging)
  402.44 -+		return;
  402.45 -+
  402.46 -+	if (event->orientation() == Qt::Horizontal) { // Horizontal: switch between tasks
  402.47 -+		// scrollHorizontally(numSteps);
  402.48 -+	} else { // Vertical scroll: (un)roll the hovered task
  402.49 -+		if( numSteps > 0 )
  402.50 -+		{
  402.51 -+			X11Support::activateWindow(m_clients[0]->handle());
  402.52 -+		}
  402.53 -+		else
  402.54 -+		{
  402.55 -+			if(m_dockApplet->activeWindow() == m_clients[0]->handle())
  402.56 -+				X11Support::minimizeWindow(m_clients[0]->handle());
  402.57 ---- orig/dockapplet.h
  402.58 -+++ edit/dockapplet.h
  402.59 -@@ -7,0 +8 @@
  402.60 -+#include <QtGui/QWheelEvent>
  402.61 -@@ -49,0 +51 @@
  402.62 -+	void wheelEvent(QGraphicsSceneWheelEvent *event);
  402.63 ---- orig/dpisupport.cpp
  402.64 -+++ edit/dpisupport.cpp
  402.65 -@@ -9 +9 @@
  402.66 --    return size*dpi/96;
  402.67 -+    return size*dpi/125;
  402.68 ---- orig/panelapplication.cpp
  402.69 -+++ edit/panelapplication.cpp
  402.70 -@@ -73,2 +73,2 @@
  402.71 --	setFontName(settings.value("fontName", "default").toString());
  402.72 --	setIconThemeName(settings.value("iconThemeName", "default").toString());
  402.73 -+	setFontName(settings.value("fontName", "Fixed 8").toString());
  402.74 -+	setIconThemeName(settings.value("iconThemeName", "SliTaz").toString());
   403.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   403.2 +++ b/qtpanel/stuff/patches/p.diff	Thu May 10 21:12:00 2018 +0300
   403.3 @@ -0,0 +1,71 @@
   403.4 +--- orig/applicationsmenuapplet.cpp
   403.5 ++++ edit/applicationsmenuapplet.cpp
   403.6 +@@ -96 +96 @@
   403.7 +-	return QSize(m_textItem->boundingRect().size().width() + 16, m_textItem->boundingRect().size().height());
   403.8 ++	return QSize(m_textItem->boundingRect().size().width() + 8, m_textItem->boundingRect().size().height());
   403.9 +--- orig/clockapplet.cpp
  403.10 ++++ edit/clockapplet.cpp
  403.11 +@@ -42 +42 @@
  403.12 +-	m_text = dateTimeNow.toString();
  403.13 ++	m_text = dateTimeNow.toString("ddd ddMMM hh:mm");
  403.14 +@@ -50 +50 @@
  403.15 +-	return QSize(m_textItem->boundingRect().width() + 16, m_textItem->boundingRect().height() + 16);
  403.16 ++	return QSize(m_textItem->boundingRect().width() + 2, m_textItem->boundingRect().height() + 16);
  403.17 +--- orig/dockapplet.cpp
  403.18 ++++ edit/dockapplet.cpp
  403.19 +@@ -8,0 +9 @@
  403.20 ++#include <QtGui/QWheelEvent>
  403.21 +@@ -56 +57 @@
  403.22 +-	QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(36));
  403.23 ++	QString shortName = fontMetrics.elidedText(m_clients[0]->name(), Qt::ElideRight, m_targetSize.width() - adjustHardcodedPixelSize(25));
  403.24 +@@ -60,2 +61,2 @@
  403.25 +-	m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(16)));
  403.26 +-	m_iconItem->setPos(adjustHardcodedPixelSize(8), m_targetSize.height()/2 - adjustHardcodedPixelSize(8));
  403.27 ++	m_iconItem->setPixmap(m_clients[0]->icon().pixmap(adjustHardcodedPixelSize(22)));
  403.28 ++	m_iconItem->setPos(adjustHardcodedPixelSize(4), m_targetSize.height()/8 + adjustHardcodedPixelSize(2));
  403.29 +@@ -162 +163 @@
  403.30 +-	return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height() - 1);
  403.31 ++	return QRectF(0.0, 0.0, m_size.width() - 1, m_size.height());
  403.32 +@@ -244,0 +246,24 @@
  403.33 ++		}
  403.34 ++	}
  403.35 ++}
  403.36 ++
  403.37 ++void DockItem::wheelEvent(QGraphicsSceneWheelEvent *event)
  403.38 ++{
  403.39 ++	int numDegrees = event->delta() / 8;
  403.40 ++	int numSteps = numDegrees / 15;
  403.41 ++
  403.42 ++	// Ignore accidental scroll events if currently dragging.
  403.43 ++	if(m_dragging)
  403.44 ++		return;
  403.45 ++
  403.46 ++	if (event->orientation() == Qt::Horizontal) { // Horizontal: switch between tasks
  403.47 ++		// scrollHorizontally(numSteps);
  403.48 ++	} else { // Vertical scroll: (un)roll the hovered task
  403.49 ++		if( numSteps > 0 )
  403.50 ++		{
  403.51 ++			X11Support::activateWindow(m_clients[0]->handle());
  403.52 ++		}
  403.53 ++		else
  403.54 ++		{
  403.55 ++			if(m_dockApplet->activeWindow() == m_clients[0]->handle())
  403.56 ++				X11Support::minimizeWindow(m_clients[0]->handle());
  403.57 +--- orig/dockapplet.h
  403.58 ++++ edit/dockapplet.h
  403.59 +@@ -7,0 +8 @@
  403.60 ++#include <QtGui/QWheelEvent>
  403.61 +@@ -49,0 +51 @@
  403.62 ++	void wheelEvent(QGraphicsSceneWheelEvent *event);
  403.63 +--- orig/dpisupport.cpp
  403.64 ++++ edit/dpisupport.cpp
  403.65 +@@ -9 +9 @@
  403.66 +-    return size*dpi/96;
  403.67 ++    return size*dpi/125;
  403.68 +--- orig/panelapplication.cpp
  403.69 ++++ edit/panelapplication.cpp
  403.70 +@@ -73,2 +73,2 @@
  403.71 +-	setFontName(settings.value("fontName", "default").toString());
  403.72 +-	setIconThemeName(settings.value("iconThemeName", "default").toString());
  403.73 ++	setFontName(settings.value("fontName", "Fixed 8").toString());
  403.74 ++	setIconThemeName(settings.value("iconThemeName", "SliTaz").toString());
   404.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   404.2 +++ b/qtpanel/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   404.3 @@ -0,0 +1,1 @@
   404.4 +--merge|p.diff
   405.1 --- a/rawstudio/receipt	Wed May 09 17:03:28 2018 +0300
   405.2 +++ b/rawstudio/receipt	Thu May 10 21:12:00 2018 +0300
   405.3 @@ -19,7 +19,7 @@
   405.4  	export CXXFLAGS="-Wno-narrowing"
   405.5  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lX11"
   405.6  	export PKG_CONFIG_PATH="/usr/lib/pkgconfig"
   405.7 -	patch -p1 -i $stuff/rawstudio-const.patch
   405.8 +
   405.9  	./configure \
  405.10  		--prefix=/usr \
  405.11  		--infodir=/usr/share/info \
   406.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   406.2 +++ b/rawstudio/stuff/patches/rawstudio-const.patch	Thu May 10 21:12:00 2018 +0300
   406.3 @@ -0,0 +1,12 @@
   406.4 +diff -Nur rawstudio-1.2.orig/src/dcraw.cc rawstudio-1.2/src/dcraw.cc
   406.5 +--- rawstudio-1.2.orig/src/dcraw.cc	2009-04-10 00:21:45.000000000 +0300
   406.6 ++++ rawstudio-1.2/src/dcraw.cc	2009-07-16 00:05:28.169155134 +0300
   406.7 +@@ -8510,7 +8510,7 @@
   406.8 +   argv[argc] = "";
   406.9 +   for (arg=1; (((opm = argv[arg][0]) - 2) | 2) == '+'; ) {
  406.10 +     opt = argv[arg++][1];
  406.11 +-    if ((cp = strchr (sp="nbrkStqmHACg", opt)))
  406.12 ++    if ((cp = (char *)strchr (sp="nbrkStqmHACg", opt)))
  406.13 +       for (i=0; i < "114111111422"[cp-sp]-'0'; i++)
  406.14 + 	if (!isdigit(argv[arg+i][0])) {
  406.15 + 	  dcraw_message (DCRAW_ERROR,_("Non-numeric argument to \"-%c\"\n"), opt);
   407.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   407.2 +++ b/rawstudio/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   407.3 @@ -0,0 +1,1 @@
   407.4 +-p1|rawstudio-const.patch
   408.1 --- a/rawstudio/stuff/rawstudio-const.patch	Wed May 09 17:03:28 2018 +0300
   408.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   408.3 @@ -1,12 +0,0 @@
   408.4 -diff -Nur rawstudio-1.2.orig/src/dcraw.cc rawstudio-1.2/src/dcraw.cc
   408.5 ---- rawstudio-1.2.orig/src/dcraw.cc	2009-04-10 00:21:45.000000000 +0300
   408.6 -+++ rawstudio-1.2/src/dcraw.cc	2009-07-16 00:05:28.169155134 +0300
   408.7 -@@ -8510,7 +8510,7 @@
   408.8 -   argv[argc] = "";
   408.9 -   for (arg=1; (((opm = argv[arg][0]) - 2) | 2) == '+'; ) {
  408.10 -     opt = argv[arg++][1];
  408.11 --    if ((cp = strchr (sp="nbrkStqmHACg", opt)))
  408.12 -+    if ((cp = (char *)strchr (sp="nbrkStqmHACg", opt)))
  408.13 -       for (i=0; i < "114111111422"[cp-sp]-'0'; i++)
  408.14 - 	if (!isdigit(argv[arg+i][0])) {
  408.15 - 	  dcraw_message (DCRAW_ERROR,_("Non-numeric argument to \"-%c\"\n"), opt);
   409.1 --- a/retawq/receipt	Wed May 09 17:03:28 2018 +0300
   409.2 +++ b/retawq/receipt	Thu May 10 21:12:00 2018 +0300
   409.3 @@ -22,7 +22,6 @@
   409.4  		arm)  opts="" ;;
   409.5  		i?86) opts="--enable-i18n" ;;
   409.6  	esac
   409.7 -	patch -p1 -i $stuff/retawq.patch
   409.8  
   409.9  	./configure \
  409.10  		--enable-local-cgi \
   410.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   410.2 +++ b/retawq/stuff/patches/retawq.patch	Thu May 10 21:12:00 2018 +0300
   410.3 @@ -0,0 +1,18 @@
   410.4 +--- a/configure
   410.5 ++++ b/configure
   410.6 +@@ -1660,13 +1660,13 @@
   410.7 +   initial_path="\$4"
   410.8 +   files="\$5"
   410.9 +   act="\${ITCHCONFIG_ACT-}"
  410.10 +-  ic_makedir="\${MKDIRPROG-mkdir}"
  410.11 ++  ic_makedir="mkdir -p"
  410.12 +   ic_program_prefix="$ic_program_prefix"
  410.13 +   ic_program_suffix="$ic_program_suffix"
  410.14 +   checked_path=
  410.15 +   for one_file in \$files
  410.16 +   do
  410.17 +-    path="\$initial_path"
  410.18 ++    path="\$DESTDIR\$initial_path"
  410.19 +     file=\`echo "\$one_file" | sed 's,.*[/],,'\`
  410.20 +     case \$magic in
  410.21 +     m0) ;;
   411.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   411.2 +++ b/retawq/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   411.3 @@ -0,0 +1,1 @@
   411.4 +-p1|retawq.patch
   412.1 --- a/retawq/stuff/retawq.patch	Wed May 09 17:03:28 2018 +0300
   412.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   412.3 @@ -1,18 +0,0 @@
   412.4 ---- a/configure
   412.5 -+++ b/configure
   412.6 -@@ -1660,13 +1660,13 @@
   412.7 -   initial_path="\$4"
   412.8 -   files="\$5"
   412.9 -   act="\${ITCHCONFIG_ACT-}"
  412.10 --  ic_makedir="\${MKDIRPROG-mkdir}"
  412.11 -+  ic_makedir="mkdir -p"
  412.12 -   ic_program_prefix="$ic_program_prefix"
  412.13 -   ic_program_suffix="$ic_program_suffix"
  412.14 -   checked_path=
  412.15 -   for one_file in \$files
  412.16 -   do
  412.17 --    path="\$initial_path"
  412.18 -+    path="\$DESTDIR\$initial_path"
  412.19 -     file=\`echo "\$one_file" | sed 's,.*[/],,'\`
  412.20 -     case \$magic in
  412.21 -     m0) ;;
   413.1 --- a/rhythmcat2/receipt	Wed May 09 17:03:28 2018 +0300
   413.2 +++ b/rhythmcat2/receipt	Thu May 10 21:12:00 2018 +0300
   413.3 @@ -16,7 +16,6 @@
   413.4  intltool"
   413.5  
   413.6  compile_rules() {
   413.7 -	patch -p1 -i $stuff/rhythmcat2.patch
   413.8  	cp $stuff/ru.po $src/po
   413.9  
  413.10  	./configure \
   414.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   414.2 +++ b/rhythmcat2/stuff/patches/rhythmcat2.patch	Thu May 10 21:12:00 2018 +0300
   414.3 @@ -0,0 +1,57 @@
   414.4 +--- a/docs/reference/lib/Makefile.in
   414.5 ++++ b/docs/reference/lib/Makefile.in
   414.6 +@@ -713,8 +713,6 @@
   414.7 + 	  if test -n "$(DOC_MODULE_VERSION)"; then \
   414.8 + 	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
   414.9 + 	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
  414.10 +-	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
  414.11 +-	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
  414.12 + 	  fi; \
  414.13 + 	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
  414.14 + 	fi
  414.15 +
  414.16 +--- a/docs/reference/ui/Makefile.in
  414.17 ++++ b/docs/reference/ui/Makefile.in
  414.18 +@@ -724,8 +724,6 @@
  414.19 + @WITH_GTK_UI_TRUE@	  if test -n "$(DOC_MODULE_VERSION)"; then \
  414.20 + @WITH_GTK_UI_TRUE@	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
  414.21 + @WITH_GTK_UI_TRUE@	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
  414.22 +-@WITH_GTK_UI_TRUE@	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
  414.23 +-@WITH_GTK_UI_TRUE@	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
  414.24 + @WITH_GTK_UI_TRUE@	  fi; \
  414.25 + @WITH_GTK_UI_TRUE@	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
  414.26 + @WITH_GTK_UI_TRUE@	fi
  414.27 +
  414.28 +--- a/po/LINGUAS
  414.29 ++++ b/po/LINGUAS
  414.30 +@@ -1,3 +1,4 @@
  414.31 ++ru
  414.32 + zh_CN
  414.33 + zh_HK
  414.34 + zh_TW
  414.35 +
  414.36 +--- a/data/RhythmCat2.desktop
  414.37 ++++ b/data/RhythmCat2.desktop
  414.38 +@@ -8,7 +8,7 @@
  414.39 + Exec=RhythmCat2 %U
  414.40 + StartupNotify=false
  414.41 + Type=Application
  414.42 +-Name[en_US]=RhythmCat2 Music Player
  414.43 +-Name[zh_CN]=RhythmCat2 音乐播放器
  414.44 +-Name[zh_TW]=RhythmCat2 音樂播放器
  414.45 ++Comment[ru]=Музыкальный проигрыватель RhythmCat2
  414.46 ++Comment[zh_CN]=RhythmCat2 音乐播放器
  414.47 ++Comment[zh_TW]=RhythmCat2 音樂播放器
  414.48 + MimeType=application/x-ogg;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;audio/x-flac;
  414.49 +
  414.50 +--- a/ui/rc-ui-plugin.c
  414.51 ++++ b/ui/rc-ui-plugin.c
  414.52 +@@ -155,7 +155,7 @@
  414.53 +     g_object_set(about_dialog, "program-name", plugin_data->info->name,
  414.54 +         "authors", authors, "comments", plugin_data->info->description,
  414.55 +         "website", plugin_data->info->homepage, "version",
  414.56 +-        plugin_data->info->version, NULL);
  414.57 ++        plugin_data->info->version, "logo", rc_ui_player_get_icon_image(), NULL);
  414.58 +     gtk_dialog_run(GTK_DIALOG(about_dialog));
  414.59 +     gtk_widget_destroy(about_dialog);
  414.60 + }
   415.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   415.2 +++ b/rhythmcat2/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   415.3 @@ -0,0 +1,1 @@
   415.4 +-p1|rhythmcat2.patch
   416.1 --- a/rhythmcat2/stuff/rhythmcat2.patch	Wed May 09 17:03:28 2018 +0300
   416.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   416.3 @@ -1,57 +0,0 @@
   416.4 ---- a/docs/reference/lib/Makefile.in
   416.5 -+++ b/docs/reference/lib/Makefile.in
   416.6 -@@ -713,8 +713,6 @@
   416.7 - 	  if test -n "$(DOC_MODULE_VERSION)"; then \
   416.8 - 	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
   416.9 - 	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
  416.10 --	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
  416.11 --	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
  416.12 - 	  fi; \
  416.13 - 	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
  416.14 - 	fi
  416.15 -
  416.16 ---- a/docs/reference/ui/Makefile.in
  416.17 -+++ b/docs/reference/ui/Makefile.in
  416.18 -@@ -724,8 +724,6 @@
  416.19 - @WITH_GTK_UI_TRUE@	  if test -n "$(DOC_MODULE_VERSION)"; then \
  416.20 - @WITH_GTK_UI_TRUE@	    mv -f $${installdir}/$(DOC_MODULE).devhelp2 \
  416.21 - @WITH_GTK_UI_TRUE@	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp2; \
  416.22 --@WITH_GTK_UI_TRUE@	    mv -f $${installdir}/$(DOC_MODULE).devhelp \
  416.23 --@WITH_GTK_UI_TRUE@	      $${installdir}/$(DOC_MODULE)-$(DOC_MODULE_VERSION).devhelp; \
  416.24 - @WITH_GTK_UI_TRUE@	  fi; \
  416.25 - @WITH_GTK_UI_TRUE@	  $(GTKDOC_REBASE) --relative --dest-dir=$(DESTDIR) --html-dir=$${installdir}; \
  416.26 - @WITH_GTK_UI_TRUE@	fi
  416.27 -
  416.28 ---- a/po/LINGUAS
  416.29 -+++ b/po/LINGUAS
  416.30 -@@ -1,3 +1,4 @@
  416.31 -+ru
  416.32 - zh_CN
  416.33 - zh_HK
  416.34 - zh_TW
  416.35 -
  416.36 ---- a/data/RhythmCat2.desktop
  416.37 -+++ b/data/RhythmCat2.desktop
  416.38 -@@ -8,7 +8,7 @@
  416.39 - Exec=RhythmCat2 %U
  416.40 - StartupNotify=false
  416.41 - Type=Application
  416.42 --Name[en_US]=RhythmCat2 Music Player
  416.43 --Name[zh_CN]=RhythmCat2 音乐播放器
  416.44 --Name[zh_TW]=RhythmCat2 音樂播放器
  416.45 -+Comment[ru]=Музыкальный проигрыватель RhythmCat2
  416.46 -+Comment[zh_CN]=RhythmCat2 音乐播放器
  416.47 -+Comment[zh_TW]=RhythmCat2 音樂播放器
  416.48 - MimeType=application/x-ogg;application/ogg;audio/x-vorbis+ogg;audio/x-scpls;audio/x-mp3;audio/x-mpeg;audio/mpeg;audio/x-mpegurl;audio/x-flac;
  416.49 -
  416.50 ---- a/ui/rc-ui-plugin.c
  416.51 -+++ b/ui/rc-ui-plugin.c
  416.52 -@@ -155,7 +155,7 @@
  416.53 -     g_object_set(about_dialog, "program-name", plugin_data->info->name,
  416.54 -         "authors", authors, "comments", plugin_data->info->description,
  416.55 -         "website", plugin_data->info->homepage, "version",
  416.56 --        plugin_data->info->version, NULL);
  416.57 -+        plugin_data->info->version, "logo", rc_ui_player_get_icon_image(), NULL);
  416.58 -     gtk_dialog_run(GTK_DIALOG(about_dialog));
  416.59 -     gtk_widget_destroy(about_dialog);
  416.60 - }
   417.1 --- a/rox-filer/receipt	Wed May 09 17:03:28 2018 +0300
   417.2 +++ b/rox-filer/receipt	Thu May 10 21:12:00 2018 +0300
   417.3 @@ -19,10 +19,6 @@
   417.4  compile_rules()
   417.5  {
   417.6  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries -lm"
   417.7 -	echo "patch"
   417.8 -	[ -f done.menu.diff ] ||
   417.9 -		patch $src/ROX-Filer/src/menu.c $stuff/menu.diff
  417.10 -	touch done.menu.diff
  417.11  	echo "compile"
  417.12  	# If missing dep compile will block on a read.
  417.13  	echo -e "\t" | $src/ROX-Filer/AppRun --compile
   418.1 --- a/rox-filer/stuff/menu.diff	Wed May 09 17:03:28 2018 +0300
   418.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   418.3 @@ -1,85 +0,0 @@
   418.4 ---- menu.c	Sat May 17 16:40:24 2008
   418.5 -+++ menu2.c	Thu Jun 12 01:37:41 2008
   418.6 -@@ -182,33 +182,10 @@
   418.7 - #define N_(x) x
   418.8 - 
   418.9 - static GtkItemFactoryEntry filer_menu_def[] = {
  418.10 --{N_("Display"),			NULL, NULL, 0, "<Branch>"},
  418.11 --{">" N_("Icons View"),   	NULL, view_type, VIEW_TYPE_COLLECTION, NULL},
  418.12 --{">" N_("Icons, With..."),	NULL, NULL, 0, "<Branch>"},
  418.13 --{">>" N_("Sizes"),		NULL, set_with, DETAILS_SIZE, NULL},
  418.14 --{">>" N_("Permissions"),	NULL, set_with, DETAILS_PERMISSIONS, NULL},
  418.15 --{">>" N_("Types"),		NULL, set_with, DETAILS_TYPE, NULL},
  418.16 --{">>" N_("Times"),		NULL, set_with, DETAILS_TIMES, NULL},
  418.17 --{">" N_("List View"),   	NULL, view_type, VIEW_TYPE_DETAILS, "<StockItem>", ROX_STOCK_SHOW_DETAILS},
  418.18 --{">",				NULL, NULL, 0, "<Separator>"},
  418.19 --{">" N_("Bigger Icons"),   	"equal", change_size, 1, "<StockItem>", GTK_STOCK_ZOOM_IN},
  418.20 --{">" N_("Smaller Icons"),   	"minus", change_size, -1, "<StockItem>", GTK_STOCK_ZOOM_OUT},
  418.21 --{">" N_("Automatic"),   	NULL, change_size_auto, 0, "<ToggleItem>"},
  418.22 --{">",				NULL, NULL, 0, "<Separator>"},
  418.23 --{">" N_("Sort by Name"),	NULL, set_sort, SORT_NAME, NULL},
  418.24 --{">" N_("Sort by Type"),	NULL, set_sort, SORT_TYPE, NULL},
  418.25 --{">" N_("Sort by Date"),	NULL, set_sort, SORT_DATE, NULL},
  418.26 --{">" N_("Sort by Size"),	NULL, set_sort, SORT_SIZE, NULL},
  418.27 --{">" N_("Sort by Owner"),	NULL, set_sort, SORT_OWNER, NULL},
  418.28 --{">" N_("Sort by Group"),	NULL, set_sort, SORT_GROUP, NULL},
  418.29 --{">" N_("Reversed"),		NULL, reverse_sort, 0, "<ToggleItem>"},
  418.30 --{">",				NULL, NULL, 0, "<Separator>"},
  418.31 --{">" N_("Show Hidden"),   	"<Ctrl>H", hidden, 0, "<ToggleItem>"},
  418.32 --{">" N_("Filter Files..."),   	NULL, mini_buffer, MINI_FILTER, NULL},
  418.33 --{">" N_("Filter Directories With Files"),	NULL, filter_directories, 0, "<ToggleItem>"},
  418.34 --{">" N_("Show Thumbnails"),	NULL, show_thumbs, 0, "<ToggleItem>"},
  418.35 --{">" N_("Refresh"),		NULL, refresh, 0, "<StockItem>", GTK_STOCK_REFRESH},
  418.36 --{">" N_("Save Current Display Settings..."),	 NULL, save_settings, 0, NULL},
  418.37 -+{N_("New"),			NULL, NULL, 0, "<Branch>"},
  418.38 -+{">" N_("Directory"),		NULL, new_directory, 0, NULL},
  418.39 -+{">" N_("Blank file"),		NULL, new_file, 0, "<StockItem>", GTK_STOCK_NEW},
  418.40 -+{">" N_("Customise Menu..."),	NULL, customise_new, 0, NULL},
  418.41 - {N_("File"),			NULL, NULL, 0, "<Branch>"},
  418.42 - {">" N_("Copy..."),		"<Ctrl>C", file_op, FILE_COPY_ITEM, "<StockItem>", GTK_STOCK_COPY},
  418.43 - {">" N_("Rename..."),		NULL, file_op, FILE_RENAME_ITEM, NULL},
  418.44 -@@ -233,10 +210,6 @@
  418.45 - {">" N_("Select by Name..."),	"period", mini_buffer, MINI_SELECT_BY_NAME, NULL},
  418.46 - {">" N_("Select If..."),	"<Shift>question", mini_buffer, MINI_SELECT_IF, NULL},
  418.47 - {N_("Options..."),		NULL, menu_show_options, 0, "<StockItem>", GTK_STOCK_PREFERENCES},
  418.48 --{N_("New"),			NULL, NULL, 0, "<Branch>"},
  418.49 --{">" N_("Directory"),		NULL, new_directory, 0, NULL},
  418.50 --{">" N_("Blank file"),		NULL, new_file, 0, "<StockItem>", GTK_STOCK_NEW},
  418.51 --{">" N_("Customise Menu..."),	NULL, customise_new, 0, NULL},
  418.52 - {N_("Window"),			NULL, NULL, 0, "<Branch>"},
  418.53 - {">" N_("Parent, New Window"), 	NULL, open_parent, 0, "<StockItem>", GTK_STOCK_GO_UP},
  418.54 - {">" N_("Parent, Same Window"), NULL, open_parent_same, 0, NULL},
  418.55 -@@ -254,6 +227,33 @@
  418.56 - {">" N_("Shell Command..."),	"<Shift>exclam", mini_buffer, MINI_SHELL, NULL},
  418.57 - {">" N_("Terminal Here"),	"grave", xterm_here, FALSE, NULL},
  418.58 - {">" N_("Switch to Terminal"),	NULL, xterm_here, TRUE, NULL},
  418.59 -+{N_("Display"),			NULL, NULL, 0, "<Branch>"},
  418.60 -+{">" N_("Icons View"),   	NULL, view_type, VIEW_TYPE_COLLECTION, NULL},
  418.61 -+{">" N_("Icons, With..."),	NULL, NULL, 0, "<Branch>"},
  418.62 -+{">>" N_("Sizes"),		NULL, set_with, DETAILS_SIZE, NULL},
  418.63 -+{">>" N_("Permissions"),	NULL, set_with, DETAILS_PERMISSIONS, NULL},
  418.64 -+{">>" N_("Types"),		NULL, set_with, DETAILS_TYPE, NULL},
  418.65 -+{">>" N_("Times"),		NULL, set_with, DETAILS_TIMES, NULL},
  418.66 -+{">" N_("List View"),   	NULL, view_type, VIEW_TYPE_DETAILS, "<StockItem>", ROX_STOCK_SHOW_DETAILS},
  418.67 -+{">",				NULL, NULL, 0, "<Separator>"},
  418.68 -+{">" N_("Bigger Icons"),   	"equal", change_size, 1, "<StockItem>", GTK_STOCK_ZOOM_IN},
  418.69 -+{">" N_("Smaller Icons"),   	"minus", change_size, -1, "<StockItem>", GTK_STOCK_ZOOM_OUT},
  418.70 -+{">" N_("Automatic"),   	NULL, change_size_auto, 0, "<ToggleItem>"},
  418.71 -+{">",				NULL, NULL, 0, "<Separator>"},
  418.72 -+{">" N_("Sort by Name"),	NULL, set_sort, SORT_NAME, NULL},
  418.73 -+{">" N_("Sort by Type"),	NULL, set_sort, SORT_TYPE, NULL},
  418.74 -+{">" N_("Sort by Date"),	NULL, set_sort, SORT_DATE, NULL},
  418.75 -+{">" N_("Sort by Size"),	NULL, set_sort, SORT_SIZE, NULL},
  418.76 -+{">" N_("Sort by Owner"),	NULL, set_sort, SORT_OWNER, NULL},
  418.77 -+{">" N_("Sort by Group"),	NULL, set_sort, SORT_GROUP, NULL},
  418.78 -+{">" N_("Reversed"),		NULL, reverse_sort, 0, "<ToggleItem>"},
  418.79 -+{">",				NULL, NULL, 0, "<Separator>"},
  418.80 -+{">" N_("Show Hidden"),   	"<Ctrl>H", hidden, 0, "<ToggleItem>"},
  418.81 -+{">" N_("Filter Files..."),   	NULL, mini_buffer, MINI_FILTER, NULL},
  418.82 -+{">" N_("Filter Directories With Files"),	NULL, filter_directories, 0, "<ToggleItem>"},
  418.83 -+{">" N_("Show Thumbnails"),	NULL, show_thumbs, 0, "<ToggleItem>"},
  418.84 -+{">" N_("Refresh"),		NULL, refresh, 0, "<StockItem>", GTK_STOCK_REFRESH},
  418.85 -+{">" N_("Save Current Display Settings..."),	 NULL, save_settings, 0, NULL},
  418.86 - {N_("Help"),			NULL, NULL, 0, "<Branch>"},
  418.87 - {">" N_("About ROX-Filer..."),	NULL, menu_rox_help, HELP_ABOUT, NULL},
  418.88 - {">" N_("Show Help Files"),	"F1", menu_rox_help, HELP_DIR, "<StockItem>", GTK_STOCK_HELP},
   419.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   419.2 +++ b/rox-filer/stuff/patches/menu.diff	Thu May 10 21:12:00 2018 +0300
   419.3 @@ -0,0 +1,85 @@
   419.4 +--- a/ROX-Filer/src/menu.c	Sat May 17 16:40:24 2008
   419.5 ++++ b/ROX-Filer/src/menu.c	Thu Jun 12 01:37:41 2008
   419.6 +@@ -182,33 +182,10 @@
   419.7 + #define N_(x) x
   419.8 + 
   419.9 + static GtkItemFactoryEntry filer_menu_def[] = {
  419.10 +-{N_("Display"),			NULL, NULL, 0, "<Branch>"},
  419.11 +-{">" N_("Icons View"),   	NULL, view_type, VIEW_TYPE_COLLECTION, NULL},
  419.12 +-{">" N_("Icons, With..."),	NULL, NULL, 0, "<Branch>"},
  419.13 +-{">>" N_("Sizes"),		NULL, set_with, DETAILS_SIZE, NULL},
  419.14 +-{">>" N_("Permissions"),	NULL, set_with, DETAILS_PERMISSIONS, NULL},
  419.15 +-{">>" N_("Types"),		NULL, set_with, DETAILS_TYPE, NULL},
  419.16 +-{">>" N_("Times"),		NULL, set_with, DETAILS_TIMES, NULL},
  419.17 +-{">" N_("List View"),   	NULL, view_type, VIEW_TYPE_DETAILS, "<StockItem>", ROX_STOCK_SHOW_DETAILS},
  419.18 +-{">",				NULL, NULL, 0, "<Separator>"},
  419.19 +-{">" N_("Bigger Icons"),   	"equal", change_size, 1, "<StockItem>", GTK_STOCK_ZOOM_IN},
  419.20 +-{">" N_("Smaller Icons"),   	"minus", change_size, -1, "<StockItem>", GTK_STOCK_ZOOM_OUT},
  419.21 +-{">" N_("Automatic"),   	NULL, change_size_auto, 0, "<ToggleItem>"},
  419.22 +-{">",				NULL, NULL, 0, "<Separator>"},
  419.23 +-{">" N_("Sort by Name"),	NULL, set_sort, SORT_NAME, NULL},
  419.24 +-{">" N_("Sort by Type"),	NULL, set_sort, SORT_TYPE, NULL},
  419.25 +-{">" N_("Sort by Date"),	NULL, set_sort, SORT_DATE, NULL},
  419.26 +-{">" N_("Sort by Size"),	NULL, set_sort, SORT_SIZE, NULL},
  419.27 +-{">" N_("Sort by Owner"),	NULL, set_sort, SORT_OWNER, NULL},
  419.28 +-{">" N_("Sort by Group"),	NULL, set_sort, SORT_GROUP, NULL},
  419.29 +-{">" N_("Reversed"),		NULL, reverse_sort, 0, "<ToggleItem>"},
  419.30 +-{">",				NULL, NULL, 0, "<Separator>"},
  419.31 +-{">" N_("Show Hidden"),   	"<Ctrl>H", hidden, 0, "<ToggleItem>"},
  419.32 +-{">" N_("Filter Files..."),   	NULL, mini_buffer, MINI_FILTER, NULL},
  419.33 +-{">" N_("Filter Directories With Files"),	NULL, filter_directories, 0, "<ToggleItem>"},
  419.34 +-{">" N_("Show Thumbnails"),	NULL, show_thumbs, 0, "<ToggleItem>"},
  419.35 +-{">" N_("Refresh"),		NULL, refresh, 0, "<StockItem>", GTK_STOCK_REFRESH},
  419.36 +-{">" N_("Save Current Display Settings..."),	 NULL, save_settings, 0, NULL},
  419.37 ++{N_("New"),			NULL, NULL, 0, "<Branch>"},
  419.38 ++{">" N_("Directory"),		NULL, new_directory, 0, NULL},
  419.39 ++{">" N_("Blank file"),		NULL, new_file, 0, "<StockItem>", GTK_STOCK_NEW},
  419.40 ++{">" N_("Customise Menu..."),	NULL, customise_new, 0, NULL},
  419.41 + {N_("File"),			NULL, NULL, 0, "<Branch>"},
  419.42 + {">" N_("Copy..."),		"<Ctrl>C", file_op, FILE_COPY_ITEM, "<StockItem>", GTK_STOCK_COPY},
  419.43 + {">" N_("Rename..."),		NULL, file_op, FILE_RENAME_ITEM, NULL},
  419.44 +@@ -233,10 +210,6 @@
  419.45 + {">" N_("Select by Name..."),	"period", mini_buffer, MINI_SELECT_BY_NAME, NULL},
  419.46 + {">" N_("Select If..."),	"<Shift>question", mini_buffer, MINI_SELECT_IF, NULL},
  419.47 + {N_("Options..."),		NULL, menu_show_options, 0, "<StockItem>", GTK_STOCK_PREFERENCES},
  419.48 +-{N_("New"),			NULL, NULL, 0, "<Branch>"},
  419.49 +-{">" N_("Directory"),		NULL, new_directory, 0, NULL},
  419.50 +-{">" N_("Blank file"),		NULL, new_file, 0, "<StockItem>", GTK_STOCK_NEW},
  419.51 +-{">" N_("Customise Menu..."),	NULL, customise_new, 0, NULL},
  419.52 + {N_("Window"),			NULL, NULL, 0, "<Branch>"},
  419.53 + {">" N_("Parent, New Window"), 	NULL, open_parent, 0, "<StockItem>", GTK_STOCK_GO_UP},
  419.54 + {">" N_("Parent, Same Window"), NULL, open_parent_same, 0, NULL},
  419.55 +@@ -254,6 +227,33 @@
  419.56 + {">" N_("Shell Command..."),	"<Shift>exclam", mini_buffer, MINI_SHELL, NULL},
  419.57 + {">" N_("Terminal Here"),	"grave", xterm_here, FALSE, NULL},
  419.58 + {">" N_("Switch to Terminal"),	NULL, xterm_here, TRUE, NULL},
  419.59 ++{N_("Display"),			NULL, NULL, 0, "<Branch>"},
  419.60 ++{">" N_("Icons View"),   	NULL, view_type, VIEW_TYPE_COLLECTION, NULL},
  419.61 ++{">" N_("Icons, With..."),	NULL, NULL, 0, "<Branch>"},
  419.62 ++{">>" N_("Sizes"),		NULL, set_with, DETAILS_SIZE, NULL},
  419.63 ++{">>" N_("Permissions"),	NULL, set_with, DETAILS_PERMISSIONS, NULL},
  419.64 ++{">>" N_("Types"),		NULL, set_with, DETAILS_TYPE, NULL},
  419.65 ++{">>" N_("Times"),		NULL, set_with, DETAILS_TIMES, NULL},
  419.66 ++{">" N_("List View"),   	NULL, view_type, VIEW_TYPE_DETAILS, "<StockItem>", ROX_STOCK_SHOW_DETAILS},
  419.67 ++{">",				NULL, NULL, 0, "<Separator>"},
  419.68 ++{">" N_("Bigger Icons"),   	"equal", change_size, 1, "<StockItem>", GTK_STOCK_ZOOM_IN},
  419.69 ++{">" N_("Smaller Icons"),   	"minus", change_size, -1, "<StockItem>", GTK_STOCK_ZOOM_OUT},
  419.70 ++{">" N_("Automatic"),   	NULL, change_size_auto, 0, "<ToggleItem>"},
  419.71 ++{">",				NULL, NULL, 0, "<Separator>"},
  419.72 ++{">" N_("Sort by Name"),	NULL, set_sort, SORT_NAME, NULL},
  419.73 ++{">" N_("Sort by Type"),	NULL, set_sort, SORT_TYPE, NULL},
  419.74 ++{">" N_("Sort by Date"),	NULL, set_sort, SORT_DATE, NULL},
  419.75 ++{">" N_("Sort by Size"),	NULL, set_sort, SORT_SIZE, NULL},
  419.76 ++{">" N_("Sort by Owner"),	NULL, set_sort, SORT_OWNER, NULL},
  419.77 ++{">" N_("Sort by Group"),	NULL, set_sort, SORT_GROUP, NULL},
  419.78 ++{">" N_("Reversed"),		NULL, reverse_sort, 0, "<ToggleItem>"},
  419.79 ++{">",				NULL, NULL, 0, "<Separator>"},
  419.80 ++{">" N_("Show Hidden"),   	"<Ctrl>H", hidden, 0, "<ToggleItem>"},
  419.81 ++{">" N_("Filter Files..."),   	NULL, mini_buffer, MINI_FILTER, NULL},
  419.82 ++{">" N_("Filter Directories With Files"),	NULL, filter_directories, 0, "<ToggleItem>"},
  419.83 ++{">" N_("Show Thumbnails"),	NULL, show_thumbs, 0, "<ToggleItem>"},
  419.84 ++{">" N_("Refresh"),		NULL, refresh, 0, "<StockItem>", GTK_STOCK_REFRESH},
  419.85 ++{">" N_("Save Current Display Settings..."),	 NULL, save_settings, 0, NULL},
  419.86 + {N_("Help"),			NULL, NULL, 0, "<Branch>"},
  419.87 + {">" N_("About ROX-Filer..."),	NULL, menu_rox_help, HELP_ABOUT, NULL},
  419.88 + {">" N_("Show Help Files"),	"F1", menu_rox_help, HELP_DIR, "<StockItem>", GTK_STOCK_HELP},
   420.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   420.2 +++ b/rox-filer/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   420.3 @@ -0,0 +1,1 @@
   420.4 +menu.diff
   421.1 --- a/ruby-ncurses/receipt	Wed May 09 17:03:28 2018 +0300
   421.2 +++ b/ruby-ncurses/receipt	Thu May 10 21:12:00 2018 +0300
   421.3 @@ -16,9 +16,6 @@
   421.4  # Rules to configure and make the package.
   421.5  compile_rules()
   421.6  {
   421.7 -	# use fedora patches
   421.8 -	patch -i ../../stuff/STR2CSTR-deprecated.patch
   421.9 -	patch -i ../../stuff/ruby-ncurses-fix-missing-tz-prototypes.patch
  421.10  	ruby extconf.rb 
  421.11    	make
  421.12  	make DESTDIR=$DESTDIR install
   422.1 --- a/ruby-ncurses/stuff/STR2CSTR-deprecated.patch	Wed May 09 17:03:28 2018 +0300
   422.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   422.3 @@ -1,320 +0,0 @@
   422.4 -diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.p/form_wrap.c
   422.5 ---- ncurses-ruby-1.3.1/form_wrap.c	2011-05-31 01:41:46.000000000 +0200
   422.6 -+++ ncurses-ruby-1.3.1.p/form_wrap.c	2013-03-14 14:38:21.097682379 +0100
   422.7 -@@ -625,7 +625,8 @@
   422.8 - 		char** list = ALLOC_N(char*, n+1);
   422.9 - 		int i;
  422.10 - 		for (i = 0; i < n; i++) {
  422.11 --		  list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i));
  422.12 -+		  VALUE tmp = rb_ary_entry(arg3, (long)i);
  422.13 -+		  list[i] = StringValuePtr(tmp);
  422.14 - 		}
  422.15 - 		list[n] = NULL;
  422.16 - 		return INT2NUM(set_field_type(field, ftype, 
  422.17 -@@ -654,7 +655,7 @@
  422.18 - 	 if (argc != 2)
  422.19 - 		rb_raise(rb_eArgError, "TYPE_REGEXP requires one additional argument");
  422.20 - 	 return INT2NUM(set_field_type(field, ftype, 
  422.21 --											 STR2CSTR(arg3)));
  422.22 -+											 StringValuePtr(arg3)));
  422.23 -   }
  422.24 -   else if (ftype == TYPE_IPV4){	
  422.25 - 	 if (argc != 1)
  422.26 -@@ -742,7 +743,7 @@
  422.27 -  */
  422.28 - static VALUE rbncurs_c_set_field_buffer(VALUE rb_field, VALUE buf, VALUE value) {
  422.29 -   FIELD* field = get_field(rb_field);
  422.30 --  return INT2NUM(set_field_buffer(field, NUM2INT(buf), STR2CSTR(value)));
  422.31 -+  return INT2NUM(set_field_buffer(field, NUM2INT(buf), StringValuePtr(value)));
  422.32 - }
  422.33 - static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf, VALUE value)
  422.34 - { return rbncurs_c_set_field_buffer(rb_field, buf, value); }
  422.35 -@@ -1052,7 +1053,7 @@
  422.36 - { return rbncurs_c_form_request_name(request); }
  422.37 - 
  422.38 - static VALUE rbncurs_c_form_request_by_name(VALUE name) {
  422.39 --  return INT2NUM(form_request_by_name(STR2CSTR(name)));
  422.40 -+  return INT2NUM(form_request_by_name(StringValuePtr(name)));
  422.41 - }
  422.42 - static VALUE rbncurs_m_form_request_by_name(VALUE dummy, VALUE name)
  422.43 - { return rbncurs_c_form_request_by_name(name); }
  422.44 -diff -Naur ncurses-ruby-1.3.1/menu_wrap.c ncurses-ruby-1.3.1.p/menu_wrap.c
  422.45 ---- ncurses-ruby-1.3.1/menu_wrap.c	2011-05-31 01:41:46.000000000 +0200
  422.46 -+++ ncurses-ruby-1.3.1.p/menu_wrap.c	2013-03-14 14:39:37.016571464 +0100
  422.47 -@@ -372,7 +372,7 @@
  422.48 -  * Item creation/destruction functions - mitem_new(3X) man page
  422.49 -  */
  422.50 - static VALUE rbncurs_m_new_item(VALUE dummy, VALUE name, VALUE description)
  422.51 --{ return wrap_item(new_item(STR2CSTR(name), STR2CSTR(description))); }
  422.52 -+{ return wrap_item(new_item(StringValuePtr(name), StringValuePtr(description))); }
  422.53 - 
  422.54 - static VALUE rbncurs_c_free_item(VALUE rb_item)
  422.55 - {
  422.56 -@@ -670,7 +670,7 @@
  422.57 - 
  422.58 - static VALUE rbncurs_c_menu_request_by_name(VALUE name)
  422.59 - {
  422.60 --  return INT2NUM(menu_request_by_name(STR2CSTR(name)));
  422.61 -+  return INT2NUM(menu_request_by_name(StringValuePtr(name)));
  422.62 - }
  422.63 - static VALUE rbncurs_m_menu_request_by_name(VALUE dummy, VALUE name)
  422.64 - { return rbncurs_c_menu_request_by_name(name); }
  422.65 -@@ -909,7 +909,7 @@
  422.66 - static VALUE rbncurs_c_set_menu_mark(VALUE rb_menu, VALUE value)
  422.67 - {
  422.68 -   MENU *menu = get_menu(rb_menu);
  422.69 --  return INT2NUM(set_menu_mark(menu, STR2CSTR(value)));
  422.70 -+  return INT2NUM(set_menu_mark(menu, StringValuePtr(value)));
  422.71 - }
  422.72 - static VALUE rbncurs_m_set_menu_mark(VALUE dummy, VALUE rb_field, VALUE value)
  422.73 - { return rbncurs_c_set_menu_mark(rb_field, value); }
  422.74 -@@ -929,7 +929,7 @@
  422.75 - static VALUE rbncurs_c_set_menu_pattern(VALUE rb_menu, VALUE pattern)
  422.76 - {
  422.77 -   MENU *menu = get_menu(rb_menu);
  422.78 --  return INT2NUM(set_menu_pattern(menu, STR2CSTR(pattern)));
  422.79 -+  return INT2NUM(set_menu_pattern(menu, StringValuePtr(pattern)));
  422.80 - }
  422.81 - static VALUE rbncurs_m_set_menu_pattern(VALUE dummy, VALUE rb_menu, VALUE pattern)
  422.82 - { return rbncurs_c_set_menu_pattern(rb_menu, pattern); }
  422.83 -diff -Naur ncurses-ruby-1.3.1/ncurses_wrap.c ncurses-ruby-1.3.1.p/ncurses_wrap.c
  422.84 ---- ncurses-ruby-1.3.1/ncurses_wrap.c	2011-05-31 01:41:46.000000000 +0200
  422.85 -+++ ncurses-ruby-1.3.1.p/ncurses_wrap.c	2013-03-14 15:09:59.535783327 +0100
  422.86 -@@ -475,7 +475,7 @@
  422.87 - static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode)
  422.88 - {
  422.89 -     return INT2NUM(define_key((definition != Qnil)
  422.90 --                              ? STR2CSTR(definition)
  422.91 -+                              ? StringValuePtr(definition)
  422.92 -                               : (char*)(NULL),
  422.93 -                               NUM2INT(keycode)));
  422.94 - }
  422.95 -@@ -580,10 +580,10 @@
  422.96 -     return return_value;
  422.97 - }
  422.98 - static VALUE rbncurs_addnstr(VALUE dummy, VALUE arg1, VALUE arg2) {
  422.99 --    return INT2NUM(addnstr(STR2CSTR(arg1),  NUM2INT(arg2)));
 422.100 -+    return INT2NUM(addnstr(StringValuePtr(arg1),  NUM2INT(arg2)));
 422.101 - }
 422.102 - static VALUE rbncurs_addstr(VALUE dummy, VALUE arg1) {
 422.103 --    return INT2NUM(addstr(STR2CSTR(arg1)));
 422.104 -+    return INT2NUM(addstr(StringValuePtr(arg1)));
 422.105 - }
 422.106 - static VALUE rbncurs_attroff(VALUE dummy, VALUE arg1) {
 422.107 -     return INT2NUM(attroff(NUM2ULONG(arg1)));
 422.108 -@@ -1011,10 +1011,10 @@
 422.109 -     return INT2NUM(insertln());
 422.110 - }
 422.111 - static VALUE rbncurs_insnstr(VALUE dummy, VALUE arg1, VALUE arg2) {
 422.112 --    return INT2NUM(insnstr(STR2CSTR(arg1),  NUM2INT(arg2)));
 422.113 -+    return INT2NUM(insnstr(StringValuePtr(arg1),  NUM2INT(arg2)));
 422.114 - }
 422.115 - static VALUE rbncurs_insstr(VALUE dummy, VALUE arg1) {
 422.116 --    return INT2NUM(insstr(STR2CSTR(arg1)));
 422.117 -+    return INT2NUM(insstr(StringValuePtr(arg1)));
 422.118 - }
 422.119 - #ifdef HAVE_INTRFLUSH
 422.120 - static VALUE rbncurs_intrflush(VALUE dummy, VALUE arg1, VALUE arg2) {
 422.121 -@@ -1070,10 +1070,10 @@
 422.122 -     return return_value;
 422.123 - }
 422.124 - static VALUE rbncurs_mvaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 422.125 --    return INT2NUM(mvaddnstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3),  NUM2INT(arg4)));
 422.126 -+    return INT2NUM(mvaddnstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3),  NUM2INT(arg4)));
 422.127 - }
 422.128 - static VALUE rbncurs_mvaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 422.129 --    return INT2NUM(mvaddstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3)));
 422.130 -+    return INT2NUM(mvaddstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3)));
 422.131 - }
 422.132 - #ifdef HAVE_MVCHGAT
 422.133 - static VALUE rbncurs_mvchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6) {
 422.134 -@@ -1106,10 +1106,10 @@
 422.135 -     return INT2NUM(mvinsch(NUM2INT(arg1),  NUM2INT(arg2),  NUM2ULONG(arg3)));
 422.136 - }
 422.137 - static VALUE rbncurs_mvinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 422.138 --    return INT2NUM(mvinsnstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3),  NUM2INT(arg4)));
 422.139 -+    return INT2NUM(mvinsnstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3),  NUM2INT(arg4)));
 422.140 - }
 422.141 - static VALUE rbncurs_mvinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 422.142 --    return INT2NUM(mvinsstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3)));
 422.143 -+    return INT2NUM(mvinsstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3)));
 422.144 - }
 422.145 - #ifdef HAVE_MVVLINE
 422.146 - static VALUE rbncurs_mvvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 422.147 -@@ -1137,10 +1137,10 @@
 422.148 -     return return_value;
 422.149 - }
 422.150 - static VALUE rbncurs_mvwaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
 422.151 --    return INT2NUM(mvwaddnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4),  NUM2INT(arg5)));
 422.152 -+    return INT2NUM(mvwaddnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4),  NUM2INT(arg5)));
 422.153 - }
 422.154 - static VALUE rbncurs_mvwaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 422.155 --    return INT2NUM(mvwaddstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4)));
 422.156 -+    return INT2NUM(mvwaddstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4)));
 422.157 - }
 422.158 - #ifdef HAVE_MVWCHGAT
 422.159 - static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7) {
 422.160 -@@ -1171,10 +1171,10 @@
 422.161 -     return INT2NUM(mvwinsch(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  NUM2ULONG(arg4)));
 422.162 - }
 422.163 - static VALUE rbncurs_mvwinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
 422.164 --    return INT2NUM(mvwinsnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4),  NUM2INT(arg5)));
 422.165 -+    return INT2NUM(mvwinsnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4),  NUM2INT(arg5)));
 422.166 - }
 422.167 - static VALUE rbncurs_mvwinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 422.168 --    return INT2NUM(mvwinsstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4)));
 422.169 -+    return INT2NUM(mvwinsstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4)));
 422.170 - }
 422.171 - #ifdef HAVE_MVWVLINE
 422.172 - static VALUE rbncurs_mvwvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
 422.173 -@@ -1238,7 +1238,7 @@
 422.174 - }
 422.175 - #ifdef HAVE_PUTP
 422.176 - static VALUE rbncurs_putp(VALUE dummy, VALUE arg1) {
 422.177 --    return INT2NUM(putp(STR2CSTR(arg1)));
 422.178 -+    return INT2NUM(putp(StringValuePtr(arg1)));
 422.179 - }
 422.180 - #endif
 422.181 - #ifdef HAVE_QIFLUSH
 422.182 -@@ -1271,12 +1271,12 @@
 422.183 - }
 422.184 - #ifdef HAVE_SCR_DUMP
 422.185 - static VALUE rbncurs_scr_dump(VALUE dummy, VALUE arg1) {
 422.186 --    return INT2NUM(scr_dump(STR2CSTR(arg1)));
 422.187 -+    return INT2NUM(scr_dump(StringValuePtr(arg1)));
 422.188 - }
 422.189 - #endif
 422.190 - #ifdef HAVE_SCR_INIT
 422.191 - static VALUE rbncurs_scr_init(VALUE dummy, VALUE arg1) {
 422.192 --    return INT2NUM(scr_init(STR2CSTR(arg1)));
 422.193 -+    return INT2NUM(scr_init(StringValuePtr(arg1)));
 422.194 - }
 422.195 - #endif
 422.196 - static VALUE rbncurs_scrl(VALUE dummy, VALUE arg1) {
 422.197 -@@ -1290,12 +1290,12 @@
 422.198 - }
 422.199 - #ifdef HAVE_SCR_RESTORE
 422.200 - static VALUE rbncurs_scr_restore(VALUE dummy, VALUE arg1) {
 422.201 --    return INT2NUM(scr_restore(STR2CSTR(arg1)));
 422.202 -+    return INT2NUM(scr_restore(StringValuePtr(arg1)));
 422.203 - }
 422.204 - #endif
 422.205 - #ifdef HAVE_SCR_SET
 422.206 - static VALUE rbncurs_scr_set(VALUE dummy, VALUE arg1) {
 422.207 --    return INT2NUM(scr_set(STR2CSTR(arg1)));
 422.208 -+    return INT2NUM(scr_set(StringValuePtr(arg1)));
 422.209 - }
 422.210 - #endif
 422.211 - static VALUE rbncurs_setscrreg(VALUE dummy, VALUE arg1, VALUE arg2) {
 422.212 -@@ -1352,7 +1352,7 @@
 422.213 -     return INT2NUM(slk_restore());
 422.214 - }
 422.215 - static VALUE rbncurs_slk_set(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 422.216 --    return INT2NUM(slk_set(NUM2INT(arg1),  STR2CSTR(arg2),  NUM2INT(arg3)));
 422.217 -+    return INT2NUM(slk_set(NUM2INT(arg1),  StringValuePtr(arg2),  NUM2INT(arg3)));
 422.218 - }
 422.219 - static VALUE rbncurs_slk_touch(VALUE dummy) {
 422.220 -     return INT2NUM(slk_touch());
 422.221 -@@ -1383,17 +1383,17 @@
 422.222 - }
 422.223 - #ifdef HAVE_TIGETFLAG
 422.224 - static VALUE rbncurs_tigetflag(VALUE dummy, VALUE arg1) {
 422.225 --    return INT2NUM(tigetflag(STR2CSTR(arg1)));
 422.226 -+    return INT2NUM(tigetflag(StringValuePtr(arg1)));
 422.227 - }
 422.228 - #endif
 422.229 - #ifdef HAVE_TIGETNUM
 422.230 - static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) {
 422.231 --    return INT2NUM(tigetnum(STR2CSTR(arg1)));
 422.232 -+    return INT2NUM(tigetnum(StringValuePtr(arg1)));
 422.233 - }
 422.234 - #endif
 422.235 - #ifdef HAVE_TIGETSTR
 422.236 - static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) {
 422.237 --    return rb_str_new2(tigetstr(STR2CSTR(arg1)));
 422.238 -+    return rb_str_new2(tigetstr(StringValuePtr(arg1)));
 422.239 - }
 422.240 - #endif
 422.241 - static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) {
 422.242 -@@ -1438,10 +1438,10 @@
 422.243 -     return return_value;
 422.244 - }
 422.245 - static VALUE rbncurs_waddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 422.246 --    return INT2NUM(waddnstr(get_window(arg1),  STR2CSTR(arg2),  NUM2INT(arg3)));
 422.247 -+    return INT2NUM(waddnstr(get_window(arg1),  StringValuePtr(arg2),  NUM2INT(arg3)));
 422.248 - }
 422.249 - static VALUE rbncurs_waddstr(VALUE dummy, VALUE arg1, VALUE arg2) {
 422.250 --    return INT2NUM(waddstr(get_window(arg1),  STR2CSTR(arg2)));
 422.251 -+    return INT2NUM(waddstr(get_window(arg1),  StringValuePtr(arg2)));
 422.252 - }
 422.253 - static VALUE rbncurs_wattron(VALUE dummy, VALUE arg1, VALUE arg2) {
 422.254 -     return INT2NUM(wattron(get_window(arg1),  NUM2INT(arg2)));
 422.255 -@@ -1514,10 +1514,10 @@
 422.256 -     return INT2NUM(winsertln(get_window(arg1)));
 422.257 - }
 422.258 - static VALUE rbncurs_winsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 422.259 --    return INT2NUM(winsnstr(get_window(arg1),  STR2CSTR(arg2),  NUM2INT(arg3)));
 422.260 -+    return INT2NUM(winsnstr(get_window(arg1),  StringValuePtr(arg2),  NUM2INT(arg3)));
 422.261 - }
 422.262 - static VALUE rbncurs_winsstr(VALUE dummy, VALUE arg1, VALUE arg2) {
 422.263 --    return INT2NUM(winsstr(get_window(arg1),  STR2CSTR(arg2)));
 422.264 -+    return INT2NUM(winsstr(get_window(arg1),  StringValuePtr(arg2)));
 422.265 - }
 422.266 - static VALUE rbncurs_wmove(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 422.267 -     return INT2NUM(wmove(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3)));
 422.268 -@@ -1619,7 +1619,7 @@
 422.269 - { return rb_str_new2(unctrl(NUM2ULONG(ch))); }
 422.270 - static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE rb_infd)
 422.271 - {
 422.272 --    char * type = (rb_type == Qnil) ? (char*)0 : STR2CSTR(rb_type);
 422.273 -+    char * type = (rb_type == Qnil) ? (char*)0 : StringValuePtr(rb_type);
 422.274 -     int outfd = NUM2INT(rb_funcall(rb_outfd, rb_intern("to_i"), 0));
 422.275 -     int infd  = NUM2INT(rb_funcall(rb_infd, rb_intern("to_i"), 0));
 422.276 -     VALUE rb_screen =
 422.277 -@@ -2277,7 +2277,7 @@
 422.278 - #ifdef HAVE_MCPRINT
 422.279 - static VALUE rbncurs_mcprint(VALUE dummy, VALUE data, VALUE len)
 422.280 - {
 422.281 --    return INT2NUM(mcprint(STR2CSTR(data), NUM2INT(len)));
 422.282 -+    return INT2NUM(mcprint(StringValuePtr(data), NUM2INT(len)));
 422.283 - }
 422.284 - #endif
 422.285 - #ifdef HAVE_HAS_KEY
 422.286 -@@ -2378,9 +2378,9 @@
 422.287 -                  " and a String");
 422.288 -         return Qnil;
 422.289 -     }
 422.290 -+	VALUE tmp = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, argv + 1);
 422.291 -     wprintw(get_window(argv[0]), "%s",
 422.292 --            STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1,
 422.293 --                              argv + 1)));
 422.294 -+		StringValuePtr(tmp));
 422.295 -     return Qnil;
 422.296 - }
 422.297 - 
 422.298 -@@ -2394,14 +2394,14 @@
 422.299 -         return Qnil;
 422.300 -     }
 422.301 -     _tracef("%s",
 422.302 --            STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv)));
 422.303 -+            StringValuePtr(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv)));
 422.304 -     return Qnil;
 422.305 - }
 422.306 - #endif /* HAVE__TRACEF */
 422.307 - #ifdef HAVE__TRACEDUMP
 422.308 - static VALUE rbncurs_tracedump(VALUE dummy, VALUE rb_label, VALUE rb_win)
 422.309 - {
 422.310 --    _tracedump(STR2CSTR(rb_label), get_window(rb_win));
 422.311 -+    _tracedump(StringValuePtr(rb_label), get_window(rb_win));
 422.312 - }
 422.313 - #endif /* HAVE__TRACEDUMP */
 422.314 - #ifdef HAVE__TRACEATTR
 422.315 -@@ -2706,7 +2706,7 @@
 422.316 - 
 422.317 - #ifdef HAVE_LOCALE_H
 422.318 - static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale)
 422.319 --{   return rb_str_new2(setlocale(NUM2INT(category), STR2CSTR(locale)));}
 422.320 -+{   return rb_str_new2(setlocale(NUM2INT(category), StringValuePtr(locale)));}
 422.321 - #endif
 422.322 - 
 422.323 - static void init_safe_functions(void)
   423.1 --- a/ruby-ncurses/stuff/Werror-format-security.patch	Wed May 09 17:03:28 2018 +0300
   423.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   423.3 @@ -1,12 +0,0 @@
   423.4 -diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.format/form_wrap.c
   423.5 ---- ncurses-ruby-1.3.1/form_wrap.c	2014-02-03 11:31:39.049867878 +0100
   423.6 -+++ ncurses-ruby-1.3.1.format/form_wrap.c	2014-02-03 11:44:37.001008654 +0100
   423.7 -@@ -1132,7 +1132,7 @@
   423.8 - 		  char msg[500];
   423.9 - 		  snprintf(msg, 500, "The validation functions for this field type need %d additional arguments.",(int)(NUM2INT(argc)-1));
  423.10 - 		  msg[499]=0;
  423.11 --		  rb_raise(rb_eArgError, msg);	
  423.12 -+		  rb_raise(rb_eArgError, "%s", msg);	
  423.13 - 		}
  423.14 - 	 } 
  423.15 -   }
   424.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   424.2 +++ b/ruby-ncurses/stuff/patches/STR2CSTR-deprecated.patch	Thu May 10 21:12:00 2018 +0300
   424.3 @@ -0,0 +1,320 @@
   424.4 +diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.p/form_wrap.c
   424.5 +--- ncurses-ruby-1.3.1/form_wrap.c	2011-05-31 01:41:46.000000000 +0200
   424.6 ++++ ncurses-ruby-1.3.1.p/form_wrap.c	2013-03-14 14:38:21.097682379 +0100
   424.7 +@@ -625,7 +625,8 @@
   424.8 + 		char** list = ALLOC_N(char*, n+1);
   424.9 + 		int i;
  424.10 + 		for (i = 0; i < n; i++) {
  424.11 +-		  list[i] = STR2CSTR(rb_ary_entry(arg3, (long)i));
  424.12 ++		  VALUE tmp = rb_ary_entry(arg3, (long)i);
  424.13 ++		  list[i] = StringValuePtr(tmp);
  424.14 + 		}
  424.15 + 		list[n] = NULL;
  424.16 + 		return INT2NUM(set_field_type(field, ftype, 
  424.17 +@@ -654,7 +655,7 @@
  424.18 + 	 if (argc != 2)
  424.19 + 		rb_raise(rb_eArgError, "TYPE_REGEXP requires one additional argument");
  424.20 + 	 return INT2NUM(set_field_type(field, ftype, 
  424.21 +-											 STR2CSTR(arg3)));
  424.22 ++											 StringValuePtr(arg3)));
  424.23 +   }
  424.24 +   else if (ftype == TYPE_IPV4){	
  424.25 + 	 if (argc != 1)
  424.26 +@@ -742,7 +743,7 @@
  424.27 +  */
  424.28 + static VALUE rbncurs_c_set_field_buffer(VALUE rb_field, VALUE buf, VALUE value) {
  424.29 +   FIELD* field = get_field(rb_field);
  424.30 +-  return INT2NUM(set_field_buffer(field, NUM2INT(buf), STR2CSTR(value)));
  424.31 ++  return INT2NUM(set_field_buffer(field, NUM2INT(buf), StringValuePtr(value)));
  424.32 + }
  424.33 + static VALUE rbncurs_m_set_field_buffer(VALUE dummy, VALUE rb_field, VALUE buf, VALUE value)
  424.34 + { return rbncurs_c_set_field_buffer(rb_field, buf, value); }
  424.35 +@@ -1052,7 +1053,7 @@
  424.36 + { return rbncurs_c_form_request_name(request); }
  424.37 + 
  424.38 + static VALUE rbncurs_c_form_request_by_name(VALUE name) {
  424.39 +-  return INT2NUM(form_request_by_name(STR2CSTR(name)));
  424.40 ++  return INT2NUM(form_request_by_name(StringValuePtr(name)));
  424.41 + }
  424.42 + static VALUE rbncurs_m_form_request_by_name(VALUE dummy, VALUE name)
  424.43 + { return rbncurs_c_form_request_by_name(name); }
  424.44 +diff -Naur ncurses-ruby-1.3.1/menu_wrap.c ncurses-ruby-1.3.1.p/menu_wrap.c
  424.45 +--- ncurses-ruby-1.3.1/menu_wrap.c	2011-05-31 01:41:46.000000000 +0200
  424.46 ++++ ncurses-ruby-1.3.1.p/menu_wrap.c	2013-03-14 14:39:37.016571464 +0100
  424.47 +@@ -372,7 +372,7 @@
  424.48 +  * Item creation/destruction functions - mitem_new(3X) man page
  424.49 +  */
  424.50 + static VALUE rbncurs_m_new_item(VALUE dummy, VALUE name, VALUE description)
  424.51 +-{ return wrap_item(new_item(STR2CSTR(name), STR2CSTR(description))); }
  424.52 ++{ return wrap_item(new_item(StringValuePtr(name), StringValuePtr(description))); }
  424.53 + 
  424.54 + static VALUE rbncurs_c_free_item(VALUE rb_item)
  424.55 + {
  424.56 +@@ -670,7 +670,7 @@
  424.57 + 
  424.58 + static VALUE rbncurs_c_menu_request_by_name(VALUE name)
  424.59 + {
  424.60 +-  return INT2NUM(menu_request_by_name(STR2CSTR(name)));
  424.61 ++  return INT2NUM(menu_request_by_name(StringValuePtr(name)));
  424.62 + }
  424.63 + static VALUE rbncurs_m_menu_request_by_name(VALUE dummy, VALUE name)
  424.64 + { return rbncurs_c_menu_request_by_name(name); }
  424.65 +@@ -909,7 +909,7 @@
  424.66 + static VALUE rbncurs_c_set_menu_mark(VALUE rb_menu, VALUE value)
  424.67 + {
  424.68 +   MENU *menu = get_menu(rb_menu);
  424.69 +-  return INT2NUM(set_menu_mark(menu, STR2CSTR(value)));
  424.70 ++  return INT2NUM(set_menu_mark(menu, StringValuePtr(value)));
  424.71 + }
  424.72 + static VALUE rbncurs_m_set_menu_mark(VALUE dummy, VALUE rb_field, VALUE value)
  424.73 + { return rbncurs_c_set_menu_mark(rb_field, value); }
  424.74 +@@ -929,7 +929,7 @@
  424.75 + static VALUE rbncurs_c_set_menu_pattern(VALUE rb_menu, VALUE pattern)
  424.76 + {
  424.77 +   MENU *menu = get_menu(rb_menu);
  424.78 +-  return INT2NUM(set_menu_pattern(menu, STR2CSTR(pattern)));
  424.79 ++  return INT2NUM(set_menu_pattern(menu, StringValuePtr(pattern)));
  424.80 + }
  424.81 + static VALUE rbncurs_m_set_menu_pattern(VALUE dummy, VALUE rb_menu, VALUE pattern)
  424.82 + { return rbncurs_c_set_menu_pattern(rb_menu, pattern); }
  424.83 +diff -Naur ncurses-ruby-1.3.1/ncurses_wrap.c ncurses-ruby-1.3.1.p/ncurses_wrap.c
  424.84 +--- ncurses-ruby-1.3.1/ncurses_wrap.c	2011-05-31 01:41:46.000000000 +0200
  424.85 ++++ ncurses-ruby-1.3.1.p/ncurses_wrap.c	2013-03-14 15:09:59.535783327 +0100
  424.86 +@@ -475,7 +475,7 @@
  424.87 + static VALUE rbncurs_define_key(VALUE dummy, VALUE definition, VALUE keycode)
  424.88 + {
  424.89 +     return INT2NUM(define_key((definition != Qnil)
  424.90 +-                              ? STR2CSTR(definition)
  424.91 ++                              ? StringValuePtr(definition)
  424.92 +                               : (char*)(NULL),
  424.93 +                               NUM2INT(keycode)));
  424.94 + }
  424.95 +@@ -580,10 +580,10 @@
  424.96 +     return return_value;
  424.97 + }
  424.98 + static VALUE rbncurs_addnstr(VALUE dummy, VALUE arg1, VALUE arg2) {
  424.99 +-    return INT2NUM(addnstr(STR2CSTR(arg1),  NUM2INT(arg2)));
 424.100 ++    return INT2NUM(addnstr(StringValuePtr(arg1),  NUM2INT(arg2)));
 424.101 + }
 424.102 + static VALUE rbncurs_addstr(VALUE dummy, VALUE arg1) {
 424.103 +-    return INT2NUM(addstr(STR2CSTR(arg1)));
 424.104 ++    return INT2NUM(addstr(StringValuePtr(arg1)));
 424.105 + }
 424.106 + static VALUE rbncurs_attroff(VALUE dummy, VALUE arg1) {
 424.107 +     return INT2NUM(attroff(NUM2ULONG(arg1)));
 424.108 +@@ -1011,10 +1011,10 @@
 424.109 +     return INT2NUM(insertln());
 424.110 + }
 424.111 + static VALUE rbncurs_insnstr(VALUE dummy, VALUE arg1, VALUE arg2) {
 424.112 +-    return INT2NUM(insnstr(STR2CSTR(arg1),  NUM2INT(arg2)));
 424.113 ++    return INT2NUM(insnstr(StringValuePtr(arg1),  NUM2INT(arg2)));
 424.114 + }
 424.115 + static VALUE rbncurs_insstr(VALUE dummy, VALUE arg1) {
 424.116 +-    return INT2NUM(insstr(STR2CSTR(arg1)));
 424.117 ++    return INT2NUM(insstr(StringValuePtr(arg1)));
 424.118 + }
 424.119 + #ifdef HAVE_INTRFLUSH
 424.120 + static VALUE rbncurs_intrflush(VALUE dummy, VALUE arg1, VALUE arg2) {
 424.121 +@@ -1070,10 +1070,10 @@
 424.122 +     return return_value;
 424.123 + }
 424.124 + static VALUE rbncurs_mvaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 424.125 +-    return INT2NUM(mvaddnstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3),  NUM2INT(arg4)));
 424.126 ++    return INT2NUM(mvaddnstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3),  NUM2INT(arg4)));
 424.127 + }
 424.128 + static VALUE rbncurs_mvaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 424.129 +-    return INT2NUM(mvaddstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3)));
 424.130 ++    return INT2NUM(mvaddstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3)));
 424.131 + }
 424.132 + #ifdef HAVE_MVCHGAT
 424.133 + static VALUE rbncurs_mvchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6) {
 424.134 +@@ -1106,10 +1106,10 @@
 424.135 +     return INT2NUM(mvinsch(NUM2INT(arg1),  NUM2INT(arg2),  NUM2ULONG(arg3)));
 424.136 + }
 424.137 + static VALUE rbncurs_mvinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 424.138 +-    return INT2NUM(mvinsnstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3),  NUM2INT(arg4)));
 424.139 ++    return INT2NUM(mvinsnstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3),  NUM2INT(arg4)));
 424.140 + }
 424.141 + static VALUE rbncurs_mvinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 424.142 +-    return INT2NUM(mvinsstr(NUM2INT(arg1),  NUM2INT(arg2),  STR2CSTR(arg3)));
 424.143 ++    return INT2NUM(mvinsstr(NUM2INT(arg1),  NUM2INT(arg2),  StringValuePtr(arg3)));
 424.144 + }
 424.145 + #ifdef HAVE_MVVLINE
 424.146 + static VALUE rbncurs_mvvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 424.147 +@@ -1137,10 +1137,10 @@
 424.148 +     return return_value;
 424.149 + }
 424.150 + static VALUE rbncurs_mvwaddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
 424.151 +-    return INT2NUM(mvwaddnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4),  NUM2INT(arg5)));
 424.152 ++    return INT2NUM(mvwaddnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4),  NUM2INT(arg5)));
 424.153 + }
 424.154 + static VALUE rbncurs_mvwaddstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 424.155 +-    return INT2NUM(mvwaddstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4)));
 424.156 ++    return INT2NUM(mvwaddstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4)));
 424.157 + }
 424.158 + #ifdef HAVE_MVWCHGAT
 424.159 + static VALUE rbncurs_mvwchgat(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5, VALUE arg6, VALUE arg7) {
 424.160 +@@ -1171,10 +1171,10 @@
 424.161 +     return INT2NUM(mvwinsch(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  NUM2ULONG(arg4)));
 424.162 + }
 424.163 + static VALUE rbncurs_mvwinsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
 424.164 +-    return INT2NUM(mvwinsnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4),  NUM2INT(arg5)));
 424.165 ++    return INT2NUM(mvwinsnstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4),  NUM2INT(arg5)));
 424.166 + }
 424.167 + static VALUE rbncurs_mvwinsstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4) {
 424.168 +-    return INT2NUM(mvwinsstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  STR2CSTR(arg4)));
 424.169 ++    return INT2NUM(mvwinsstr(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3),  StringValuePtr(arg4)));
 424.170 + }
 424.171 + #ifdef HAVE_MVWVLINE
 424.172 + static VALUE rbncurs_mvwvline(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3, VALUE arg4, VALUE arg5) {
 424.173 +@@ -1238,7 +1238,7 @@
 424.174 + }
 424.175 + #ifdef HAVE_PUTP
 424.176 + static VALUE rbncurs_putp(VALUE dummy, VALUE arg1) {
 424.177 +-    return INT2NUM(putp(STR2CSTR(arg1)));
 424.178 ++    return INT2NUM(putp(StringValuePtr(arg1)));
 424.179 + }
 424.180 + #endif
 424.181 + #ifdef HAVE_QIFLUSH
 424.182 +@@ -1271,12 +1271,12 @@
 424.183 + }
 424.184 + #ifdef HAVE_SCR_DUMP
 424.185 + static VALUE rbncurs_scr_dump(VALUE dummy, VALUE arg1) {
 424.186 +-    return INT2NUM(scr_dump(STR2CSTR(arg1)));
 424.187 ++    return INT2NUM(scr_dump(StringValuePtr(arg1)));
 424.188 + }
 424.189 + #endif
 424.190 + #ifdef HAVE_SCR_INIT
 424.191 + static VALUE rbncurs_scr_init(VALUE dummy, VALUE arg1) {
 424.192 +-    return INT2NUM(scr_init(STR2CSTR(arg1)));
 424.193 ++    return INT2NUM(scr_init(StringValuePtr(arg1)));
 424.194 + }
 424.195 + #endif
 424.196 + static VALUE rbncurs_scrl(VALUE dummy, VALUE arg1) {
 424.197 +@@ -1290,12 +1290,12 @@
 424.198 + }
 424.199 + #ifdef HAVE_SCR_RESTORE
 424.200 + static VALUE rbncurs_scr_restore(VALUE dummy, VALUE arg1) {
 424.201 +-    return INT2NUM(scr_restore(STR2CSTR(arg1)));
 424.202 ++    return INT2NUM(scr_restore(StringValuePtr(arg1)));
 424.203 + }
 424.204 + #endif
 424.205 + #ifdef HAVE_SCR_SET
 424.206 + static VALUE rbncurs_scr_set(VALUE dummy, VALUE arg1) {
 424.207 +-    return INT2NUM(scr_set(STR2CSTR(arg1)));
 424.208 ++    return INT2NUM(scr_set(StringValuePtr(arg1)));
 424.209 + }
 424.210 + #endif
 424.211 + static VALUE rbncurs_setscrreg(VALUE dummy, VALUE arg1, VALUE arg2) {
 424.212 +@@ -1352,7 +1352,7 @@
 424.213 +     return INT2NUM(slk_restore());
 424.214 + }
 424.215 + static VALUE rbncurs_slk_set(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 424.216 +-    return INT2NUM(slk_set(NUM2INT(arg1),  STR2CSTR(arg2),  NUM2INT(arg3)));
 424.217 ++    return INT2NUM(slk_set(NUM2INT(arg1),  StringValuePtr(arg2),  NUM2INT(arg3)));
 424.218 + }
 424.219 + static VALUE rbncurs_slk_touch(VALUE dummy) {
 424.220 +     return INT2NUM(slk_touch());
 424.221 +@@ -1383,17 +1383,17 @@
 424.222 + }
 424.223 + #ifdef HAVE_TIGETFLAG
 424.224 + static VALUE rbncurs_tigetflag(VALUE dummy, VALUE arg1) {
 424.225 +-    return INT2NUM(tigetflag(STR2CSTR(arg1)));
 424.226 ++    return INT2NUM(tigetflag(StringValuePtr(arg1)));
 424.227 + }
 424.228 + #endif
 424.229 + #ifdef HAVE_TIGETNUM
 424.230 + static VALUE rbncurs_tigetnum(VALUE dummy, VALUE arg1) {
 424.231 +-    return INT2NUM(tigetnum(STR2CSTR(arg1)));
 424.232 ++    return INT2NUM(tigetnum(StringValuePtr(arg1)));
 424.233 + }
 424.234 + #endif
 424.235 + #ifdef HAVE_TIGETSTR
 424.236 + static VALUE rbncurs_tigetstr(VALUE dummy, VALUE arg1) {
 424.237 +-    return rb_str_new2(tigetstr(STR2CSTR(arg1)));
 424.238 ++    return rb_str_new2(tigetstr(StringValuePtr(arg1)));
 424.239 + }
 424.240 + #endif
 424.241 + static VALUE rbncurs_timeout(VALUE dummy, VALUE arg1) {
 424.242 +@@ -1438,10 +1438,10 @@
 424.243 +     return return_value;
 424.244 + }
 424.245 + static VALUE rbncurs_waddnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 424.246 +-    return INT2NUM(waddnstr(get_window(arg1),  STR2CSTR(arg2),  NUM2INT(arg3)));
 424.247 ++    return INT2NUM(waddnstr(get_window(arg1),  StringValuePtr(arg2),  NUM2INT(arg3)));
 424.248 + }
 424.249 + static VALUE rbncurs_waddstr(VALUE dummy, VALUE arg1, VALUE arg2) {
 424.250 +-    return INT2NUM(waddstr(get_window(arg1),  STR2CSTR(arg2)));
 424.251 ++    return INT2NUM(waddstr(get_window(arg1),  StringValuePtr(arg2)));
 424.252 + }
 424.253 + static VALUE rbncurs_wattron(VALUE dummy, VALUE arg1, VALUE arg2) {
 424.254 +     return INT2NUM(wattron(get_window(arg1),  NUM2INT(arg2)));
 424.255 +@@ -1514,10 +1514,10 @@
 424.256 +     return INT2NUM(winsertln(get_window(arg1)));
 424.257 + }
 424.258 + static VALUE rbncurs_winsnstr(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 424.259 +-    return INT2NUM(winsnstr(get_window(arg1),  STR2CSTR(arg2),  NUM2INT(arg3)));
 424.260 ++    return INT2NUM(winsnstr(get_window(arg1),  StringValuePtr(arg2),  NUM2INT(arg3)));
 424.261 + }
 424.262 + static VALUE rbncurs_winsstr(VALUE dummy, VALUE arg1, VALUE arg2) {
 424.263 +-    return INT2NUM(winsstr(get_window(arg1),  STR2CSTR(arg2)));
 424.264 ++    return INT2NUM(winsstr(get_window(arg1),  StringValuePtr(arg2)));
 424.265 + }
 424.266 + static VALUE rbncurs_wmove(VALUE dummy, VALUE arg1, VALUE arg2, VALUE arg3) {
 424.267 +     return INT2NUM(wmove(get_window(arg1),  NUM2INT(arg2),  NUM2INT(arg3)));
 424.268 +@@ -1619,7 +1619,7 @@
 424.269 + { return rb_str_new2(unctrl(NUM2ULONG(ch))); }
 424.270 + static VALUE rbncurs_newterm(VALUE dummy, VALUE rb_type, VALUE rb_outfd, VALUE rb_infd)
 424.271 + {
 424.272 +-    char * type = (rb_type == Qnil) ? (char*)0 : STR2CSTR(rb_type);
 424.273 ++    char * type = (rb_type == Qnil) ? (char*)0 : StringValuePtr(rb_type);
 424.274 +     int outfd = NUM2INT(rb_funcall(rb_outfd, rb_intern("to_i"), 0));
 424.275 +     int infd  = NUM2INT(rb_funcall(rb_infd, rb_intern("to_i"), 0));
 424.276 +     VALUE rb_screen =
 424.277 +@@ -2277,7 +2277,7 @@
 424.278 + #ifdef HAVE_MCPRINT
 424.279 + static VALUE rbncurs_mcprint(VALUE dummy, VALUE data, VALUE len)
 424.280 + {
 424.281 +-    return INT2NUM(mcprint(STR2CSTR(data), NUM2INT(len)));
 424.282 ++    return INT2NUM(mcprint(StringValuePtr(data), NUM2INT(len)));
 424.283 + }
 424.284 + #endif
 424.285 + #ifdef HAVE_HAS_KEY
 424.286 +@@ -2378,9 +2378,9 @@
 424.287 +                  " and a String");
 424.288 +         return Qnil;
 424.289 +     }
 424.290 ++	VALUE tmp = rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1, argv + 1);
 424.291 +     wprintw(get_window(argv[0]), "%s",
 424.292 +-            STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc-1,
 424.293 +-                              argv + 1)));
 424.294 ++		StringValuePtr(tmp));
 424.295 +     return Qnil;
 424.296 + }
 424.297 + 
 424.298 +@@ -2394,14 +2394,14 @@
 424.299 +         return Qnil;
 424.300 +     }
 424.301 +     _tracef("%s",
 424.302 +-            STR2CSTR(rb_funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv)));
 424.303 ++            StringValuePtr(funcall3(rb_mKernel, rb_intern("sprintf"), argc, argv)));
 424.304 +     return Qnil;
 424.305 + }
 424.306 + #endif /* HAVE__TRACEF */
 424.307 + #ifdef HAVE__TRACEDUMP
 424.308 + static VALUE rbncurs_tracedump(VALUE dummy, VALUE rb_label, VALUE rb_win)
 424.309 + {
 424.310 +-    _tracedump(STR2CSTR(rb_label), get_window(rb_win));
 424.311 ++    _tracedump(StringValuePtr(rb_label), get_window(rb_win));
 424.312 + }
 424.313 + #endif /* HAVE__TRACEDUMP */
 424.314 + #ifdef HAVE__TRACEATTR
 424.315 +@@ -2706,7 +2706,7 @@
 424.316 + 
 424.317 + #ifdef HAVE_LOCALE_H
 424.318 + static VALUE rbncurs_setlocale(VALUE dummy, VALUE category, VALUE locale)
 424.319 +-{   return rb_str_new2(setlocale(NUM2INT(category), STR2CSTR(locale)));}
 424.320 ++{   return rb_str_new2(setlocale(NUM2INT(category), StringValuePtr(locale)));}
 424.321 + #endif
 424.322 + 
 424.323 + static void init_safe_functions(void)
   425.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   425.2 +++ b/ruby-ncurses/stuff/patches/Werror-format-security.patch	Thu May 10 21:12:00 2018 +0300
   425.3 @@ -0,0 +1,12 @@
   425.4 +diff -Naur ncurses-ruby-1.3.1/form_wrap.c ncurses-ruby-1.3.1.format/form_wrap.c
   425.5 +--- ncurses-ruby-1.3.1/form_wrap.c	2014-02-03 11:31:39.049867878 +0100
   425.6 ++++ ncurses-ruby-1.3.1.format/form_wrap.c	2014-02-03 11:44:37.001008654 +0100
   425.7 +@@ -1132,7 +1132,7 @@
   425.8 + 		  char msg[500];
   425.9 + 		  snprintf(msg, 500, "The validation functions for this field type need %d additional arguments.",(int)(NUM2INT(argc)-1));
  425.10 + 		  msg[499]=0;
  425.11 +-		  rb_raise(rb_eArgError, msg);	
  425.12 ++		  rb_raise(rb_eArgError, "%s", msg);	
  425.13 + 		}
  425.14 + 	 } 
  425.15 +   }
   426.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   426.2 +++ b/ruby-ncurses/stuff/patches/ruby-ncurses-fix-missing-tz-prototypes.patch	Thu May 10 21:12:00 2018 +0300
   426.3 @@ -0,0 +1,34 @@
   426.4 +From d3e59724601b2aabb231f2e12e16ebf00ba79ab1 Mon Sep 17 00:00:00 2001
   426.5 +From: Caleb Marble <cm@marblenix.com>
   426.6 +Date: Sun, 2 Mar 2014 13:53:05 -0600
   426.7 +Subject: [PATCH] modified:   ext/ncurses/ncurses_wrap.h
   426.8 +MIME-Version: 1.0
   426.9 +Content-Type: text/plain; charset=UTF-8
  426.10 +Content-Transfer-Encoding: 8bit
  426.11 +
  426.12 +Fixes the following compiler error:
  426.13 +
  426.14 +ext/ncurses/ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’:
  426.15 +ext/ncurses/ncurses_wrap.c:807:12: error: variable ‘tz’ has initializer but incomplete type
  426.16 +     struct timezone tz = {0,0};
  426.17 +
  426.18 +Also closes #6
  426.19 +---
  426.20 + ncurses_wrap.h | 1 +
  426.21 + 1 file changed, 1 insertion(+)
  426.22 +
  426.23 +diff --git a/ncurses_wrap.h b/ncurses_wrap.h
  426.24 +index 85da4f8..92583c0 100644
  426.25 +--- a/ncurses_wrap.h
  426.26 ++++ b/ncurses_wrap.h
  426.27 +@@ -84,6 +84,7 @@ int close(int);
  426.28 + #endif
  426.29 + 
  426.30 + #include <ruby.h>
  426.31 ++#include <sys/time.h>
  426.32 + 
  426.33 + extern VALUE mNcurses;  /* module Ncurses */
  426.34 + extern VALUE cWINDOW;   /* class Ncurses::WINDOW */
  426.35 +-- 
  426.36 +1.9.1
  426.37 +
   427.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   427.2 +++ b/ruby-ncurses/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   427.3 @@ -0,0 +1,3 @@
   427.4 +# use fedora patches
   427.5 +STR2CSTR-deprecated.patch
   427.6 +ruby-ncurses-fix-missing-tz-prototypes.patch
   428.1 --- a/ruby-ncurses/stuff/ruby-ncurses-fix-missing-tz-prototypes.patch	Wed May 09 17:03:28 2018 +0300
   428.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   428.3 @@ -1,34 +0,0 @@
   428.4 -From d3e59724601b2aabb231f2e12e16ebf00ba79ab1 Mon Sep 17 00:00:00 2001
   428.5 -From: Caleb Marble <cm@marblenix.com>
   428.6 -Date: Sun, 2 Mar 2014 13:53:05 -0600
   428.7 -Subject: [PATCH] modified:   ext/ncurses/ncurses_wrap.h
   428.8 -MIME-Version: 1.0
   428.9 -Content-Type: text/plain; charset=UTF-8
  428.10 -Content-Transfer-Encoding: 8bit
  428.11 -
  428.12 -Fixes the following compiler error:
  428.13 -
  428.14 -ext/ncurses/ncurses_wrap.c: In function ‘rbncurshelper_nonblocking_wgetch’:
  428.15 -ext/ncurses/ncurses_wrap.c:807:12: error: variable ‘tz’ has initializer but incomplete type
  428.16 -     struct timezone tz = {0,0};
  428.17 -
  428.18 -Also closes #6
  428.19 ----
  428.20 - ncurses_wrap.h | 1 +
  428.21 - 1 file changed, 1 insertion(+)
  428.22 -
  428.23 -diff --git a/ncurses_wrap.h b/ncurses_wrap.h
  428.24 -index 85da4f8..92583c0 100644
  428.25 ---- a/ncurses_wrap.h
  428.26 -+++ b/ncurses_wrap.h
  428.27 -@@ -84,6 +84,7 @@ int close(int);
  428.28 - #endif
  428.29 - 
  428.30 - #include <ruby.h>
  428.31 -+#include <sys/time.h>
  428.32 - 
  428.33 - extern VALUE mNcurses;  /* module Ncurses */
  428.34 - extern VALUE cWINDOW;   /* class Ncurses::WINDOW */
  428.35 --- 
  428.36 -1.9.1
  428.37 -
   429.1 --- a/sane-backends/receipt	Wed May 09 17:03:28 2018 +0300
   429.2 +++ b/sane-backends/receipt	Thu May 10 21:12:00 2018 +0300
   429.3 @@ -17,9 +17,6 @@
   429.4  
   429.5  compile_rules() {
   429.6  	sed -i 's|prefix}/doc|prefix}/share/doc|' configure
   429.7 -	patch -Np1 -i $stuff/libv4l-0.8.3.patch
   429.8 -	# fix https://bugs.archlinux.org/task/26114
   429.9 -	patch -Np1 -i $stuff/xerox_mfp_fix_usb_devices.patch
  429.10  
  429.11  	./configure $CONFIGURE_ARGS &&
  429.12  	fix libtool &&
   430.1 --- a/sane-backends/stuff/libv4l-0.8.3.patch	Wed May 09 17:03:28 2018 +0300
   430.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   430.3 @@ -1,64 +0,0 @@
   430.4 -From 26c69b228b29f612faf4b0cc85db969ee7cc4ea6 Mon Sep 17 00:00:00 2001
   430.5 -From: Nils Philippsen <nils@redhat.com>
   430.6 -Date: Mon, 14 Mar 2011 13:35:05 +0100
   430.7 -Subject: [PATCH] patch: v4l
   430.8 -
   430.9 -Squashed commit of the following:
  430.10 -
  430.11 -commit 23381932c76846191b42a48e505b37cd74711265
  430.12 -Author: Julien BLACHE <jb@jblache.org>
  430.13 -Date:   Wed Feb 16 19:37:43 2011 +0100
  430.14 -
  430.15 -    Fix v4l build with libv4l 0.8.3+
  430.16 -
  430.17 -    (cherry picked from commit c5ca46c2d1be78c651afb843cc834cf2b5b24953)
  430.18 -
  430.19 -    Conflicts:
  430.20 -
  430.21 -    	ChangeLog
  430.22 -
  430.23 -    Signed-off-by: Nils Philippsen <nils@redhat.com>
  430.24 ----
  430.25 - backend/v4l.c |    3 +--
  430.26 - backend/v4l.h |    3 ++-
  430.27 - 2 files changed, 3 insertions(+), 3 deletions(-)
  430.28 -
  430.29 -diff --git a/backend/v4l.c b/backend/v4l.c
  430.30 -index 6510ef0..38595ed 100644
  430.31 ---- a/backend/v4l.c
  430.32 -+++ b/backend/v4l.c
  430.33 -@@ -84,9 +84,8 @@
  430.34 - #include "../include/sane/sanei_config.h"
  430.35 - #define V4L_CONFIG_FILE "v4l.conf"
  430.36 - 
  430.37 --#include "v4l.h"
  430.38 --
  430.39 - #include <libv4l1.h>
  430.40 -+#include "v4l.h"
  430.41 - 
  430.42 - static const SANE_Device **devlist = NULL;
  430.43 - static int num_devices;
  430.44 -diff --git a/backend/v4l.h b/backend/v4l.h
  430.45 -index 588b96e..6aee586 100644
  430.46 ---- a/backend/v4l.h
  430.47 -+++ b/backend/v4l.h
  430.48 -@@ -29,6 +29,7 @@
  430.49 - #ifndef v4l_h
  430.50 - #define v4l_h
  430.51 - 
  430.52 -+#ifndef __LINUX_VIDEODEV_H
  430.53 - /* Kernel interface */
  430.54 - /* Only the stuff we need. For more features, more defines are needed */
  430.55 - 
  430.56 -@@ -165,7 +166,7 @@ struct video_channel
  430.57 - 
  430.58 - 
  430.59 - /* end of kernel interface */
  430.60 --
  430.61 -+#endif /* !__LINUX_VIDEODEV_H */
  430.62 - 
  430.63 - #include <../include/sane/sane.h>
  430.64 - 
  430.65 --- 
  430.66 -1.7.4
  430.67 -
   431.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   431.2 +++ b/sane-backends/stuff/patches/libv4l-0.8.3.patch	Thu May 10 21:12:00 2018 +0300
   431.3 @@ -0,0 +1,64 @@
   431.4 +From 26c69b228b29f612faf4b0cc85db969ee7cc4ea6 Mon Sep 17 00:00:00 2001
   431.5 +From: Nils Philippsen <nils@redhat.com>
   431.6 +Date: Mon, 14 Mar 2011 13:35:05 +0100
   431.7 +Subject: [PATCH] patch: v4l
   431.8 +
   431.9 +Squashed commit of the following:
  431.10 +
  431.11 +commit 23381932c76846191b42a48e505b37cd74711265
  431.12 +Author: Julien BLACHE <jb@jblache.org>
  431.13 +Date:   Wed Feb 16 19:37:43 2011 +0100
  431.14 +
  431.15 +    Fix v4l build with libv4l 0.8.3+
  431.16 +
  431.17 +    (cherry picked from commit c5ca46c2d1be78c651afb843cc834cf2b5b24953)
  431.18 +
  431.19 +    Conflicts:
  431.20 +
  431.21 +    	ChangeLog
  431.22 +
  431.23 +    Signed-off-by: Nils Philippsen <nils@redhat.com>
  431.24 +---
  431.25 + backend/v4l.c |    3 +--
  431.26 + backend/v4l.h |    3 ++-
  431.27 + 2 files changed, 3 insertions(+), 3 deletions(-)
  431.28 +
  431.29 +diff --git a/backend/v4l.c b/backend/v4l.c
  431.30 +index 6510ef0..38595ed 100644
  431.31 +--- a/backend/v4l.c
  431.32 ++++ b/backend/v4l.c
  431.33 +@@ -84,9 +84,8 @@
  431.34 + #include "../include/sane/sanei_config.h"
  431.35 + #define V4L_CONFIG_FILE "v4l.conf"
  431.36 + 
  431.37 +-#include "v4l.h"
  431.38 +-
  431.39 + #include <libv4l1.h>
  431.40 ++#include "v4l.h"
  431.41 + 
  431.42 + static const SANE_Device **devlist = NULL;
  431.43 + static int num_devices;
  431.44 +diff --git a/backend/v4l.h b/backend/v4l.h
  431.45 +index 588b96e..6aee586 100644
  431.46 +--- a/backend/v4l.h
  431.47 ++++ b/backend/v4l.h
  431.48 +@@ -29,6 +29,7 @@
  431.49 + #ifndef v4l_h
  431.50 + #define v4l_h
  431.51 + 
  431.52 ++#ifndef __LINUX_VIDEODEV_H
  431.53 + /* Kernel interface */
  431.54 + /* Only the stuff we need. For more features, more defines are needed */
  431.55 + 
  431.56 +@@ -165,7 +166,7 @@ struct video_channel
  431.57 + 
  431.58 + 
  431.59 + /* end of kernel interface */
  431.60 +-
  431.61 ++#endif /* !__LINUX_VIDEODEV_H */
  431.62 + 
  431.63 + #include <../include/sane/sane.h>
  431.64 + 
  431.65 +-- 
  431.66 +1.7.4
  431.67 +
   432.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   432.2 +++ b/sane-backends/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   432.3 @@ -0,0 +1,3 @@
   432.4 +libv4l-0.8.3.patch
   432.5 +# fix https://bugs.archlinux.org/task/26114
   432.6 +xerox_mfp_fix_usb_devices.patch
   433.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   433.2 +++ b/sane-backends/stuff/patches/xerox_mfp_fix_usb_devices.patch	Thu May 10 21:12:00 2018 +0300
   433.3 @@ -0,0 +1,67 @@
   433.4 +commit 5ea227caeacd504b64eef301e83fa63e0a25b3f7
   433.5 +Author: Alex Belkin <abc@telekom.ru>
   433.6 +Date:   Tue Mar 8 17:57:19 2011 +0300
   433.7 +
   433.8 +    keep usb device by default (correct for bug introduced by tcp sub-backend
   433.9 +
  433.10 +diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c
  433.11 +index e08b50f..d4672a7 100644
  433.12 +--- a/backend/xerox_mfp.c
  433.13 ++++ b/backend/xerox_mfp.c
  433.14 +@@ -37,10 +37,10 @@
  433.15 + static const SANE_Device **devlist = NULL;	/* sane_get_devices array */
  433.16 + static struct device *devices_head = NULL;	/* sane_get_devices list */
  433.17 +
  433.18 +-transport available_transports[] = {
  433.19 ++enum { TRANSPORT_USB, TRANSPORT_TCP, TRANSPORTS_MAX };
  433.20 ++transport available_transports[TRANSPORTS_MAX] = {
  433.21 +     { "usb", usb_dev_request, usb_dev_open, usb_dev_close, usb_configure_device },
  433.22 +     { "tcp", tcp_dev_request, tcp_dev_open, tcp_dev_close, tcp_configure_device },
  433.23 +-    { 0 }
  433.24 + };
  433.25 +
  433.26 + static int resolv_state(int state)
  433.27 +@@ -824,7 +824,13 @@ free_devices (void)
  433.28 +   devices_head = NULL;
  433.29 + }
  433.30 +
  433.31 +-/* SANE API ignores return code of this callback */
  433.32 ++static transport *tr_from_devname(SANE_String_Const devname)
  433.33 ++{
  433.34 ++  if (strncmp("tcp", devname, 3) == 0)
  433.35 ++    return &available_transports[TRANSPORT_TCP];
  433.36 ++  return &available_transports[TRANSPORT_USB];
  433.37 ++}
  433.38 ++
  433.39 + static SANE_Status
  433.40 + list_one_device (SANE_String_Const devname)
  433.41 + {
  433.42 +@@ -839,12 +845,7 @@ list_one_device (SANE_String_Const devname)
  433.43 +       return SANE_STATUS_GOOD;
  433.44 +   }
  433.45 +
  433.46 +-  for (tr = available_transports; tr->ttype; tr++) {
  433.47 +-    if (!strncmp (devname, tr->ttype, strlen(tr->ttype)))
  433.48 +-      break;
  433.49 +-  }
  433.50 +-  if (!tr->ttype)
  433.51 +-    return SANE_STATUS_INVAL;
  433.52 ++  tr = tr_from_devname(devname);
  433.53 +
  433.54 +   dev = calloc (1, sizeof (struct device));
  433.55 +   if (dev == NULL)
  433.56 +@@ -878,13 +879,7 @@ list_one_device (SANE_String_Const devname)
  433.57 + static SANE_Status
  433.58 + list_conf_devices (UNUSED (SANEI_Config * config), const char *devname)
  433.59 + {
  433.60 +-    transport *tr;
  433.61 +-
  433.62 +-    for (tr = available_transports; tr->ttype; tr++) {
  433.63 +-	if (!strncmp (devname, tr->ttype, strlen(tr->ttype)))
  433.64 +-	    return tr->configure_device(devname, list_one_device);
  433.65 +-    }
  433.66 +-    return	SANE_STATUS_INVAL;
  433.67 ++  return tr_from_devname(devname)->configure_device(devname, list_one_device);
  433.68 + }
  433.69 +
  433.70 + SANE_Status
   434.1 --- a/sane-backends/stuff/xerox_mfp_fix_usb_devices.patch	Wed May 09 17:03:28 2018 +0300
   434.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   434.3 @@ -1,67 +0,0 @@
   434.4 -commit 5ea227caeacd504b64eef301e83fa63e0a25b3f7
   434.5 -Author: Alex Belkin <abc@telekom.ru>
   434.6 -Date:   Tue Mar 8 17:57:19 2011 +0300
   434.7 -
   434.8 -    keep usb device by default (correct for bug introduced by tcp sub-backend
   434.9 -
  434.10 -diff --git a/backend/xerox_mfp.c b/backend/xerox_mfp.c
  434.11 -index e08b50f..d4672a7 100644
  434.12 ---- a/backend/xerox_mfp.c
  434.13 -+++ b/backend/xerox_mfp.c
  434.14 -@@ -37,10 +37,10 @@
  434.15 - static const SANE_Device **devlist = NULL;	/* sane_get_devices array */
  434.16 - static struct device *devices_head = NULL;	/* sane_get_devices list */
  434.17 -
  434.18 --transport available_transports[] = {
  434.19 -+enum { TRANSPORT_USB, TRANSPORT_TCP, TRANSPORTS_MAX };
  434.20 -+transport available_transports[TRANSPORTS_MAX] = {
  434.21 -     { "usb", usb_dev_request, usb_dev_open, usb_dev_close, usb_configure_device },
  434.22 -     { "tcp", tcp_dev_request, tcp_dev_open, tcp_dev_close, tcp_configure_device },
  434.23 --    { 0 }
  434.24 - };
  434.25 -
  434.26 - static int resolv_state(int state)
  434.27 -@@ -824,7 +824,13 @@ free_devices (void)
  434.28 -   devices_head = NULL;
  434.29 - }
  434.30 -
  434.31 --/* SANE API ignores return code of this callback */
  434.32 -+static transport *tr_from_devname(SANE_String_Const devname)
  434.33 -+{
  434.34 -+  if (strncmp("tcp", devname, 3) == 0)
  434.35 -+    return &available_transports[TRANSPORT_TCP];
  434.36 -+  return &available_transports[TRANSPORT_USB];
  434.37 -+}
  434.38 -+
  434.39 - static SANE_Status
  434.40 - list_one_device (SANE_String_Const devname)
  434.41 - {
  434.42 -@@ -839,12 +845,7 @@ list_one_device (SANE_String_Const devname)
  434.43 -       return SANE_STATUS_GOOD;
  434.44 -   }
  434.45 -
  434.46 --  for (tr = available_transports; tr->ttype; tr++) {
  434.47 --    if (!strncmp (devname, tr->ttype, strlen(tr->ttype)))
  434.48 --      break;
  434.49 --  }
  434.50 --  if (!tr->ttype)
  434.51 --    return SANE_STATUS_INVAL;
  434.52 -+  tr = tr_from_devname(devname);
  434.53 -
  434.54 -   dev = calloc (1, sizeof (struct device));
  434.55 -   if (dev == NULL)
  434.56 -@@ -878,13 +879,7 @@ list_one_device (SANE_String_Const devname)
  434.57 - static SANE_Status
  434.58 - list_conf_devices (UNUSED (SANEI_Config * config), const char *devname)
  434.59 - {
  434.60 --    transport *tr;
  434.61 --
  434.62 --    for (tr = available_transports; tr->ttype; tr++) {
  434.63 --	if (!strncmp (devname, tr->ttype, strlen(tr->ttype)))
  434.64 --	    return tr->configure_device(devname, list_one_device);
  434.65 --    }
  434.66 --    return	SANE_STATUS_INVAL;
  434.67 -+  return tr_from_devname(devname)->configure_device(devname, list_one_device);
  434.68 - }
  434.69 -
  434.70 - SANE_Status
   435.1 --- a/screenfetch/receipt	Wed May 09 17:03:28 2018 +0300
   435.2 +++ b/screenfetch/receipt	Thu May 10 21:12:00 2018 +0300
   435.3 @@ -16,8 +16,6 @@
   435.4  # Rules to configure and make the package.
   435.5  compile_rules()
   435.6  {
   435.7 -	# patch for SliTaz (use basic artwork - job for artwork team?)
   435.8 -	patch -i ../../stuff/slitaz.patch
   435.9  	mkdir -p $install/usr/bin
  435.10  	cp screenfetch-dev $install/usr/bin/screenfetch
  435.11  }
   436.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   436.2 +++ b/screenfetch/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   436.3 @@ -0,0 +1,2 @@
   436.4 +# patch for SliTaz (use basic artwork - job for artwork team?)
   436.5 +slitaz.patch
   437.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   437.2 +++ b/screenfetch/stuff/patches/slitaz.patch	Thu May 10 21:12:00 2018 +0300
   437.3 @@ -0,0 +1,98 @@
   437.4 +--- screenfetch-dev.orig	2014-07-09 18:56:48.000000000 +0100
   437.5 ++++ screenfetch-dev	2014-07-13 13:17:37.000000000 +0100
   437.6 +@@ -207,8 +207,8 @@
   437.7 + 	printf "	CrunchBang, Raspbian, elementary OS, Fedora, Frugalware, Fuduntu, Gentoo,\n"
   437.8 + 	printf "	Funtoo, Jiyuu Linux, LinuxDeepin, Kali Linux, Mageia, Mandriva, Manjaro,\n"
   437.9 + 	printf "	Linux Mint, LMDE, openSUSE, Parabola GNU/Linux-libre, Peppermint,\n"
  437.10 +-	printf "	Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SolusOS,\n"
  437.11 +-	printf "	TinyCore, Trisquel, Ubuntu and Viperr.\n\n"
  437.12 ++	printf "	Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SliTaz,\n"
  437.13 ++	printf "	SolusOS, TinyCore, Trisquel, Ubuntu and Viperr.\n\n"
  437.14 + 	printf "${underline}Other Supported Systems${c0}:\n"
  437.15 + 	printf "	Mac OS X, FreeBSD, DragonFlyBSD, NetBSD, OpenBSD, Android and Cygwin.\n\n"
  437.16 + 	printf "${underline}Supported Desktop Managers${c0}:\n"
  437.17 +@@ -440,6 +440,8 @@
  437.18 + 				distro="Sabayon"
  437.19 + 			elif [[ "${distro_detect}" == "SolusOS" ]]; then
  437.20 + 				distro="SolusOS"
  437.21 ++			elif [[ "${distro_detect}" == "SliTaz" ]]; then
  437.22 ++				distro="SliTaz"
  437.23 + 			elif [[ "${distro_detect}" == "Trisquel" ]]; then
  437.24 + 				distro="Trisquel"
  437.25 + 			elif [[ "${distro_detect}" == "Ubuntu" ]]; then
  437.26 +@@ -535,6 +537,7 @@
  437.27 + 					elif [ -f /etc/redhat-release ] && grep -q "Red Hat" /etc/redhat-release; then distro="Red Hat Enterprise Linux"
  437.28 + 					elif [ -f /etc/redhat-release ] && grep -q "CentOS" /etc/redhat-release; then distro="CentOS"
  437.29 + 					elif [ -f /etc/slackware-version ]; then distro="Slackware"
  437.30 ++					elif [ -f /etc/slitaz-release ]; then distro="SliTaz"
  437.31 + 					elif [ -f /usr/share/doc/tc/release.txt ]; then distro="TinyCore"
  437.32 + 					elif [ -f /etc/sabayon-edition ]; then distro="Sabayon"; fi
  437.33 + 				else
  437.34 +@@ -645,6 +648,7 @@
  437.35 + 		gentoo) distro="Gentoo" ;;
  437.36 + 		funtoo) distro="Funtoo" ;;
  437.37 + 		slackware) distro="Slackware" ;;
  437.38 ++		slitaz) distro="SliTaz" ;;
  437.39 + 		frugalware) distro="Frugalware" ;;
  437.40 + 		peppermint) distro="Peppermint" ;;
  437.41 + 		solusos) distro="SolusOS" ;;
  437.42 +@@ -729,6 +733,7 @@
  437.43 + 	case $distro in
  437.44 + 		'Arch Linux'|'Parabola GNU/Linux-libre'|'Chakra'|'Manjaro'|'Antergos'|'KaOS') pkgs=$(pacman -Qq | wc -l) ;;
  437.45 + 		'Frugalware') pkgs=$(pacman-g2 -Q | wc -l) ;;
  437.46 ++		'SliTaz') pkgs=$(tazpkg list | wc -l) ;;
  437.47 + 		'Fuduntu'|'Ubuntu'|'Mint'|'SolusOS'|'Debian'|'Raspbian'|'LMDE'|'CrunchBang'|'Peppermint'|'LinuxDeepin'|'Kali Linux'|'Trisquel'|'elementary OS') pkgs=$(dpkg --get-selections | wc -l) ;;
  437.48 + 		'Slackware') pkgs=$(ls -1 /var/log/packages | wc -l) ;;
  437.49 + 		'Gentoo'|'Sabayon'|'Funtoo') pkgs=$(ls -d /var/db/pkg/*/* | wc -l) ;;
  437.50 +@@ -2967,6 +2972,33 @@
  437.51 + "${c2}          ...............             %s")
  437.52 +                 ;;
  437.53 + 
  437.54 ++		"#SliTaz")
  437.55 ++			if [[ "$no_color" != "1" ]]; then
  437.56 ++				c1=$(getColor 'light grey') # Light Grey
  437.57 ++			fi
  437.58 ++			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
  437.59 ++			startline="0"
  437.60 ++			fulloutput=(                                 
  437.61 ++"${c1}              #          #  	    %s"       
  437.62 ++"${c1}             #           ##    #   %s"  
  437.63 ++"${c1}      ##   ##             ###  ##  %s" 
  437.64 ++"${c1}     ##  ###               ###  ## %s"
  437.65 ++"${c1}    ##  ###                 ##  ## %s"
  437.66 ++"${c1}   ### ####     #####      #### ###%s"
  437.67 ++"${c1}  ####  #####  #######  #####  ####%s"
  437.68 ++"${c1}   ############################    %s"
  437.69 ++"${c1}       ######################      %s"   
  437.70 ++"${c1} ################################# %s"
  437.71 ++"${c1} ##    ################ ####    ## %s"
  437.72 ++"${c1} #  ###    ############    ###  ## %s"
  437.73 ++"${c1} #  ##     ###########     ###  #  %s"
  437.74 ++"${c1} #   #     ###########     #       %s"    
  437.75 ++"${c1}            ########               %s"  
  437.76 ++"			           %s"
  437.77 ++"                                  %s"
  437.78 ++"                                  %s")  
  437.79 ++		;;
  437.80 ++
  437.81 + 
  437.82 +                 "KaOS")
  437.83 + 	if [[ "$no_color" != "1" ]]; then
  437.84 +@@ -3086,7 +3118,7 @@
  437.85 + 			if [[ "$no_color" != "1" ]]; then
  437.86 + 				c1=$(getColor 'white') # White
  437.87 + 				c2=$(getColor 'dark grey') # Light Gray
  437.88 +-				c3=$(getColor 'yellow') # Light Yellow
  437.89 ++				c3=$(getColor 'light red') # Light Red
  437.90 + 			fi
  437.91 + 			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
  437.92 + 			startline="0"
  437.93 +@@ -3188,7 +3220,7 @@
  437.94 + 		"Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux"|"Antergos"|"KaOS") labelcolor=$(getColor 'light blue');;
  437.95 + 		"Arch Linux"|"Frugalware"|"Mageia") labelcolor=$(getColor 'light cyan');;
  437.96 + 		"Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android") labelcolor=$(getColor 'light green');;
  437.97 +-		"Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');;
  437.98 ++		"Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"SliTaz"|"BackTrack Linux") labelcolor=$(getColor 'light red');;
  437.99 + 		"CrunchBang"|"SolusOS"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');;
 437.100 + 		"Gentoo"|"Parabola GNU/Linux-libre"|"Funtoo"|"Funtoo-text") labelcolor=$(getColor 'light purple');;
 437.101 + 		"CentOS"|"Ubuntu"|*) labelcolor=$(getColor 'yellow');;
   438.1 --- a/screenfetch/stuff/slitaz.patch	Wed May 09 17:03:28 2018 +0300
   438.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   438.3 @@ -1,98 +0,0 @@
   438.4 ---- screenfetch-dev.orig	2014-07-09 18:56:48.000000000 +0100
   438.5 -+++ screenfetch-dev	2014-07-13 13:17:37.000000000 +0100
   438.6 -@@ -207,8 +207,8 @@
   438.7 - 	printf "	CrunchBang, Raspbian, elementary OS, Fedora, Frugalware, Fuduntu, Gentoo,\n"
   438.8 - 	printf "	Funtoo, Jiyuu Linux, LinuxDeepin, Kali Linux, Mageia, Mandriva, Manjaro,\n"
   438.9 - 	printf "	Linux Mint, LMDE, openSUSE, Parabola GNU/Linux-libre, Peppermint,\n"
  438.10 --	printf "	Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SolusOS,\n"
  438.11 --	printf "	TinyCore, Trisquel, Ubuntu and Viperr.\n\n"
  438.12 -+	printf "	Red Hat Enterprise Linux, Sabayon, Scientific Linux, Slackware, SliTaz,\n"
  438.13 -+	printf "	SolusOS, TinyCore, Trisquel, Ubuntu and Viperr.\n\n"
  438.14 - 	printf "${underline}Other Supported Systems${c0}:\n"
  438.15 - 	printf "	Mac OS X, FreeBSD, DragonFlyBSD, NetBSD, OpenBSD, Android and Cygwin.\n\n"
  438.16 - 	printf "${underline}Supported Desktop Managers${c0}:\n"
  438.17 -@@ -440,6 +440,8 @@
  438.18 - 				distro="Sabayon"
  438.19 - 			elif [[ "${distro_detect}" == "SolusOS" ]]; then
  438.20 - 				distro="SolusOS"
  438.21 -+			elif [[ "${distro_detect}" == "SliTaz" ]]; then
  438.22 -+				distro="SliTaz"
  438.23 - 			elif [[ "${distro_detect}" == "Trisquel" ]]; then
  438.24 - 				distro="Trisquel"
  438.25 - 			elif [[ "${distro_detect}" == "Ubuntu" ]]; then
  438.26 -@@ -535,6 +537,7 @@
  438.27 - 					elif [ -f /etc/redhat-release ] && grep -q "Red Hat" /etc/redhat-release; then distro="Red Hat Enterprise Linux"
  438.28 - 					elif [ -f /etc/redhat-release ] && grep -q "CentOS" /etc/redhat-release; then distro="CentOS"
  438.29 - 					elif [ -f /etc/slackware-version ]; then distro="Slackware"
  438.30 -+					elif [ -f /etc/slitaz-release ]; then distro="SliTaz"
  438.31 - 					elif [ -f /usr/share/doc/tc/release.txt ]; then distro="TinyCore"
  438.32 - 					elif [ -f /etc/sabayon-edition ]; then distro="Sabayon"; fi
  438.33 - 				else
  438.34 -@@ -645,6 +648,7 @@
  438.35 - 		gentoo) distro="Gentoo" ;;
  438.36 - 		funtoo) distro="Funtoo" ;;
  438.37 - 		slackware) distro="Slackware" ;;
  438.38 -+		slitaz) distro="SliTaz" ;;
  438.39 - 		frugalware) distro="Frugalware" ;;
  438.40 - 		peppermint) distro="Peppermint" ;;
  438.41 - 		solusos) distro="SolusOS" ;;
  438.42 -@@ -729,6 +733,7 @@
  438.43 - 	case $distro in
  438.44 - 		'Arch Linux'|'Parabola GNU/Linux-libre'|'Chakra'|'Manjaro'|'Antergos'|'KaOS') pkgs=$(pacman -Qq | wc -l) ;;
  438.45 - 		'Frugalware') pkgs=$(pacman-g2 -Q | wc -l) ;;
  438.46 -+		'SliTaz') pkgs=$(tazpkg list | wc -l) ;;
  438.47 - 		'Fuduntu'|'Ubuntu'|'Mint'|'SolusOS'|'Debian'|'Raspbian'|'LMDE'|'CrunchBang'|'Peppermint'|'LinuxDeepin'|'Kali Linux'|'Trisquel'|'elementary OS') pkgs=$(dpkg --get-selections | wc -l) ;;
  438.48 - 		'Slackware') pkgs=$(ls -1 /var/log/packages | wc -l) ;;
  438.49 - 		'Gentoo'|'Sabayon'|'Funtoo') pkgs=$(ls -d /var/db/pkg/*/* | wc -l) ;;
  438.50 -@@ -2967,6 +2972,33 @@
  438.51 - "${c2}          ...............             %s")
  438.52 -                 ;;
  438.53 - 
  438.54 -+		"#SliTaz")
  438.55 -+			if [[ "$no_color" != "1" ]]; then
  438.56 -+				c1=$(getColor 'light grey') # Light Grey
  438.57 -+			fi
  438.58 -+			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; fi
  438.59 -+			startline="0"
  438.60 -+			fulloutput=(                                 
  438.61 -+"${c1}              #          #  	    %s"       
  438.62 -+"${c1}             #           ##    #   %s"  
  438.63 -+"${c1}      ##   ##             ###  ##  %s" 
  438.64 -+"${c1}     ##  ###               ###  ## %s"
  438.65 -+"${c1}    ##  ###                 ##  ## %s"
  438.66 -+"${c1}   ### ####     #####      #### ###%s"
  438.67 -+"${c1}  ####  #####  #######  #####  ####%s"
  438.68 -+"${c1}   ############################    %s"
  438.69 -+"${c1}       ######################      %s"   
  438.70 -+"${c1} ################################# %s"
  438.71 -+"${c1} ##    ################ ####    ## %s"
  438.72 -+"${c1} #  ###    ############    ###  ## %s"
  438.73 -+"${c1} #  ##     ###########     ###  #  %s"
  438.74 -+"${c1} #   #     ###########     #       %s"    
  438.75 -+"${c1}            ########               %s"  
  438.76 -+"			           %s"
  438.77 -+"                                  %s"
  438.78 -+"                                  %s")  
  438.79 -+		;;
  438.80 -+
  438.81 - 
  438.82 -                 "KaOS")
  438.83 - 	if [[ "$no_color" != "1" ]]; then
  438.84 -@@ -3086,7 +3118,7 @@
  438.85 - 			if [[ "$no_color" != "1" ]]; then
  438.86 - 				c1=$(getColor 'white') # White
  438.87 - 				c2=$(getColor 'dark grey') # Light Gray
  438.88 --				c3=$(getColor 'yellow') # Light Yellow
  438.89 -+				c3=$(getColor 'light red') # Light Red
  438.90 - 			fi
  438.91 - 			if [ -n "${my_lcolor}" ]; then c1="${my_lcolor}"; c2="${my_lcolor}"; c3="${my_lcolor}"; fi
  438.92 - 			startline="0"
  438.93 -@@ -3188,7 +3220,7 @@
  438.94 - 		"Arch Linux - Old"|"Fedora"|"Mandriva"|"Mandrake"|"Chakra"|"Sabayon"|"Slackware"|"Mac OS X"|"Trisquel"|"Kali Linux"|"Jiyuu Linux"|"Antergos"|"KaOS") labelcolor=$(getColor 'light blue');;
  438.95 - 		"Arch Linux"|"Frugalware"|"Mageia") labelcolor=$(getColor 'light cyan');;
  438.96 - 		"Mint"|"LMDE"|"openSUSE"|"LinuxDeepin"|"DragonflyBSD"|"Manjaro"|"Manjaro-tree"|"Android") labelcolor=$(getColor 'light green');;
  438.97 --		"Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"BackTrack Linux") labelcolor=$(getColor 'light red');;
  438.98 -+		"Ubuntu-3color"|"FreeBSD"|"Debian"|"Raspbian"|"BSD"|"Red Hat Enterprise Linux"|"Peppermint"|"Cygwin"|"Fuduntu"|"NetBSD"|"Scientific Linux"|"DragonFlyBSD"|"SliTaz"|"BackTrack Linux") labelcolor=$(getColor 'light red');;
  438.99 - 		"CrunchBang"|"SolusOS"|"Viperr"|"elementary"*) labelcolor=$(getColor 'dark grey');;
 438.100 - 		"Gentoo"|"Parabola GNU/Linux-libre"|"Funtoo"|"Funtoo-text") labelcolor=$(getColor 'light purple');;
 438.101 - 		"CentOS"|"Ubuntu"|*) labelcolor=$(getColor 'yellow');;
   439.1 --- a/scrot/receipt	Wed May 09 17:03:28 2018 +0300
   439.2 +++ b/scrot/receipt	Thu May 10 21:12:00 2018 +0300
   439.3 @@ -18,7 +18,7 @@
   439.4  compile_rules()
   439.5  {
   439.6  	sed -i 's|prefix)/doc|prefix)/share/doc|' *
   439.7 -	patch -p1 < $stuff/scrot.patch
   439.8 +
   439.9  	./configure $CONFIGURE_ARGS &&
  439.10  	make &&
  439.11  	make DESTDIR=$DESTDIR install
   440.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   440.2 +++ b/scrot/stuff/patches/scrot.patch	Thu May 10 21:12:00 2018 +0300
   440.3 @@ -0,0 +1,440 @@
   440.4 +# This patch was created manually from patches found here:
   440.5 +# http://scrot.sourcearchive.com/downloads/0.8-12/scrot_0.8-12.debian.tar.gz
   440.6 +
   440.7 +## 01_manpagefix.dpatch by  William Vera <billy@billy.com.mx>
   440.8 +## DP: Character cleanup for UTF-8 compatibility.
   440.9 +
  440.10 +--- scrot-0.8-orig/scrot.1
  440.11 ++++ scrot-0.8/scrot.1
  440.12 +@@ -87,7 +87,7 @@
  440.13 + \\n prints a newline (ignored when used in the filename)
  440.14 + .fi
  440.15 + .SH EXAMPLE
  440.16 +-scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'
  440.17 ++scrot '%Y\-%m\-%d_$wx$h.png' \-e 'mv $f ~/shots/'
  440.18 + .br
  440.19 + This would create a file called something like
  440.20 + 2000-10-30_2560x1024.png and move it to your shots directory.
  440.21 +
  440.22 +## 02_options.c.dpatch by William Vera <billy@billy.com.mx>
  440.23 +## DP: A little fix for wrong words.
  440.24 +
  440.25 +--- scrot-0.8-orig/src/options.c
  440.26 ++++ scrot-0.8/src/options.c
  440.27 +@@ -229,7 +229,7 @@
  440.28 +            "                            low quality means high compression.\n"
  440.29 +            "  -m, --multidisp           For multiple heads, grab shot from each\n"
  440.30 +            "                            and join them together.\n"
  440.31 +-           "  -s, --select              interactively choose a window or rectnagle\n"
  440.32 ++           "  -s, --select              interactively choose a window or rectangle\n"
  440.33 +            "                            with the mouse\n"
  440.34 +            "  -t, --thumb NUM           generate thumbnail too. NUM is the percentage\n"
  440.35 +            "                            of the original size for the thumbnail to be,\n"
  440.36 +@@ -238,7 +238,7 @@
  440.37 +            "  Both the --exec and filename parameters can take format specifiers\n"
  440.38 +            "  that are expanded by " PACKAGE " when encountered.\n"
  440.39 +            "  There are two types of format specifier. Characters preceded by a '%%'\n"
  440.40 +-           "  are interpretted by strftime(2). See man strftime for examples.\n"
  440.41 ++           "  are interpreted by strftime(2). See man strftime for examples.\n"
  440.42 +            "  These options may be used to refer to the current date and time.\n"
  440.43 +            "  The second kind are internal to " PACKAGE
  440.44 +            "  and are prefixed by '$'\n"
  440.45 +
  440.46 +## 003_descmanpage.dpatch by William Vera <billy@billy.com.mx>
  440.47 +## DP: Change the description on manpage.
  440.48 +
  440.49 +--- scrot-0.8-orig/scrot.1
  440.50 ++++ scrot-0.8/scrot.1
  440.51 +@@ -1,6 +1,6 @@
  440.52 + .TH scrot 1 "Oct 26, 2000"
  440.53 + .SH NAME
  440.54 +-scrot - Screen capture using imlib2
  440.55 ++scrot - capture a screenshot using imlib2
  440.56 + .SH SYNOPSIS
  440.57 + scrot [options] [file]
  440.58 + .SH DESCRIPTION
  440.59 +
  440.60 +## 04-focused.dpatch by James Cameron  <quozl@us.netrek.org>
  440.61 +## DP: src/options.c (scrot_parse_option_array): add --focused option.
  440.62 +## DP: src/main.c (scrot_get_geometry, scrot_nice_clip): new functions
  440.63 +##     for common code used by both selected and focused screenshot.
  440.64 +## DP: src/main.c (scrot_grab_focused): new function to grab currently
  440.65 +##      focused window after specified delay.
  440.66 +
  440.67 +--- scrot-0.8-orig/src/options.h
  440.68 ++++ scrot-0.8/src/options.h
  440.69 +@@ -32,6 +32,7 @@
  440.70 +    int delay;
  440.71 +    int countdown;
  440.72 +    int select;
  440.73 ++   int focused;
  440.74 +    int quality;
  440.75 +    int border;
  440.76 +    int multidisp;
  440.77 +--- scrot-0.8-orig/src/options.c
  440.78 ++++ scrot-0.8/src/options.c
  440.79 +@@ -44,13 +44,15 @@
  440.80 + static void
  440.81 + scrot_parse_option_array(int argc, char **argv)
  440.82 + {
  440.83 +-   static char stropts[] = "bcd:e:hmq:st:v+:";
  440.84 ++   static char stropts[] = "bcd:e:hmq:st:uv+:";
  440.85 +    static struct option lopts[] = {
  440.86 +       /* actions */
  440.87 +       {"help", 0, 0, 'h'},                  /* okay */
  440.88 +       {"version", 0, 0, 'v'},               /* okay */
  440.89 +       {"count", 0, 0, 'c'},
  440.90 +       {"select", 0, 0, 's'},
  440.91 ++      {"focused", 0, 0, 'u'},
  440.92 ++      {"focussed", 0, 0, 'u'},	/* macquarie dictionary has both spellings */
  440.93 +       {"border", 0, 0, 'b'},
  440.94 +       {"multidisp", 0, 0, 'm'},
  440.95 +       /* toggles */
  440.96 +@@ -95,6 +97,9 @@
  440.97 +         case 's':
  440.98 +            opt.select = 1;
  440.99 +            break;
 440.100 ++        case 'u':
 440.101 ++           opt.focused = 1;
 440.102 ++           break;
 440.103 +         case '+':
 440.104 +            opt.debug_level = atoi(optarg);
 440.105 +            break;
 440.106 +@@ -231,6 +236,7 @@
 440.107 +            "                            and join them together.\n"
 440.108 +            "  -s, --select              interactively choose a window or rectangle\n"
 440.109 +            "                            with the mouse\n"
 440.110 ++           "  -u, --focused             use the currently focused window\n"
 440.111 +            "  -t, --thumb NUM           generate thumbnail too. NUM is the percentage\n"
 440.112 +            "                            of the original size for the thumbnail to be,\n"
 440.113 +            "                            or the geometry in percent, e.g. 50x60 or 80x20.\n"
 440.114 +--- scrot-0.8-orig/src/scrot.h
 440.115 ++++ scrot-0.8/src/scrot.h
 440.116 +@@ -72,7 +72,10 @@
 440.117 +                     char *filename_im, char *filename_thumb);
 440.118 + void scrot_do_delay(void);
 440.119 + Imlib_Image scrot_sel_and_grab_image(void);
 440.120 ++Imlib_Image scrot_grab_focused(void);
 440.121 + void scrot_sel_area(int *x, int *y, int *w, int *h);
 440.122 ++void scrot_nice_clip(int *rx, int *ry, int *rw, int *rh);
 440.123 ++int scrot_get_geometry(Window target, int *rx, int *ry, int *rw, int *rh);
 440.124 + Window scrot_get_window(Display *display,Window window,int x,int y);
 440.125 + Window scrot_get_client_window(Display * display, Window target);
 440.126 + Window scrot_find_window_by_property(Display * display, const Window window,
 440.127 +--- scrot-0.8-orig/src/main.c
 440.128 ++++ scrot-0.8/src/main.c
 440.129 +@@ -48,7 +48,9 @@
 440.130 +   }
 440.131 + 
 440.132 + 
 440.133 +-  if (opt.select)
 440.134 ++  if (opt.focused)
 440.135 ++    image = scrot_grab_focused();
 440.136 ++  else if (opt.select)
 440.137 +     image = scrot_sel_and_grab_image();
 440.138 +   else {
 440.139 +     scrot_do_delay();
 440.140 +@@ -171,6 +173,22 @@
 440.141 + }
 440.142 + 
 440.143 + Imlib_Image
 440.144 ++scrot_grab_focused(void)
 440.145 ++{
 440.146 ++  Imlib_Image im = NULL;
 440.147 ++  int rx = 0, ry = 0, rw = 0, rh = 0;
 440.148 ++  Window target = None;
 440.149 ++  int ignored;
 440.150 ++
 440.151 ++  scrot_do_delay();
 440.152 ++  XGetInputFocus(disp, &target, &ignored);
 440.153 ++  if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL;
 440.154 ++  scrot_nice_clip(&rx, &ry, &rw, &rh);
 440.155 ++  im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
 440.156 ++  return im;
 440.157 ++}
 440.158 ++
 440.159 ++Imlib_Image
 440.160 + scrot_sel_and_grab_image(void)
 440.161 + {
 440.162 +   Imlib_Image im = NULL;
 440.163 +@@ -313,57 +331,10 @@
 440.164 +         rh = 0 - rh;
 440.165 +       }
 440.166 +     } else {
 440.167 +-      Window child;
 440.168 +-      XWindowAttributes attr;
 440.169 +-      int stat;
 440.170 +-
 440.171 +       /* else it's a window click */
 440.172 +-      /* get geometry of window and use that */
 440.173 +-      /* get windowmanager frame of window */
 440.174 +-      if (target != root) {
 440.175 +-        unsigned int d, x;
 440.176 +-        int status;
 440.177 +-
 440.178 +-        status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d);
 440.179 +-        if (status != 0) {
 440.180 +-          Window rt, *children, parent;
 440.181 +-
 440.182 +-          for (;;) {
 440.183 +-            /* Find window manager frame. */
 440.184 +-            status = XQueryTree(disp, target, &rt, &parent, &children, &d);
 440.185 +-            if (status && (children != None))
 440.186 +-              XFree((char *) children);
 440.187 +-            if (!status || (parent == None) || (parent == rt))
 440.188 +-              break;
 440.189 +-            target = parent;
 440.190 +-          }
 440.191 +-          /* Get client window. */
 440.192 +-          if (!opt.border)
 440.193 +-            target = scrot_get_client_window(disp, target);
 440.194 +-          XRaiseWindow(disp, target);
 440.195 +-        }
 440.196 +-      }
 440.197 +-      stat = XGetWindowAttributes(disp, target, &attr);
 440.198 +-      if ((stat == False) || (attr.map_state != IsViewable))
 440.199 +-        return NULL;
 440.200 +-      rw = attr.width;
 440.201 +-      rh = attr.height;
 440.202 +-      XTranslateCoordinates(disp, target, root, 0, 0, &rx, &ry, &child);
 440.203 ++      if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL;
 440.204 +     }
 440.205 +-
 440.206 +-    /* clip rectangle nicely */
 440.207 +-    if (rx < 0) {
 440.208 +-      rw += rx;
 440.209 +-      rx = 0;
 440.210 +-    }
 440.211 +-    if (ry < 0) {
 440.212 +-      rh += ry;
 440.213 +-      ry = 0;
 440.214 +-    }
 440.215 +-    if ((rx + rw) > scr->width)
 440.216 +-      rw = scr->width - rx;
 440.217 +-    if ((ry + rh) > scr->height)
 440.218 +-      rh = scr->height - ry;
 440.219 ++    scrot_nice_clip(&rx, &ry, &rw, &rh);
 440.220 + 
 440.221 +     XBell(disp, 0);
 440.222 +     im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
 440.223 +@@ -371,6 +342,72 @@
 440.224 +   return im;
 440.225 + }
 440.226 + 
 440.227 ++/* clip rectangle nicely */
 440.228 ++void
 440.229 ++scrot_nice_clip(int *rx, 
 440.230 ++		int *ry, 
 440.231 ++		int *rw, 
 440.232 ++		int *rh)
 440.233 ++{
 440.234 ++  if (*rx < 0) {
 440.235 ++    *rw += *rx;
 440.236 ++    *rx = 0;
 440.237 ++  }
 440.238 ++  if (*ry < 0) {
 440.239 ++    *rh += *ry;
 440.240 ++    *ry = 0;
 440.241 ++  }
 440.242 ++  if ((*rx + *rw) > scr->width)
 440.243 ++    *rw = scr->width - *rx;
 440.244 ++  if ((*ry + *rh) > scr->height)
 440.245 ++    *rh = scr->height - *ry;
 440.246 ++}
 440.247 ++
 440.248 ++/* get geometry of window and use that */
 440.249 ++int
 440.250 ++scrot_get_geometry(Window target,
 440.251 ++		   int *rx, 
 440.252 ++		   int *ry, 
 440.253 ++		   int *rw, 
 440.254 ++		   int *rh)
 440.255 ++{
 440.256 ++  Window child;
 440.257 ++  XWindowAttributes attr;
 440.258 ++  int stat;
 440.259 ++
 440.260 ++  /* get windowmanager frame of window */
 440.261 ++  if (target != root) {
 440.262 ++    unsigned int d, x;
 440.263 ++    int status;
 440.264 ++    
 440.265 ++    status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d);
 440.266 ++    if (status != 0) {
 440.267 ++      Window rt, *children, parent;
 440.268 ++      
 440.269 ++      for (;;) {
 440.270 ++	/* Find window manager frame. */
 440.271 ++	status = XQueryTree(disp, target, &rt, &parent, &children, &d);
 440.272 ++	if (status && (children != None))
 440.273 ++	  XFree((char *) children);
 440.274 ++	if (!status || (parent == None) || (parent == rt))
 440.275 ++	  break;
 440.276 ++	target = parent;
 440.277 ++      }
 440.278 ++      /* Get client window. */
 440.279 ++      if (!opt.border)
 440.280 ++	target = scrot_get_client_window(disp, target);
 440.281 ++      XRaiseWindow(disp, target);
 440.282 ++    }
 440.283 ++  }
 440.284 ++  stat = XGetWindowAttributes(disp, target, &attr);
 440.285 ++  if ((stat == False) || (attr.map_state != IsViewable))
 440.286 ++    return 0;
 440.287 ++  *rw = attr.width;
 440.288 ++  *rh = attr.height;
 440.289 ++  XTranslateCoordinates(disp, target, root, 0, 0, rx, ry, &child);
 440.290 ++  return 1;
 440.291 ++}
 440.292 ++
 440.293 + Window
 440.294 + scrot_get_window(Display * display,
 440.295 +                  Window window,
 440.296 +
 440.297 +## 05-addfocusedmanpage.dpatch by William Vera <billy@billy.com.mx>
 440.298 +## DP: Add a new option in the man page (focused option).
 440.299 +
 440.300 +--- scrot-0.8-orig/scrot.1
 440.301 ++++ scrot-0.8/scrot.1
 440.302 +@@ -43,6 +43,9 @@
 440.303 + .B -s, --select
 440.304 + Interactively select a window or rectangle with the mouse.
 440.305 + .TP 5
 440.306 ++.B -u, --focused
 440.307 ++Use the currently focused window.
 440.308 ++.TP 5
 440.309 + .B -t, --thumb NUM
 440.310 + generate thumbnail too. NUM is the percentage of the original size for the
 440.311 + thumbnail to be.
 440.312 +
 440.313 +## 06_manpagespace.dpatch by William Vera <billy@billy.com.mx>
 440.314 +## DP: Improve spacing in manual page.
 440.315 +
 440.316 +--- scrot-0.8-orig/scrot.1
 440.317 ++++ scrot-0.8/scrot.1
 440.318 +@@ -58,7 +58,7 @@
 440.319 + These options may be used to refer to the current date and time.
 440.320 + The second kind are internal to scrot and are prefixed by '$'
 440.321 + The following specifiers are recognised:
 440.322 +-.br
 440.323 ++.PP
 440.324 + .B $f
 440.325 + image path/filename (ignored when used in the filename)
 440.326 + .br
 440.327 +
 440.328 +## 07_fix-formatstring.dpatch by George Danchev <danchev@spnet.net>
 440.329 +## DP: Prevent arbitrary long file names
 440.330 +
 440.331 +--- scrot-0.8-orig/src/options.c
 440.332 ++++ scrot-0.8/src/options.c
 440.333 +@@ -124,6 +124,12 @@
 440.334 +          if (!opt.output_file)
 440.335 +          {
 440.336 +             opt.output_file = argv[optind++];
 440.337 ++
 440.338 ++            if ( strlen(opt.output_file) > 256 ) {
 440.339 ++               printf("output filename too long.\n");
 440.340 ++               exit(EXIT_FAILURE);
 440.341 ++            }
 440.342 ++
 440.343 +             if (opt.thumb)
 440.344 +                opt.thumb_file = name_thumbnail(opt.output_file);
 440.345 +          }
 440.346 +
 440.347 +## fix-beeping.dpatch by Ibragimov Rinat <ibragimovrinat@mail.ru>
 440.348 +## DP: Fix missing option for beep prevention.
 440.349 +
 440.350 +--- scrot-0.8-orig/scrot.1
 440.351 ++++ scrot-0.8/scrot.1
 440.352 +@@ -49,6 +49,9 @@
 440.353 + .B -t, --thumb NUM
 440.354 + generate thumbnail too. NUM is the percentage of the original size for the
 440.355 + thumbnail to be.
 440.356 ++.TP 5
 440.357 ++.B -z, --silent
 440.358 ++prevent beeping.
 440.359 + .SH SPECIAL STRINGS
 440.360 + Both the
 440.361 + .B --exec
 440.362 +--- scrot-0.8-orig/src/main.c
 440.363 ++++ scrot-0.8/src/main.c
 440.364 +@@ -154,7 +154,7 @@
 440.365 + {
 440.366 +   Imlib_Image im;
 440.367 + 
 440.368 +-  XBell(disp, 0);
 440.369 ++  if (! opt.silent) XBell(disp, 0);
 440.370 +   im =
 440.371 +     gib_imlib_create_image_from_drawable(root, 0, 0, 0, scr->width,
 440.372 +                                          scr->height, 1);
 440.373 +@@ -336,7 +336,7 @@
 440.374 +     }
 440.375 +     scrot_nice_clip(&rx, &ry, &rw, &rh);
 440.376 + 
 440.377 +-    XBell(disp, 0);
 440.378 ++    if (! opt.silent) XBell(disp, 0);
 440.379 +     im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
 440.380 +   }
 440.381 +   return im;
 440.382 +--- scrot-0.8-orig/src/options.c
 440.383 ++++ scrot-0.8/src/options.c
 440.384 +@@ -44,7 +44,7 @@
 440.385 + static void
 440.386 + scrot_parse_option_array(int argc, char **argv)
 440.387 + {
 440.388 +-   static char stropts[] = "bcd:e:hmq:st:uv+:";
 440.389 ++   static char stropts[] = "bcd:e:hmq:st:uv+:z";
 440.390 +    static struct option lopts[] = {
 440.391 +       /* actions */
 440.392 +       {"help", 0, 0, 'h'},                  /* okay */
 440.393 +@@ -55,6 +55,7 @@
 440.394 +       {"focussed", 0, 0, 'u'},	/* macquarie dictionary has both spellings */
 440.395 +       {"border", 0, 0, 'b'},
 440.396 +       {"multidisp", 0, 0, 'm'},
 440.397 ++	  {"silent", 0, 0, 'z'},
 440.398 +       /* toggles */
 440.399 +       {"thumb", 1, 0, 't'},
 440.400 +       {"delay", 1, 0, 'd'},
 440.401 +@@ -109,6 +110,9 @@
 440.402 +         case 't':
 440.403 +            options_parse_thumbnail(optarg);
 440.404 +            break;
 440.405 ++        case 'z':
 440.406 ++           opt.silent = 1;
 440.407 ++           break;
 440.408 +         default:
 440.409 +            break;
 440.410 +       }
 440.411 +@@ -246,6 +250,7 @@
 440.412 +            "  -t, --thumb NUM           generate thumbnail too. NUM is the percentage\n"
 440.413 +            "                            of the original size for the thumbnail to be,\n"
 440.414 +            "                            or the geometry in percent, e.g. 50x60 or 80x20.\n"
 440.415 ++           "  -z, --silent              Prevent beeping\n"		   
 440.416 +            "\n" "  SPECIAL STRINGS\n"
 440.417 +            "  Both the --exec and filename parameters can take format specifiers\n"
 440.418 +            "  that are expanded by " PACKAGE " when encountered.\n"
 440.419 +--- scrot-0.8-orig/src/options.h
 440.420 ++++ scrot-0.8/src/options.h
 440.421 +@@ -35,6 +35,7 @@
 440.422 +    int focused;
 440.423 +    int quality;
 440.424 +    int border;
 440.425 ++   int silent;   
 440.426 +    int multidisp;
 440.427 +    int thumb;
 440.428 +    int thumb_width;
 440.429 +
 440.430 +## 09_fix-minusign.dpatch by William Vera <billy@billy.com.mx>
 440.431 +## DP: Fix a hyphen-used-as-minus-sign in a manpage.
 440.432 +
 440.433 +--- scrot-0.8-orig/scrot.1
 440.434 ++++ scrot-0.8/scrot.1
 440.435 +@@ -93,7 +93,7 @@
 440.436 + \\n prints a newline (ignored when used in the filename)
 440.437 + .fi
 440.438 + .SH EXAMPLE
 440.439 +-scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'
 440.440 ++scrot '%Y-%m-%d_$wx$h.png' \-e 'mv $f ~/shots/'
 440.441 + .br
 440.442 + This would create a file called something like
 440.443 + 2000-10-30_2560x1024.png and move it to your shots directory.
   441.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   441.2 +++ b/scrot/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   441.3 @@ -0,0 +1,1 @@
   441.4 +-p1|scrot.patch
   442.1 --- a/scrot/stuff/scrot.patch	Wed May 09 17:03:28 2018 +0300
   442.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   442.3 @@ -1,440 +0,0 @@
   442.4 -# This patch was created manually from patches found here:
   442.5 -# http://scrot.sourcearchive.com/downloads/0.8-12/scrot_0.8-12.debian.tar.gz
   442.6 -
   442.7 -## 01_manpagefix.dpatch by  William Vera <billy@billy.com.mx>
   442.8 -## DP: Character cleanup for UTF-8 compatibility.
   442.9 -
  442.10 ---- scrot-0.8-orig/scrot.1
  442.11 -+++ scrot-0.8/scrot.1
  442.12 -@@ -87,7 +87,7 @@
  442.13 - \\n prints a newline (ignored when used in the filename)
  442.14 - .fi
  442.15 - .SH EXAMPLE
  442.16 --scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'
  442.17 -+scrot '%Y\-%m\-%d_$wx$h.png' \-e 'mv $f ~/shots/'
  442.18 - .br
  442.19 - This would create a file called something like
  442.20 - 2000-10-30_2560x1024.png and move it to your shots directory.
  442.21 -
  442.22 -## 02_options.c.dpatch by William Vera <billy@billy.com.mx>
  442.23 -## DP: A little fix for wrong words.
  442.24 -
  442.25 ---- scrot-0.8-orig/src/options.c
  442.26 -+++ scrot-0.8/src/options.c
  442.27 -@@ -229,7 +229,7 @@
  442.28 -            "                            low quality means high compression.\n"
  442.29 -            "  -m, --multidisp           For multiple heads, grab shot from each\n"
  442.30 -            "                            and join them together.\n"
  442.31 --           "  -s, --select              interactively choose a window or rectnagle\n"
  442.32 -+           "  -s, --select              interactively choose a window or rectangle\n"
  442.33 -            "                            with the mouse\n"
  442.34 -            "  -t, --thumb NUM           generate thumbnail too. NUM is the percentage\n"
  442.35 -            "                            of the original size for the thumbnail to be,\n"
  442.36 -@@ -238,7 +238,7 @@
  442.37 -            "  Both the --exec and filename parameters can take format specifiers\n"
  442.38 -            "  that are expanded by " PACKAGE " when encountered.\n"
  442.39 -            "  There are two types of format specifier. Characters preceded by a '%%'\n"
  442.40 --           "  are interpretted by strftime(2). See man strftime for examples.\n"
  442.41 -+           "  are interpreted by strftime(2). See man strftime for examples.\n"
  442.42 -            "  These options may be used to refer to the current date and time.\n"
  442.43 -            "  The second kind are internal to " PACKAGE
  442.44 -            "  and are prefixed by '$'\n"
  442.45 -
  442.46 -## 003_descmanpage.dpatch by William Vera <billy@billy.com.mx>
  442.47 -## DP: Change the description on manpage.
  442.48 -
  442.49 ---- scrot-0.8-orig/scrot.1
  442.50 -+++ scrot-0.8/scrot.1
  442.51 -@@ -1,6 +1,6 @@
  442.52 - .TH scrot 1 "Oct 26, 2000"
  442.53 - .SH NAME
  442.54 --scrot - Screen capture using imlib2
  442.55 -+scrot - capture a screenshot using imlib2
  442.56 - .SH SYNOPSIS
  442.57 - scrot [options] [file]
  442.58 - .SH DESCRIPTION
  442.59 -
  442.60 -## 04-focused.dpatch by James Cameron  <quozl@us.netrek.org>
  442.61 -## DP: src/options.c (scrot_parse_option_array): add --focused option.
  442.62 -## DP: src/main.c (scrot_get_geometry, scrot_nice_clip): new functions
  442.63 -##     for common code used by both selected and focused screenshot.
  442.64 -## DP: src/main.c (scrot_grab_focused): new function to grab currently
  442.65 -##      focused window after specified delay.
  442.66 -
  442.67 ---- scrot-0.8-orig/src/options.h
  442.68 -+++ scrot-0.8/src/options.h
  442.69 -@@ -32,6 +32,7 @@
  442.70 -    int delay;
  442.71 -    int countdown;
  442.72 -    int select;
  442.73 -+   int focused;
  442.74 -    int quality;
  442.75 -    int border;
  442.76 -    int multidisp;
  442.77 ---- scrot-0.8-orig/src/options.c
  442.78 -+++ scrot-0.8/src/options.c
  442.79 -@@ -44,13 +44,15 @@
  442.80 - static void
  442.81 - scrot_parse_option_array(int argc, char **argv)
  442.82 - {
  442.83 --   static char stropts[] = "bcd:e:hmq:st:v+:";
  442.84 -+   static char stropts[] = "bcd:e:hmq:st:uv+:";
  442.85 -    static struct option lopts[] = {
  442.86 -       /* actions */
  442.87 -       {"help", 0, 0, 'h'},                  /* okay */
  442.88 -       {"version", 0, 0, 'v'},               /* okay */
  442.89 -       {"count", 0, 0, 'c'},
  442.90 -       {"select", 0, 0, 's'},
  442.91 -+      {"focused", 0, 0, 'u'},
  442.92 -+      {"focussed", 0, 0, 'u'},	/* macquarie dictionary has both spellings */
  442.93 -       {"border", 0, 0, 'b'},
  442.94 -       {"multidisp", 0, 0, 'm'},
  442.95 -       /* toggles */
  442.96 -@@ -95,6 +97,9 @@
  442.97 -         case 's':
  442.98 -            opt.select = 1;
  442.99 -            break;
 442.100 -+        case 'u':
 442.101 -+           opt.focused = 1;
 442.102 -+           break;
 442.103 -         case '+':
 442.104 -            opt.debug_level = atoi(optarg);
 442.105 -            break;
 442.106 -@@ -231,6 +236,7 @@
 442.107 -            "                            and join them together.\n"
 442.108 -            "  -s, --select              interactively choose a window or rectangle\n"
 442.109 -            "                            with the mouse\n"
 442.110 -+           "  -u, --focused             use the currently focused window\n"
 442.111 -            "  -t, --thumb NUM           generate thumbnail too. NUM is the percentage\n"
 442.112 -            "                            of the original size for the thumbnail to be,\n"
 442.113 -            "                            or the geometry in percent, e.g. 50x60 or 80x20.\n"
 442.114 ---- scrot-0.8-orig/src/scrot.h
 442.115 -+++ scrot-0.8/src/scrot.h
 442.116 -@@ -72,7 +72,10 @@
 442.117 -                     char *filename_im, char *filename_thumb);
 442.118 - void scrot_do_delay(void);
 442.119 - Imlib_Image scrot_sel_and_grab_image(void);
 442.120 -+Imlib_Image scrot_grab_focused(void);
 442.121 - void scrot_sel_area(int *x, int *y, int *w, int *h);
 442.122 -+void scrot_nice_clip(int *rx, int *ry, int *rw, int *rh);
 442.123 -+int scrot_get_geometry(Window target, int *rx, int *ry, int *rw, int *rh);
 442.124 - Window scrot_get_window(Display *display,Window window,int x,int y);
 442.125 - Window scrot_get_client_window(Display * display, Window target);
 442.126 - Window scrot_find_window_by_property(Display * display, const Window window,
 442.127 ---- scrot-0.8-orig/src/main.c
 442.128 -+++ scrot-0.8/src/main.c
 442.129 -@@ -48,7 +48,9 @@
 442.130 -   }
 442.131 - 
 442.132 - 
 442.133 --  if (opt.select)
 442.134 -+  if (opt.focused)
 442.135 -+    image = scrot_grab_focused();
 442.136 -+  else if (opt.select)
 442.137 -     image = scrot_sel_and_grab_image();
 442.138 -   else {
 442.139 -     scrot_do_delay();
 442.140 -@@ -171,6 +173,22 @@
 442.141 - }
 442.142 - 
 442.143 - Imlib_Image
 442.144 -+scrot_grab_focused(void)
 442.145 -+{
 442.146 -+  Imlib_Image im = NULL;
 442.147 -+  int rx = 0, ry = 0, rw = 0, rh = 0;
 442.148 -+  Window target = None;
 442.149 -+  int ignored;
 442.150 -+
 442.151 -+  scrot_do_delay();
 442.152 -+  XGetInputFocus(disp, &target, &ignored);
 442.153 -+  if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL;
 442.154 -+  scrot_nice_clip(&rx, &ry, &rw, &rh);
 442.155 -+  im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
 442.156 -+  return im;
 442.157 -+}
 442.158 -+
 442.159 -+Imlib_Image
 442.160 - scrot_sel_and_grab_image(void)
 442.161 - {
 442.162 -   Imlib_Image im = NULL;
 442.163 -@@ -313,57 +331,10 @@
 442.164 -         rh = 0 - rh;
 442.165 -       }
 442.166 -     } else {
 442.167 --      Window child;
 442.168 --      XWindowAttributes attr;
 442.169 --      int stat;
 442.170 --
 442.171 -       /* else it's a window click */
 442.172 --      /* get geometry of window and use that */
 442.173 --      /* get windowmanager frame of window */
 442.174 --      if (target != root) {
 442.175 --        unsigned int d, x;
 442.176 --        int status;
 442.177 --
 442.178 --        status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d);
 442.179 --        if (status != 0) {
 442.180 --          Window rt, *children, parent;
 442.181 --
 442.182 --          for (;;) {
 442.183 --            /* Find window manager frame. */
 442.184 --            status = XQueryTree(disp, target, &rt, &parent, &children, &d);
 442.185 --            if (status && (children != None))
 442.186 --              XFree((char *) children);
 442.187 --            if (!status || (parent == None) || (parent == rt))
 442.188 --              break;
 442.189 --            target = parent;
 442.190 --          }
 442.191 --          /* Get client window. */
 442.192 --          if (!opt.border)
 442.193 --            target = scrot_get_client_window(disp, target);
 442.194 --          XRaiseWindow(disp, target);
 442.195 --        }
 442.196 --      }
 442.197 --      stat = XGetWindowAttributes(disp, target, &attr);
 442.198 --      if ((stat == False) || (attr.map_state != IsViewable))
 442.199 --        return NULL;
 442.200 --      rw = attr.width;
 442.201 --      rh = attr.height;
 442.202 --      XTranslateCoordinates(disp, target, root, 0, 0, &rx, &ry, &child);
 442.203 -+      if (!scrot_get_geometry(target, &rx, &ry, &rw, &rh)) return NULL;
 442.204 -     }
 442.205 --
 442.206 --    /* clip rectangle nicely */
 442.207 --    if (rx < 0) {
 442.208 --      rw += rx;
 442.209 --      rx = 0;
 442.210 --    }
 442.211 --    if (ry < 0) {
 442.212 --      rh += ry;
 442.213 --      ry = 0;
 442.214 --    }
 442.215 --    if ((rx + rw) > scr->width)
 442.216 --      rw = scr->width - rx;
 442.217 --    if ((ry + rh) > scr->height)
 442.218 --      rh = scr->height - ry;
 442.219 -+    scrot_nice_clip(&rx, &ry, &rw, &rh);
 442.220 - 
 442.221 -     XBell(disp, 0);
 442.222 -     im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
 442.223 -@@ -371,6 +342,72 @@
 442.224 -   return im;
 442.225 - }
 442.226 - 
 442.227 -+/* clip rectangle nicely */
 442.228 -+void
 442.229 -+scrot_nice_clip(int *rx, 
 442.230 -+		int *ry, 
 442.231 -+		int *rw, 
 442.232 -+		int *rh)
 442.233 -+{
 442.234 -+  if (*rx < 0) {
 442.235 -+    *rw += *rx;
 442.236 -+    *rx = 0;
 442.237 -+  }
 442.238 -+  if (*ry < 0) {
 442.239 -+    *rh += *ry;
 442.240 -+    *ry = 0;
 442.241 -+  }
 442.242 -+  if ((*rx + *rw) > scr->width)
 442.243 -+    *rw = scr->width - *rx;
 442.244 -+  if ((*ry + *rh) > scr->height)
 442.245 -+    *rh = scr->height - *ry;
 442.246 -+}
 442.247 -+
 442.248 -+/* get geometry of window and use that */
 442.249 -+int
 442.250 -+scrot_get_geometry(Window target,
 442.251 -+		   int *rx, 
 442.252 -+		   int *ry, 
 442.253 -+		   int *rw, 
 442.254 -+		   int *rh)
 442.255 -+{
 442.256 -+  Window child;
 442.257 -+  XWindowAttributes attr;
 442.258 -+  int stat;
 442.259 -+
 442.260 -+  /* get windowmanager frame of window */
 442.261 -+  if (target != root) {
 442.262 -+    unsigned int d, x;
 442.263 -+    int status;
 442.264 -+    
 442.265 -+    status = XGetGeometry(disp, target, &root, &x, &x, &d, &d, &d, &d);
 442.266 -+    if (status != 0) {
 442.267 -+      Window rt, *children, parent;
 442.268 -+      
 442.269 -+      for (;;) {
 442.270 -+	/* Find window manager frame. */
 442.271 -+	status = XQueryTree(disp, target, &rt, &parent, &children, &d);
 442.272 -+	if (status && (children != None))
 442.273 -+	  XFree((char *) children);
 442.274 -+	if (!status || (parent == None) || (parent == rt))
 442.275 -+	  break;
 442.276 -+	target = parent;
 442.277 -+      }
 442.278 -+      /* Get client window. */
 442.279 -+      if (!opt.border)
 442.280 -+	target = scrot_get_client_window(disp, target);
 442.281 -+      XRaiseWindow(disp, target);
 442.282 -+    }
 442.283 -+  }
 442.284 -+  stat = XGetWindowAttributes(disp, target, &attr);
 442.285 -+  if ((stat == False) || (attr.map_state != IsViewable))
 442.286 -+    return 0;
 442.287 -+  *rw = attr.width;
 442.288 -+  *rh = attr.height;
 442.289 -+  XTranslateCoordinates(disp, target, root, 0, 0, rx, ry, &child);
 442.290 -+  return 1;
 442.291 -+}
 442.292 -+
 442.293 - Window
 442.294 - scrot_get_window(Display * display,
 442.295 -                  Window window,
 442.296 -
 442.297 -## 05-addfocusedmanpage.dpatch by William Vera <billy@billy.com.mx>
 442.298 -## DP: Add a new option in the man page (focused option).
 442.299 -
 442.300 ---- scrot-0.8-orig/scrot.1
 442.301 -+++ scrot-0.8/scrot.1
 442.302 -@@ -43,6 +43,9 @@
 442.303 - .B -s, --select
 442.304 - Interactively select a window or rectangle with the mouse.
 442.305 - .TP 5
 442.306 -+.B -u, --focused
 442.307 -+Use the currently focused window.
 442.308 -+.TP 5
 442.309 - .B -t, --thumb NUM
 442.310 - generate thumbnail too. NUM is the percentage of the original size for the
 442.311 - thumbnail to be.
 442.312 -
 442.313 -## 06_manpagespace.dpatch by William Vera <billy@billy.com.mx>
 442.314 -## DP: Improve spacing in manual page.
 442.315 -
 442.316 ---- scrot-0.8-orig/scrot.1
 442.317 -+++ scrot-0.8/scrot.1
 442.318 -@@ -58,7 +58,7 @@
 442.319 - These options may be used to refer to the current date and time.
 442.320 - The second kind are internal to scrot and are prefixed by '$'
 442.321 - The following specifiers are recognised:
 442.322 --.br
 442.323 -+.PP
 442.324 - .B $f
 442.325 - image path/filename (ignored when used in the filename)
 442.326 - .br
 442.327 -
 442.328 -## 07_fix-formatstring.dpatch by George Danchev <danchev@spnet.net>
 442.329 -## DP: Prevent arbitrary long file names
 442.330 -
 442.331 ---- scrot-0.8-orig/src/options.c
 442.332 -+++ scrot-0.8/src/options.c
 442.333 -@@ -124,6 +124,12 @@
 442.334 -          if (!opt.output_file)
 442.335 -          {
 442.336 -             opt.output_file = argv[optind++];
 442.337 -+
 442.338 -+            if ( strlen(opt.output_file) > 256 ) {
 442.339 -+               printf("output filename too long.\n");
 442.340 -+               exit(EXIT_FAILURE);
 442.341 -+            }
 442.342 -+
 442.343 -             if (opt.thumb)
 442.344 -                opt.thumb_file = name_thumbnail(opt.output_file);
 442.345 -          }
 442.346 -
 442.347 -## fix-beeping.dpatch by Ibragimov Rinat <ibragimovrinat@mail.ru>
 442.348 -## DP: Fix missing option for beep prevention.
 442.349 -
 442.350 ---- scrot-0.8-orig/scrot.1
 442.351 -+++ scrot-0.8/scrot.1
 442.352 -@@ -49,6 +49,9 @@
 442.353 - .B -t, --thumb NUM
 442.354 - generate thumbnail too. NUM is the percentage of the original size for the
 442.355 - thumbnail to be.
 442.356 -+.TP 5
 442.357 -+.B -z, --silent
 442.358 -+prevent beeping.
 442.359 - .SH SPECIAL STRINGS
 442.360 - Both the
 442.361 - .B --exec
 442.362 ---- scrot-0.8-orig/src/main.c
 442.363 -+++ scrot-0.8/src/main.c
 442.364 -@@ -154,7 +154,7 @@
 442.365 - {
 442.366 -   Imlib_Image im;
 442.367 - 
 442.368 --  XBell(disp, 0);
 442.369 -+  if (! opt.silent) XBell(disp, 0);
 442.370 -   im =
 442.371 -     gib_imlib_create_image_from_drawable(root, 0, 0, 0, scr->width,
 442.372 -                                          scr->height, 1);
 442.373 -@@ -336,7 +336,7 @@
 442.374 -     }
 442.375 -     scrot_nice_clip(&rx, &ry, &rw, &rh);
 442.376 - 
 442.377 --    XBell(disp, 0);
 442.378 -+    if (! opt.silent) XBell(disp, 0);
 442.379 -     im = gib_imlib_create_image_from_drawable(root, 0, rx, ry, rw, rh, 1);
 442.380 -   }
 442.381 -   return im;
 442.382 ---- scrot-0.8-orig/src/options.c
 442.383 -+++ scrot-0.8/src/options.c
 442.384 -@@ -44,7 +44,7 @@
 442.385 - static void
 442.386 - scrot_parse_option_array(int argc, char **argv)
 442.387 - {
 442.388 --   static char stropts[] = "bcd:e:hmq:st:uv+:";
 442.389 -+   static char stropts[] = "bcd:e:hmq:st:uv+:z";
 442.390 -    static struct option lopts[] = {
 442.391 -       /* actions */
 442.392 -       {"help", 0, 0, 'h'},                  /* okay */
 442.393 -@@ -55,6 +55,7 @@
 442.394 -       {"focussed", 0, 0, 'u'},	/* macquarie dictionary has both spellings */
 442.395 -       {"border", 0, 0, 'b'},
 442.396 -       {"multidisp", 0, 0, 'm'},
 442.397 -+	  {"silent", 0, 0, 'z'},
 442.398 -       /* toggles */
 442.399 -       {"thumb", 1, 0, 't'},
 442.400 -       {"delay", 1, 0, 'd'},
 442.401 -@@ -109,6 +110,9 @@
 442.402 -         case 't':
 442.403 -            options_parse_thumbnail(optarg);
 442.404 -            break;
 442.405 -+        case 'z':
 442.406 -+           opt.silent = 1;
 442.407 -+           break;
 442.408 -         default:
 442.409 -            break;
 442.410 -       }
 442.411 -@@ -246,6 +250,7 @@
 442.412 -            "  -t, --thumb NUM           generate thumbnail too. NUM is the percentage\n"
 442.413 -            "                            of the original size for the thumbnail to be,\n"
 442.414 -            "                            or the geometry in percent, e.g. 50x60 or 80x20.\n"
 442.415 -+           "  -z, --silent              Prevent beeping\n"		   
 442.416 -            "\n" "  SPECIAL STRINGS\n"
 442.417 -            "  Both the --exec and filename parameters can take format specifiers\n"
 442.418 -            "  that are expanded by " PACKAGE " when encountered.\n"
 442.419 ---- scrot-0.8-orig/src/options.h
 442.420 -+++ scrot-0.8/src/options.h
 442.421 -@@ -35,6 +35,7 @@
 442.422 -    int focused;
 442.423 -    int quality;
 442.424 -    int border;
 442.425 -+   int silent;   
 442.426 -    int multidisp;
 442.427 -    int thumb;
 442.428 -    int thumb_width;
 442.429 -
 442.430 -## 09_fix-minusign.dpatch by William Vera <billy@billy.com.mx>
 442.431 -## DP: Fix a hyphen-used-as-minus-sign in a manpage.
 442.432 -
 442.433 ---- scrot-0.8-orig/scrot.1
 442.434 -+++ scrot-0.8/scrot.1
 442.435 -@@ -93,7 +93,7 @@
 442.436 - \\n prints a newline (ignored when used in the filename)
 442.437 - .fi
 442.438 - .SH EXAMPLE
 442.439 --scrot '%Y-%m-%d_$wx$h.png' -e 'mv $f ~/shots/'
 442.440 -+scrot '%Y-%m-%d_$wx$h.png' \-e 'mv $f ~/shots/'
 442.441 - .br
 442.442 - This would create a file called something like
 442.443 - 2000-10-30_2560x1024.png and move it to your shots directory.
   443.1 --- a/seamonkey/receipt	Wed May 09 17:03:28 2018 +0300
   443.2 +++ b/seamonkey/receipt	Thu May 10 21:12:00 2018 +0300
   443.3 @@ -21,10 +21,8 @@
   443.4  compile_rules()
   443.5  {
   443.6  	cp -a $stuff/seamonkey.mozconfig $src/.mozconfig
   443.7 -	cd $src
   443.8  	sed -i -e 's/USE_INPUT_PARTITION/USE_INPUT_FRAGMENTS/' \
   443.9  		-e 's/0.9.7/1.0.0/' mozilla/configure.in mozilla/configure
  443.10 -	#patch -p1 -i $stuff/google-breakpad.u || exit 1
  443.11  	cat >> mozilla/layout/build/Makefile.in << "EOF"
  443.12  ifdef MOZ_ENABLE_CANVAS
  443.13  EXTRA_DSO_LDOPTS += $(XLDFLAGS) -lX11 -lXrender
  443.14 @@ -32,8 +30,6 @@
  443.15  EOF
  443.16  	unset CFLAGS
  443.17  	unset CXXFLAGS
  443.18 -	patch -Np1 -i $stuff/seamonkey-2.0-lang.patch
  443.19 -	patch -Np1 -i $stuff/seamonkey-install-dir.patch
  443.20  	export LDFLAGS="$LDFLAGS -Wl,-rpath,/usr/lib/seamonkey"
  443.21  	./configure $CONFIGURE_ARGS 2>&1 | grep -v 'cthandlers/calendar/Makefile.in' &&
  443.22  	make &&
   444.1 --- a/seamonkey/stuff/google-breakpad.u	Wed May 09 17:03:28 2018 +0300
   444.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   444.3 @@ -1,30 +0,0 @@
   444.4 ---- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc	Mon Jan  4 22:04:19 2010
   444.5 -+++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc	Mon Jan 18 16:04:10 2010
   444.6 -@@ -29,6 +29,7 @@
   444.7 - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   444.8 - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   444.9 - 
  444.10 -+#include <stdio.h>
  444.11 - #include <signal.h>
  444.12 - #include <sys/stat.h>
  444.13 - #include <sys/types.h>
  444.14 ---- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc	Mon Jan  4 22:04:19 2010
  444.15 -+++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc	Mon Jan 18 16:02:40 2010
  444.16 -@@ -29,6 +29,7 @@
  444.17 - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  444.18 - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  444.19 - 
  444.20 -+#include <stdio.h>
  444.21 - #include <fcntl.h>
  444.22 - #include <pthread.h>
  444.23 - #include <signal.h>
  444.24 ---- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Mon Jan  4 22:04:19 2010
  444.25 -+++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Mon Jan 18 16:03:26 2010
  444.26 -@@ -27,6 +27,7 @@
  444.27 - // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  444.28 - // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  444.29 - 
  444.30 -+#include <stdio.h>
  444.31 - #include <a.out.h>
  444.32 - #include <cstdarg>
  444.33 - #include <cstdlib>
   445.1 --- a/seamonkey/stuff/linux-remove.patch	Wed May 09 17:03:28 2018 +0300
   445.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   445.3 @@ -1,366 +0,0 @@
   445.4 -Index: mozilla/security/coreconf/Linux2.1.mk
   445.5 -===================================================================
   445.6 -RCS file: mozilla/security/coreconf/Linux2.1.mk
   445.7 -diff -N mozilla/security/coreconf/Linux2.1.mk
   445.8 ---- mozilla/security/coreconf/Linux2.1.mk	11 Jun 2009 00:55:32 -0000	1.7
   445.9 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
  445.10 -@@ -1,48 +0,0 @@
  445.11 --#
  445.12 --# ***** BEGIN LICENSE BLOCK *****
  445.13 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  445.14 --#
  445.15 --# The contents of this file are subject to the Mozilla Public License Version
  445.16 --# 1.1 (the "License"); you may not use this file except in compliance with
  445.17 --# the License. You may obtain a copy of the License at
  445.18 --# http://www.mozilla.org/MPL/
  445.19 --#
  445.20 --# Software distributed under the License is distributed on an "AS IS" basis,
  445.21 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  445.22 --# for the specific language governing rights and limitations under the
  445.23 --# License.
  445.24 --#
  445.25 --# The Original Code is the Netscape security libraries.
  445.26 --#
  445.27 --# The Initial Developer of the Original Code is
  445.28 --# Netscape Communications Corporation.
  445.29 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
  445.30 --# the Initial Developer. All Rights Reserved.
  445.31 --#
  445.32 --# Contributor(s):
  445.33 --#
  445.34 --# Alternatively, the contents of this file may be used under the terms of
  445.35 --# either the GNU General Public License Version 2 or later (the "GPL"), or
  445.36 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  445.37 --# in which case the provisions of the GPL or the LGPL are applicable instead
  445.38 --# of those above. If you wish to allow use of your version of this file only
  445.39 --# under the terms of either the GPL or the LGPL, and not to allow others to
  445.40 --# use your version of this file under the terms of the MPL, indicate your
  445.41 --# decision by deleting the provisions above and replace them with the notice
  445.42 --# and other provisions required by the GPL or the LGPL. If you do not delete
  445.43 --# the provisions above, a recipient may use your version of this file under
  445.44 --# the terms of any one of the MPL, the GPL or the LGPL.
  445.45 --#
  445.46 --# ***** END LICENSE BLOCK *****
  445.47 --
  445.48 --include $(CORE_DEPTH)/coreconf/Linux.mk
  445.49 --ifeq ($(OS_RELEASE),2.1)
  445.50 --        OS_REL_CFLAGS   += -DLINUX2_1
  445.51 --        MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
  445.52 --	ifdef MAPFILE
  445.53 --		MKSHLIB += -Wl,--version-script,$(MAPFILE)
  445.54 --	endif
  445.55 --	PROCESS_MAP_FILE = grep -v ';-' $< | \
  445.56 --       	 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
  445.57 --endif
  445.58 --
  445.59 -Index: mozilla/security/coreconf/Linux2.2.mk
  445.60 -===================================================================
  445.61 -RCS file: mozilla/security/coreconf/Linux2.2.mk
  445.62 -diff -N mozilla/security/coreconf/Linux2.2.mk
  445.63 ---- mozilla/security/coreconf/Linux2.2.mk	11 Jun 2009 00:55:32 -0000	1.7
  445.64 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
  445.65 -@@ -1,48 +0,0 @@
  445.66 --#
  445.67 --# ***** BEGIN LICENSE BLOCK *****
  445.68 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  445.69 --#
  445.70 --# The contents of this file are subject to the Mozilla Public License Version
  445.71 --# 1.1 (the "License"); you may not use this file except in compliance with
  445.72 --# the License. You may obtain a copy of the License at
  445.73 --# http://www.mozilla.org/MPL/
  445.74 --#
  445.75 --# Software distributed under the License is distributed on an "AS IS" basis,
  445.76 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  445.77 --# for the specific language governing rights and limitations under the
  445.78 --# License.
  445.79 --#
  445.80 --# The Original Code is the Netscape security libraries.
  445.81 --#
  445.82 --# The Initial Developer of the Original Code is
  445.83 --# Netscape Communications Corporation.
  445.84 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
  445.85 --# the Initial Developer. All Rights Reserved.
  445.86 --#
  445.87 --# Contributor(s):
  445.88 --#
  445.89 --# Alternatively, the contents of this file may be used under the terms of
  445.90 --# either the GNU General Public License Version 2 or later (the "GPL"), or
  445.91 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  445.92 --# in which case the provisions of the GPL or the LGPL are applicable instead
  445.93 --# of those above. If you wish to allow use of your version of this file only
  445.94 --# under the terms of either the GPL or the LGPL, and not to allow others to
  445.95 --# use your version of this file under the terms of the MPL, indicate your
  445.96 --# decision by deleting the provisions above and replace them with the notice
  445.97 --# and other provisions required by the GPL or the LGPL. If you do not delete
  445.98 --# the provisions above, a recipient may use your version of this file under
  445.99 --# the terms of any one of the MPL, the GPL or the LGPL.
 445.100 --#
 445.101 --# ***** END LICENSE BLOCK *****
 445.102 --
 445.103 --include $(CORE_DEPTH)/coreconf/Linux.mk
 445.104 --
 445.105 --OS_REL_CFLAGS   += -DLINUX2_1
 445.106 --MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 445.107 --
 445.108 --ifdef MAPFILE
 445.109 --	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 445.110 --endif
 445.111 --PROCESS_MAP_FILE = grep -v ';-' $< | \
 445.112 --        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 445.113 --
 445.114 -Index: mozilla/security/coreconf/Linux2.4.mk
 445.115 -===================================================================
 445.116 -RCS file: mozilla/security/coreconf/Linux2.4.mk
 445.117 -diff -N mozilla/security/coreconf/Linux2.4.mk
 445.118 ---- mozilla/security/coreconf/Linux2.4.mk	21 Jul 2010 16:23:15 -0000	1.10
 445.119 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
 445.120 -@@ -1,49 +0,0 @@
 445.121 --#
 445.122 --# ***** BEGIN LICENSE BLOCK *****
 445.123 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 445.124 --#
 445.125 --# The contents of this file are subject to the Mozilla Public License Version
 445.126 --# 1.1 (the "License"); you may not use this file except in compliance with
 445.127 --# the License. You may obtain a copy of the License at
 445.128 --# http://www.mozilla.org/MPL/
 445.129 --#
 445.130 --# Software distributed under the License is distributed on an "AS IS" basis,
 445.131 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 445.132 --# for the specific language governing rights and limitations under the
 445.133 --# License.
 445.134 --#
 445.135 --# The Original Code is the Netscape security libraries.
 445.136 --#
 445.137 --# The Initial Developer of the Original Code is
 445.138 --# Netscape Communications Corporation.
 445.139 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
 445.140 --# the Initial Developer. All Rights Reserved.
 445.141 --#
 445.142 --# Contributor(s):
 445.143 --#
 445.144 --# Alternatively, the contents of this file may be used under the terms of
 445.145 --# either the GNU General Public License Version 2 or later (the "GPL"), or
 445.146 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 445.147 --# in which case the provisions of the GPL or the LGPL are applicable instead
 445.148 --# of those above. If you wish to allow use of your version of this file only
 445.149 --# under the terms of either the GPL or the LGPL, and not to allow others to
 445.150 --# use your version of this file under the terms of the MPL, indicate your
 445.151 --# decision by deleting the provisions above and replace them with the notice
 445.152 --# and other provisions required by the GPL or the LGPL. If you do not delete
 445.153 --# the provisions above, a recipient may use your version of this file under
 445.154 --# the terms of any one of the MPL, the GPL or the LGPL.
 445.155 --#
 445.156 --# ***** END LICENSE BLOCK *****
 445.157 --
 445.158 --include $(CORE_DEPTH)/coreconf/Linux.mk
 445.159 --
 445.160 --OS_REL_CFLAGS   += -DLINUX2_1
 445.161 --MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 445.162 --
 445.163 --ifdef MAPFILE
 445.164 --	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 445.165 --endif
 445.166 --PROCESS_MAP_FILE = grep -v ';-' $< | \
 445.167 --        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 445.168 --        
 445.169 --DEFINES += -DNO_FORK_CHECK
 445.170 -Index: mozilla/security/coreconf/Linux2.5.mk
 445.171 -===================================================================
 445.172 -RCS file: mozilla/security/coreconf/Linux2.5.mk
 445.173 -diff -N mozilla/security/coreconf/Linux2.5.mk
 445.174 ---- mozilla/security/coreconf/Linux2.5.mk	11 Jun 2009 00:55:32 -0000	1.6
 445.175 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
 445.176 -@@ -1,48 +0,0 @@
 445.177 --#
 445.178 --# ***** BEGIN LICENSE BLOCK *****
 445.179 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 445.180 --#
 445.181 --# The contents of this file are subject to the Mozilla Public License Version
 445.182 --# 1.1 (the "License"); you may not use this file except in compliance with
 445.183 --# the License. You may obtain a copy of the License at
 445.184 --# http://www.mozilla.org/MPL/
 445.185 --#
 445.186 --# Software distributed under the License is distributed on an "AS IS" basis,
 445.187 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 445.188 --# for the specific language governing rights and limitations under the
 445.189 --# License.
 445.190 --#
 445.191 --# The Original Code is the Netscape security libraries.
 445.192 --#
 445.193 --# The Initial Developer of the Original Code is
 445.194 --# Netscape Communications Corporation.
 445.195 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
 445.196 --# the Initial Developer. All Rights Reserved.
 445.197 --#
 445.198 --# Contributor(s):
 445.199 --#
 445.200 --# Alternatively, the contents of this file may be used under the terms of
 445.201 --# either the GNU General Public License Version 2 or later (the "GPL"), or
 445.202 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 445.203 --# in which case the provisions of the GPL or the LGPL are applicable instead
 445.204 --# of those above. If you wish to allow use of your version of this file only
 445.205 --# under the terms of either the GPL or the LGPL, and not to allow others to
 445.206 --# use your version of this file under the terms of the MPL, indicate your
 445.207 --# decision by deleting the provisions above and replace them with the notice
 445.208 --# and other provisions required by the GPL or the LGPL. If you do not delete
 445.209 --# the provisions above, a recipient may use your version of this file under
 445.210 --# the terms of any one of the MPL, the GPL or the LGPL.
 445.211 --#
 445.212 --# ***** END LICENSE BLOCK *****
 445.213 --
 445.214 --include $(CORE_DEPTH)/coreconf/Linux.mk
 445.215 --
 445.216 --OS_REL_CFLAGS   += -DLINUX2_1
 445.217 --MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 445.218 --
 445.219 --ifdef MAPFILE
 445.220 --	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 445.221 --endif
 445.222 --PROCESS_MAP_FILE = grep -v ';-' $< | \
 445.223 --        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 445.224 --
 445.225 -Index: mozilla/security/coreconf/Linux2.6.mk
 445.226 -===================================================================
 445.227 -RCS file: mozilla/security/coreconf/Linux2.6.mk
 445.228 -diff -N mozilla/security/coreconf/Linux2.6.mk
 445.229 ---- mozilla/security/coreconf/Linux2.6.mk	11 Jun 2009 00:55:32 -0000	1.6
 445.230 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
 445.231 -@@ -1,48 +0,0 @@
 445.232 --#
 445.233 --# ***** BEGIN LICENSE BLOCK *****
 445.234 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 445.235 --#
 445.236 --# The contents of this file are subject to the Mozilla Public License Version
 445.237 --# 1.1 (the "License"); you may not use this file except in compliance with
 445.238 --# the License. You may obtain a copy of the License at
 445.239 --# http://www.mozilla.org/MPL/
 445.240 --#
 445.241 --# Software distributed under the License is distributed on an "AS IS" basis,
 445.242 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 445.243 --# for the specific language governing rights and limitations under the
 445.244 --# License.
 445.245 --#
 445.246 --# The Original Code is the Netscape security libraries.
 445.247 --#
 445.248 --# The Initial Developer of the Original Code is
 445.249 --# Netscape Communications Corporation.
 445.250 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
 445.251 --# the Initial Developer. All Rights Reserved.
 445.252 --#
 445.253 --# Contributor(s):
 445.254 --#
 445.255 --# Alternatively, the contents of this file may be used under the terms of
 445.256 --# either the GNU General Public License Version 2 or later (the "GPL"), or
 445.257 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 445.258 --# in which case the provisions of the GPL or the LGPL are applicable instead
 445.259 --# of those above. If you wish to allow use of your version of this file only
 445.260 --# under the terms of either the GPL or the LGPL, and not to allow others to
 445.261 --# use your version of this file under the terms of the MPL, indicate your
 445.262 --# decision by deleting the provisions above and replace them with the notice
 445.263 --# and other provisions required by the GPL or the LGPL. If you do not delete
 445.264 --# the provisions above, a recipient may use your version of this file under
 445.265 --# the terms of any one of the MPL, the GPL or the LGPL.
 445.266 --#
 445.267 --# ***** END LICENSE BLOCK *****
 445.268 --
 445.269 --include $(CORE_DEPTH)/coreconf/Linux.mk
 445.270 --
 445.271 --OS_REL_CFLAGS   += -DLINUX2_1
 445.272 --MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 445.273 --
 445.274 --ifdef MAPFILE
 445.275 --	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 445.276 --endif
 445.277 --PROCESS_MAP_FILE = grep -v ';-' $< | \
 445.278 --        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 445.279 --
 445.280 -Index: mozilla/security/coreconf/LinuxELF1.2.mk
 445.281 -===================================================================
 445.282 -RCS file: mozilla/security/coreconf/LinuxELF1.2.mk
 445.283 -diff -N mozilla/security/coreconf/LinuxELF1.2.mk
 445.284 ---- mozilla/security/coreconf/LinuxELF1.2.mk	25 Apr 2004 15:02:17 -0000	1.2
 445.285 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
 445.286 -@@ -1,38 +0,0 @@
 445.287 --#
 445.288 --# ***** BEGIN LICENSE BLOCK *****
 445.289 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 445.290 --#
 445.291 --# The contents of this file are subject to the Mozilla Public License Version
 445.292 --# 1.1 (the "License"); you may not use this file except in compliance with
 445.293 --# the License. You may obtain a copy of the License at
 445.294 --# http://www.mozilla.org/MPL/
 445.295 --#
 445.296 --# Software distributed under the License is distributed on an "AS IS" basis,
 445.297 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 445.298 --# for the specific language governing rights and limitations under the
 445.299 --# License.
 445.300 --#
 445.301 --# The Original Code is the Netscape security libraries.
 445.302 --#
 445.303 --# The Initial Developer of the Original Code is
 445.304 --# Netscape Communications Corporation.
 445.305 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
 445.306 --# the Initial Developer. All Rights Reserved.
 445.307 --#
 445.308 --# Contributor(s):
 445.309 --#
 445.310 --# Alternatively, the contents of this file may be used under the terms of
 445.311 --# either the GNU General Public License Version 2 or later (the "GPL"), or
 445.312 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 445.313 --# in which case the provisions of the GPL or the LGPL are applicable instead
 445.314 --# of those above. If you wish to allow use of your version of this file only
 445.315 --# under the terms of either the GPL or the LGPL, and not to allow others to
 445.316 --# use your version of this file under the terms of the MPL, indicate your
 445.317 --# decision by deleting the provisions above and replace them with the notice
 445.318 --# and other provisions required by the GPL or the LGPL. If you do not delete
 445.319 --# the provisions above, a recipient may use your version of this file under
 445.320 --# the terms of any one of the MPL, the GPL or the LGPL.
 445.321 --#
 445.322 --# ***** END LICENSE BLOCK *****
 445.323 --
 445.324 --include $(CORE_DEPTH)/coreconf/Linux.mk
 445.325 -Index: mozilla/security/coreconf/LinuxELF2.0.mk
 445.326 -===================================================================
 445.327 -RCS file: mozilla/security/coreconf/LinuxELF2.0.mk
 445.328 -diff -N mozilla/security/coreconf/LinuxELF2.0.mk
 445.329 ---- mozilla/security/coreconf/LinuxELF2.0.mk	25 Apr 2004 15:02:17 -0000	1.2
 445.330 -+++ /dev/null	1 Jan 1970 00:00:00 -0000
 445.331 -@@ -1,38 +0,0 @@
 445.332 --#
 445.333 --# ***** BEGIN LICENSE BLOCK *****
 445.334 --# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 445.335 --#
 445.336 --# The contents of this file are subject to the Mozilla Public License Version
 445.337 --# 1.1 (the "License"); you may not use this file except in compliance with
 445.338 --# the License. You may obtain a copy of the License at
 445.339 --# http://www.mozilla.org/MPL/
 445.340 --#
 445.341 --# Software distributed under the License is distributed on an "AS IS" basis,
 445.342 --# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 445.343 --# for the specific language governing rights and limitations under the
 445.344 --# License.
 445.345 --#
 445.346 --# The Original Code is the Netscape security libraries.
 445.347 --#
 445.348 --# The Initial Developer of the Original Code is
 445.349 --# Netscape Communications Corporation.
 445.350 --# Portions created by the Initial Developer are Copyright (C) 1994-2000
 445.351 --# the Initial Developer. All Rights Reserved.
 445.352 --#
 445.353 --# Contributor(s):
 445.354 --#
 445.355 --# Alternatively, the contents of this file may be used under the terms of
 445.356 --# either the GNU General Public License Version 2 or later (the "GPL"), or
 445.357 --# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 445.358 --# in which case the provisions of the GPL or the LGPL are applicable instead
 445.359 --# of those above. If you wish to allow use of your version of this file only
 445.360 --# under the terms of either the GPL or the LGPL, and not to allow others to
 445.361 --# use your version of this file under the terms of the MPL, indicate your
 445.362 --# decision by deleting the provisions above and replace them with the notice
 445.363 --# and other provisions required by the GPL or the LGPL. If you do not delete
 445.364 --# the provisions above, a recipient may use your version of this file under
 445.365 --# the terms of any one of the MPL, the GPL or the LGPL.
 445.366 --#
 445.367 --# ***** END LICENSE BLOCK *****
 445.368 --
 445.369 --include $(CORE_DEPTH)/coreconf/Linux.mk
   446.1 --- a/seamonkey/stuff/linux3.0.patch	Wed May 09 17:03:28 2018 +0300
   446.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   446.3 @@ -1,54 +0,0 @@
   446.4 -Index: mozilla/security/coreconf/Linux.mk
   446.5 -===================================================================
   446.6 -RCS file: /cvsroot/mozilla/security/coreconf/Linux.mk,v
   446.7 -retrieving revision 1.48
   446.8 -diff -u -8 -r1.48 Linux.mk
   446.9 ---- mozilla/security/coreconf/Linux.mk	13 Aug 2010 01:31:13 -0000	1.48
  446.10 -+++ mozilla/security/coreconf/Linux.mk	3 Jul 2011 06:00:38 -0000
  446.11 -@@ -187,8 +187,20 @@
  446.12 - ifeq ($(BUILD_SUN_PKG), 1)
  446.13 - ifeq ($(USE_64), 1)
  446.14 - RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib'
  446.15 - else
  446.16 - RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib'
  446.17 - endif
  446.18 - endif
  446.19 - 
  446.20 -+OS_REL_CFLAGS   += -DLINUX2_1
  446.21 -+MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
  446.22 -+
  446.23 -+ifdef MAPFILE
  446.24 -+	MKSHLIB += -Wl,--version-script,$(MAPFILE)
  446.25 -+endif
  446.26 -+PROCESS_MAP_FILE = grep -v ';-' $< | \
  446.27 -+        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
  446.28 -+
  446.29 -+ifeq ($(OS_RELEASE),2.4)
  446.30 -+DEFINES += -DNO_FORK_CHECK
  446.31 -+endif
  446.32 -Index: mozilla/security/coreconf/config.mk
  446.33 -===================================================================
  446.34 -RCS file: /cvsroot/mozilla/security/coreconf/config.mk,v
  446.35 -retrieving revision 1.30
  446.36 -diff -u -8 -r1.30 config.mk
  446.37 ---- mozilla/security/coreconf/config.mk	25 Aug 2009 22:35:11 -0000	1.30
  446.38 -+++ mozilla/security/coreconf/config.mk	3 Jul 2011 06:00:39 -0000
  446.39 -@@ -58,17 +58,17 @@
  446.40 - #       (dependent upon <architecture> tags)                          #
  446.41 - #                                                                     #
  446.42 - #       We are moving towards just having a $(OS_TARGET).mk file      #
  446.43 - #       as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files,    #
  446.44 - #       one for each OS release.                                      #
  446.45 - #######################################################################
  446.46 - 
  446.47 - TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
  446.48 --              AIX RISCOS WINNT WIN95 WINCE
  446.49 -+              AIX RISCOS WINNT WIN95 WINCE Linux
  446.50 - 
  446.51 - ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
  446.52 - include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
  446.53 - else
  446.54 - include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk
  446.55 - endif
  446.56 - 
  446.57 - #######################################################################
   447.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   447.2 +++ b/seamonkey/stuff/patches/google-breakpad.u	Thu May 10 21:12:00 2018 +0300
   447.3 @@ -0,0 +1,30 @@
   447.4 +--- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc	Mon Jan  4 22:04:19 2010
   447.5 ++++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/exception_handler.cc	Mon Jan 18 16:04:10 2010
   447.6 +@@ -29,6 +29,7 @@
   447.7 + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
   447.8 + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   447.9 + 
  447.10 ++#include <stdio.h>
  447.11 + #include <signal.h>
  447.12 + #include <sys/stat.h>
  447.13 + #include <sys/types.h>
  447.14 +--- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc	Mon Jan  4 22:04:19 2010
  447.15 ++++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/client/linux/handler/minidump_generator.cc	Mon Jan 18 16:02:40 2010
  447.16 +@@ -29,6 +29,7 @@
  447.17 + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  447.18 + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  447.19 + 
  447.20 ++#include <stdio.h>
  447.21 + #include <fcntl.h>
  447.22 + #include <pthread.h>
  447.23 + #include <signal.h>
  447.24 +--- seamonkey-2.0.2.ori/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Mon Jan  4 22:04:19 2010
  447.25 ++++ seamonkey-2.0.2/mozilla/toolkit/crashreporter/google-breakpad/src/common/linux/dump_symbols.cc	Mon Jan 18 16:03:26 2010
  447.26 +@@ -27,6 +27,7 @@
  447.27 + // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  447.28 + // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  447.29 + 
  447.30 ++#include <stdio.h>
  447.31 + #include <a.out.h>
  447.32 + #include <cstdarg>
  447.33 + #include <cstdlib>
   448.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   448.2 +++ b/seamonkey/stuff/patches/linux-remove.patch	Thu May 10 21:12:00 2018 +0300
   448.3 @@ -0,0 +1,366 @@
   448.4 +Index: mozilla/security/coreconf/Linux2.1.mk
   448.5 +===================================================================
   448.6 +RCS file: mozilla/security/coreconf/Linux2.1.mk
   448.7 +diff -N mozilla/security/coreconf/Linux2.1.mk
   448.8 +--- mozilla/security/coreconf/Linux2.1.mk	11 Jun 2009 00:55:32 -0000	1.7
   448.9 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
  448.10 +@@ -1,48 +0,0 @@
  448.11 +-#
  448.12 +-# ***** BEGIN LICENSE BLOCK *****
  448.13 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  448.14 +-#
  448.15 +-# The contents of this file are subject to the Mozilla Public License Version
  448.16 +-# 1.1 (the "License"); you may not use this file except in compliance with
  448.17 +-# the License. You may obtain a copy of the License at
  448.18 +-# http://www.mozilla.org/MPL/
  448.19 +-#
  448.20 +-# Software distributed under the License is distributed on an "AS IS" basis,
  448.21 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  448.22 +-# for the specific language governing rights and limitations under the
  448.23 +-# License.
  448.24 +-#
  448.25 +-# The Original Code is the Netscape security libraries.
  448.26 +-#
  448.27 +-# The Initial Developer of the Original Code is
  448.28 +-# Netscape Communications Corporation.
  448.29 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
  448.30 +-# the Initial Developer. All Rights Reserved.
  448.31 +-#
  448.32 +-# Contributor(s):
  448.33 +-#
  448.34 +-# Alternatively, the contents of this file may be used under the terms of
  448.35 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
  448.36 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  448.37 +-# in which case the provisions of the GPL or the LGPL are applicable instead
  448.38 +-# of those above. If you wish to allow use of your version of this file only
  448.39 +-# under the terms of either the GPL or the LGPL, and not to allow others to
  448.40 +-# use your version of this file under the terms of the MPL, indicate your
  448.41 +-# decision by deleting the provisions above and replace them with the notice
  448.42 +-# and other provisions required by the GPL or the LGPL. If you do not delete
  448.43 +-# the provisions above, a recipient may use your version of this file under
  448.44 +-# the terms of any one of the MPL, the GPL or the LGPL.
  448.45 +-#
  448.46 +-# ***** END LICENSE BLOCK *****
  448.47 +-
  448.48 +-include $(CORE_DEPTH)/coreconf/Linux.mk
  448.49 +-ifeq ($(OS_RELEASE),2.1)
  448.50 +-        OS_REL_CFLAGS   += -DLINUX2_1
  448.51 +-        MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
  448.52 +-	ifdef MAPFILE
  448.53 +-		MKSHLIB += -Wl,--version-script,$(MAPFILE)
  448.54 +-	endif
  448.55 +-	PROCESS_MAP_FILE = grep -v ';-' $< | \
  448.56 +-       	 sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
  448.57 +-endif
  448.58 +-
  448.59 +Index: mozilla/security/coreconf/Linux2.2.mk
  448.60 +===================================================================
  448.61 +RCS file: mozilla/security/coreconf/Linux2.2.mk
  448.62 +diff -N mozilla/security/coreconf/Linux2.2.mk
  448.63 +--- mozilla/security/coreconf/Linux2.2.mk	11 Jun 2009 00:55:32 -0000	1.7
  448.64 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
  448.65 +@@ -1,48 +0,0 @@
  448.66 +-#
  448.67 +-# ***** BEGIN LICENSE BLOCK *****
  448.68 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
  448.69 +-#
  448.70 +-# The contents of this file are subject to the Mozilla Public License Version
  448.71 +-# 1.1 (the "License"); you may not use this file except in compliance with
  448.72 +-# the License. You may obtain a copy of the License at
  448.73 +-# http://www.mozilla.org/MPL/
  448.74 +-#
  448.75 +-# Software distributed under the License is distributed on an "AS IS" basis,
  448.76 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  448.77 +-# for the specific language governing rights and limitations under the
  448.78 +-# License.
  448.79 +-#
  448.80 +-# The Original Code is the Netscape security libraries.
  448.81 +-#
  448.82 +-# The Initial Developer of the Original Code is
  448.83 +-# Netscape Communications Corporation.
  448.84 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
  448.85 +-# the Initial Developer. All Rights Reserved.
  448.86 +-#
  448.87 +-# Contributor(s):
  448.88 +-#
  448.89 +-# Alternatively, the contents of this file may be used under the terms of
  448.90 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
  448.91 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
  448.92 +-# in which case the provisions of the GPL or the LGPL are applicable instead
  448.93 +-# of those above. If you wish to allow use of your version of this file only
  448.94 +-# under the terms of either the GPL or the LGPL, and not to allow others to
  448.95 +-# use your version of this file under the terms of the MPL, indicate your
  448.96 +-# decision by deleting the provisions above and replace them with the notice
  448.97 +-# and other provisions required by the GPL or the LGPL. If you do not delete
  448.98 +-# the provisions above, a recipient may use your version of this file under
  448.99 +-# the terms of any one of the MPL, the GPL or the LGPL.
 448.100 +-#
 448.101 +-# ***** END LICENSE BLOCK *****
 448.102 +-
 448.103 +-include $(CORE_DEPTH)/coreconf/Linux.mk
 448.104 +-
 448.105 +-OS_REL_CFLAGS   += -DLINUX2_1
 448.106 +-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 448.107 +-
 448.108 +-ifdef MAPFILE
 448.109 +-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 448.110 +-endif
 448.111 +-PROCESS_MAP_FILE = grep -v ';-' $< | \
 448.112 +-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 448.113 +-
 448.114 +Index: mozilla/security/coreconf/Linux2.4.mk
 448.115 +===================================================================
 448.116 +RCS file: mozilla/security/coreconf/Linux2.4.mk
 448.117 +diff -N mozilla/security/coreconf/Linux2.4.mk
 448.118 +--- mozilla/security/coreconf/Linux2.4.mk	21 Jul 2010 16:23:15 -0000	1.10
 448.119 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
 448.120 +@@ -1,49 +0,0 @@
 448.121 +-#
 448.122 +-# ***** BEGIN LICENSE BLOCK *****
 448.123 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 448.124 +-#
 448.125 +-# The contents of this file are subject to the Mozilla Public License Version
 448.126 +-# 1.1 (the "License"); you may not use this file except in compliance with
 448.127 +-# the License. You may obtain a copy of the License at
 448.128 +-# http://www.mozilla.org/MPL/
 448.129 +-#
 448.130 +-# Software distributed under the License is distributed on an "AS IS" basis,
 448.131 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 448.132 +-# for the specific language governing rights and limitations under the
 448.133 +-# License.
 448.134 +-#
 448.135 +-# The Original Code is the Netscape security libraries.
 448.136 +-#
 448.137 +-# The Initial Developer of the Original Code is
 448.138 +-# Netscape Communications Corporation.
 448.139 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
 448.140 +-# the Initial Developer. All Rights Reserved.
 448.141 +-#
 448.142 +-# Contributor(s):
 448.143 +-#
 448.144 +-# Alternatively, the contents of this file may be used under the terms of
 448.145 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
 448.146 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 448.147 +-# in which case the provisions of the GPL or the LGPL are applicable instead
 448.148 +-# of those above. If you wish to allow use of your version of this file only
 448.149 +-# under the terms of either the GPL or the LGPL, and not to allow others to
 448.150 +-# use your version of this file under the terms of the MPL, indicate your
 448.151 +-# decision by deleting the provisions above and replace them with the notice
 448.152 +-# and other provisions required by the GPL or the LGPL. If you do not delete
 448.153 +-# the provisions above, a recipient may use your version of this file under
 448.154 +-# the terms of any one of the MPL, the GPL or the LGPL.
 448.155 +-#
 448.156 +-# ***** END LICENSE BLOCK *****
 448.157 +-
 448.158 +-include $(CORE_DEPTH)/coreconf/Linux.mk
 448.159 +-
 448.160 +-OS_REL_CFLAGS   += -DLINUX2_1
 448.161 +-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 448.162 +-
 448.163 +-ifdef MAPFILE
 448.164 +-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 448.165 +-endif
 448.166 +-PROCESS_MAP_FILE = grep -v ';-' $< | \
 448.167 +-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 448.168 +-        
 448.169 +-DEFINES += -DNO_FORK_CHECK
 448.170 +Index: mozilla/security/coreconf/Linux2.5.mk
 448.171 +===================================================================
 448.172 +RCS file: mozilla/security/coreconf/Linux2.5.mk
 448.173 +diff -N mozilla/security/coreconf/Linux2.5.mk
 448.174 +--- mozilla/security/coreconf/Linux2.5.mk	11 Jun 2009 00:55:32 -0000	1.6
 448.175 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
 448.176 +@@ -1,48 +0,0 @@
 448.177 +-#
 448.178 +-# ***** BEGIN LICENSE BLOCK *****
 448.179 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 448.180 +-#
 448.181 +-# The contents of this file are subject to the Mozilla Public License Version
 448.182 +-# 1.1 (the "License"); you may not use this file except in compliance with
 448.183 +-# the License. You may obtain a copy of the License at
 448.184 +-# http://www.mozilla.org/MPL/
 448.185 +-#
 448.186 +-# Software distributed under the License is distributed on an "AS IS" basis,
 448.187 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 448.188 +-# for the specific language governing rights and limitations under the
 448.189 +-# License.
 448.190 +-#
 448.191 +-# The Original Code is the Netscape security libraries.
 448.192 +-#
 448.193 +-# The Initial Developer of the Original Code is
 448.194 +-# Netscape Communications Corporation.
 448.195 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
 448.196 +-# the Initial Developer. All Rights Reserved.
 448.197 +-#
 448.198 +-# Contributor(s):
 448.199 +-#
 448.200 +-# Alternatively, the contents of this file may be used under the terms of
 448.201 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
 448.202 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 448.203 +-# in which case the provisions of the GPL or the LGPL are applicable instead
 448.204 +-# of those above. If you wish to allow use of your version of this file only
 448.205 +-# under the terms of either the GPL or the LGPL, and not to allow others to
 448.206 +-# use your version of this file under the terms of the MPL, indicate your
 448.207 +-# decision by deleting the provisions above and replace them with the notice
 448.208 +-# and other provisions required by the GPL or the LGPL. If you do not delete
 448.209 +-# the provisions above, a recipient may use your version of this file under
 448.210 +-# the terms of any one of the MPL, the GPL or the LGPL.
 448.211 +-#
 448.212 +-# ***** END LICENSE BLOCK *****
 448.213 +-
 448.214 +-include $(CORE_DEPTH)/coreconf/Linux.mk
 448.215 +-
 448.216 +-OS_REL_CFLAGS   += -DLINUX2_1
 448.217 +-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 448.218 +-
 448.219 +-ifdef MAPFILE
 448.220 +-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 448.221 +-endif
 448.222 +-PROCESS_MAP_FILE = grep -v ';-' $< | \
 448.223 +-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 448.224 +-
 448.225 +Index: mozilla/security/coreconf/Linux2.6.mk
 448.226 +===================================================================
 448.227 +RCS file: mozilla/security/coreconf/Linux2.6.mk
 448.228 +diff -N mozilla/security/coreconf/Linux2.6.mk
 448.229 +--- mozilla/security/coreconf/Linux2.6.mk	11 Jun 2009 00:55:32 -0000	1.6
 448.230 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
 448.231 +@@ -1,48 +0,0 @@
 448.232 +-#
 448.233 +-# ***** BEGIN LICENSE BLOCK *****
 448.234 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 448.235 +-#
 448.236 +-# The contents of this file are subject to the Mozilla Public License Version
 448.237 +-# 1.1 (the "License"); you may not use this file except in compliance with
 448.238 +-# the License. You may obtain a copy of the License at
 448.239 +-# http://www.mozilla.org/MPL/
 448.240 +-#
 448.241 +-# Software distributed under the License is distributed on an "AS IS" basis,
 448.242 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 448.243 +-# for the specific language governing rights and limitations under the
 448.244 +-# License.
 448.245 +-#
 448.246 +-# The Original Code is the Netscape security libraries.
 448.247 +-#
 448.248 +-# The Initial Developer of the Original Code is
 448.249 +-# Netscape Communications Corporation.
 448.250 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
 448.251 +-# the Initial Developer. All Rights Reserved.
 448.252 +-#
 448.253 +-# Contributor(s):
 448.254 +-#
 448.255 +-# Alternatively, the contents of this file may be used under the terms of
 448.256 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
 448.257 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 448.258 +-# in which case the provisions of the GPL or the LGPL are applicable instead
 448.259 +-# of those above. If you wish to allow use of your version of this file only
 448.260 +-# under the terms of either the GPL or the LGPL, and not to allow others to
 448.261 +-# use your version of this file under the terms of the MPL, indicate your
 448.262 +-# decision by deleting the provisions above and replace them with the notice
 448.263 +-# and other provisions required by the GPL or the LGPL. If you do not delete
 448.264 +-# the provisions above, a recipient may use your version of this file under
 448.265 +-# the terms of any one of the MPL, the GPL or the LGPL.
 448.266 +-#
 448.267 +-# ***** END LICENSE BLOCK *****
 448.268 +-
 448.269 +-include $(CORE_DEPTH)/coreconf/Linux.mk
 448.270 +-
 448.271 +-OS_REL_CFLAGS   += -DLINUX2_1
 448.272 +-MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
 448.273 +-
 448.274 +-ifdef MAPFILE
 448.275 +-	MKSHLIB += -Wl,--version-script,$(MAPFILE)
 448.276 +-endif
 448.277 +-PROCESS_MAP_FILE = grep -v ';-' $< | \
 448.278 +-        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
 448.279 +-
 448.280 +Index: mozilla/security/coreconf/LinuxELF1.2.mk
 448.281 +===================================================================
 448.282 +RCS file: mozilla/security/coreconf/LinuxELF1.2.mk
 448.283 +diff -N mozilla/security/coreconf/LinuxELF1.2.mk
 448.284 +--- mozilla/security/coreconf/LinuxELF1.2.mk	25 Apr 2004 15:02:17 -0000	1.2
 448.285 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
 448.286 +@@ -1,38 +0,0 @@
 448.287 +-#
 448.288 +-# ***** BEGIN LICENSE BLOCK *****
 448.289 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 448.290 +-#
 448.291 +-# The contents of this file are subject to the Mozilla Public License Version
 448.292 +-# 1.1 (the "License"); you may not use this file except in compliance with
 448.293 +-# the License. You may obtain a copy of the License at
 448.294 +-# http://www.mozilla.org/MPL/
 448.295 +-#
 448.296 +-# Software distributed under the License is distributed on an "AS IS" basis,
 448.297 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 448.298 +-# for the specific language governing rights and limitations under the
 448.299 +-# License.
 448.300 +-#
 448.301 +-# The Original Code is the Netscape security libraries.
 448.302 +-#
 448.303 +-# The Initial Developer of the Original Code is
 448.304 +-# Netscape Communications Corporation.
 448.305 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
 448.306 +-# the Initial Developer. All Rights Reserved.
 448.307 +-#
 448.308 +-# Contributor(s):
 448.309 +-#
 448.310 +-# Alternatively, the contents of this file may be used under the terms of
 448.311 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
 448.312 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 448.313 +-# in which case the provisions of the GPL or the LGPL are applicable instead
 448.314 +-# of those above. If you wish to allow use of your version of this file only
 448.315 +-# under the terms of either the GPL or the LGPL, and not to allow others to
 448.316 +-# use your version of this file under the terms of the MPL, indicate your
 448.317 +-# decision by deleting the provisions above and replace them with the notice
 448.318 +-# and other provisions required by the GPL or the LGPL. If you do not delete
 448.319 +-# the provisions above, a recipient may use your version of this file under
 448.320 +-# the terms of any one of the MPL, the GPL or the LGPL.
 448.321 +-#
 448.322 +-# ***** END LICENSE BLOCK *****
 448.323 +-
 448.324 +-include $(CORE_DEPTH)/coreconf/Linux.mk
 448.325 +Index: mozilla/security/coreconf/LinuxELF2.0.mk
 448.326 +===================================================================
 448.327 +RCS file: mozilla/security/coreconf/LinuxELF2.0.mk
 448.328 +diff -N mozilla/security/coreconf/LinuxELF2.0.mk
 448.329 +--- mozilla/security/coreconf/LinuxELF2.0.mk	25 Apr 2004 15:02:17 -0000	1.2
 448.330 ++++ /dev/null	1 Jan 1970 00:00:00 -0000
 448.331 +@@ -1,38 +0,0 @@
 448.332 +-#
 448.333 +-# ***** BEGIN LICENSE BLOCK *****
 448.334 +-# Version: MPL 1.1/GPL 2.0/LGPL 2.1
 448.335 +-#
 448.336 +-# The contents of this file are subject to the Mozilla Public License Version
 448.337 +-# 1.1 (the "License"); you may not use this file except in compliance with
 448.338 +-# the License. You may obtain a copy of the License at
 448.339 +-# http://www.mozilla.org/MPL/
 448.340 +-#
 448.341 +-# Software distributed under the License is distributed on an "AS IS" basis,
 448.342 +-# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
 448.343 +-# for the specific language governing rights and limitations under the
 448.344 +-# License.
 448.345 +-#
 448.346 +-# The Original Code is the Netscape security libraries.
 448.347 +-#
 448.348 +-# The Initial Developer of the Original Code is
 448.349 +-# Netscape Communications Corporation.
 448.350 +-# Portions created by the Initial Developer are Copyright (C) 1994-2000
 448.351 +-# the Initial Developer. All Rights Reserved.
 448.352 +-#
 448.353 +-# Contributor(s):
 448.354 +-#
 448.355 +-# Alternatively, the contents of this file may be used under the terms of
 448.356 +-# either the GNU General Public License Version 2 or later (the "GPL"), or
 448.357 +-# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
 448.358 +-# in which case the provisions of the GPL or the LGPL are applicable instead
 448.359 +-# of those above. If you wish to allow use of your version of this file only
 448.360 +-# under the terms of either the GPL or the LGPL, and not to allow others to
 448.361 +-# use your version of this file under the terms of the MPL, indicate your
 448.362 +-# decision by deleting the provisions above and replace them with the notice
 448.363 +-# and other provisions required by the GPL or the LGPL. If you do not delete
 448.364 +-# the provisions above, a recipient may use your version of this file under
 448.365 +-# the terms of any one of the MPL, the GPL or the LGPL.
 448.366 +-#
 448.367 +-# ***** END LICENSE BLOCK *****
 448.368 +-
 448.369 +-include $(CORE_DEPTH)/coreconf/Linux.mk
   449.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   449.2 +++ b/seamonkey/stuff/patches/linux3.0.patch	Thu May 10 21:12:00 2018 +0300
   449.3 @@ -0,0 +1,54 @@
   449.4 +Index: mozilla/security/coreconf/Linux.mk
   449.5 +===================================================================
   449.6 +RCS file: /cvsroot/mozilla/security/coreconf/Linux.mk,v
   449.7 +retrieving revision 1.48
   449.8 +diff -u -8 -r1.48 Linux.mk
   449.9 +--- mozilla/security/coreconf/Linux.mk	13 Aug 2010 01:31:13 -0000	1.48
  449.10 ++++ mozilla/security/coreconf/Linux.mk	3 Jul 2011 06:00:38 -0000
  449.11 +@@ -187,8 +187,20 @@
  449.12 + ifeq ($(BUILD_SUN_PKG), 1)
  449.13 + ifeq ($(USE_64), 1)
  449.14 + RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib64:/opt/sun/private/lib'
  449.15 + else
  449.16 + RPATH = -Wl,-rpath,'$$ORIGIN:/opt/sun/private/lib'
  449.17 + endif
  449.18 + endif
  449.19 + 
  449.20 ++OS_REL_CFLAGS   += -DLINUX2_1
  449.21 ++MKSHLIB         = $(CC) $(DSO_LDOPTS) -Wl,-soname -Wl,$(@:$(OBJDIR)/%.so=%.so) $(RPATH)
  449.22 ++
  449.23 ++ifdef MAPFILE
  449.24 ++	MKSHLIB += -Wl,--version-script,$(MAPFILE)
  449.25 ++endif
  449.26 ++PROCESS_MAP_FILE = grep -v ';-' $< | \
  449.27 ++        sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
  449.28 ++
  449.29 ++ifeq ($(OS_RELEASE),2.4)
  449.30 ++DEFINES += -DNO_FORK_CHECK
  449.31 ++endif
  449.32 +Index: mozilla/security/coreconf/config.mk
  449.33 +===================================================================
  449.34 +RCS file: /cvsroot/mozilla/security/coreconf/config.mk,v
  449.35 +retrieving revision 1.30
  449.36 +diff -u -8 -r1.30 config.mk
  449.37 +--- mozilla/security/coreconf/config.mk	25 Aug 2009 22:35:11 -0000	1.30
  449.38 ++++ mozilla/security/coreconf/config.mk	3 Jul 2011 06:00:39 -0000
  449.39 +@@ -58,17 +58,17 @@
  449.40 + #       (dependent upon <architecture> tags)                          #
  449.41 + #                                                                     #
  449.42 + #       We are moving towards just having a $(OS_TARGET).mk file      #
  449.43 + #       as opposed to multiple $(OS_TARGET)$(OS_RELEASE).mk files,    #
  449.44 + #       one for each OS release.                                      #
  449.45 + #######################################################################
  449.46 + 
  449.47 + TARGET_OSES = FreeBSD BSD_OS NetBSD OpenUNIX OS2 QNX Darwin BeOS OpenBSD \
  449.48 +-              AIX RISCOS WINNT WIN95 WINCE
  449.49 ++              AIX RISCOS WINNT WIN95 WINCE Linux
  449.50 + 
  449.51 + ifeq (,$(filter-out $(TARGET_OSES),$(OS_TARGET)))
  449.52 + include $(CORE_DEPTH)/coreconf/$(OS_TARGET).mk
  449.53 + else
  449.54 + include $(CORE_DEPTH)/coreconf/$(OS_TARGET)$(OS_RELEASE).mk
  449.55 + endif
  449.56 + 
  449.57 + #######################################################################
   450.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   450.2 +++ b/seamonkey/stuff/patches/seamonkey-2.0-lang.patch	Thu May 10 21:12:00 2018 +0300
   450.3 @@ -0,0 +1,11 @@
   450.4 +--- comm-1.9.1/mozilla/modules/libpref/src/init/all.js	2009-10-11 02:12:44.000000000 +0200
   450.5 ++++ comm-1.9.1/mozilla/modules/libpref/src/init/all.js	2009-09-16 02:56:45.000000000 +0200
   450.6 +@@ -890,7 +890,7 @@
   450.7 + pref("intl.charset.detector",               "chrome://global/locale/intl.properties");
   450.8 + pref("intl.charset.default",                "chrome://global-platform/locale/intl.properties");
   450.9 + pref("intl.ellipsis",                       "chrome://global-platform/locale/intl.properties");
  450.10 +-pref("intl.locale.matchOS",                 false);
  450.11 ++pref("intl.locale.matchOS",                 true);
  450.12 + // fallback charset list for Unicode conversion (converting from Unicode)
  450.13 + // currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes)
  450.14 + // for ISO-8859-1
   451.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   451.2 +++ b/seamonkey/stuff/patches/seamonkey-install-dir.patch	Thu May 10 21:12:00 2018 +0300
   451.3 @@ -0,0 +1,42 @@
   451.4 +diff -Nur comm-beta.orig/config/autoconf.mk.in comm-beta/config/autoconf.mk.in
   451.5 +--- comm-beta.orig/config/autoconf.mk.in	2011-11-06 14:39:51.064983780 +0000
   451.6 ++++ comm-beta/config/autoconf.mk.in	2011-11-06 14:42:57.216735333 +0000
   451.7 +@@ -65,8 +65,8 @@
   451.8 + mandir		= @mandir@
   451.9 + idldir		= $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  451.10 +
  451.11 +-installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  451.12 +-sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
  451.13 ++installdir	= $(libdir)/$(MOZ_APP_NAME)
  451.14 ++sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel
  451.15 +
  451.16 + MOZDEPTH	= $(DEPTH)/mozilla
  451.17 + DIST		= $(MOZDEPTH)/dist
  451.18 +diff -Nur comm-beta.orig/mozilla/config/autoconf.mk.in comm-beta/mozilla/config/autoconf.mk.in
  451.19 +--- comm-beta.orig/mozilla/config/autoconf.mk.in	2011-11-06 14:39:41.771562967 +0000
  451.20 ++++ comm-beta/mozilla/config/autoconf.mk.in	2011-11-06 14:44:18.404165515 +0000
  451.21 +@@ -68,8 +68,8 @@
  451.22 + mandir		= @mandir@
  451.23 + idldir		= $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  451.24 +
  451.25 +-installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  451.26 +-sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
  451.27 ++installdir	= $(libdir)/$(MOZ_APP_NAME)
  451.28 ++sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel
  451.29 +
  451.30 + DIST		= $(DEPTH)/dist
  451.31 + LIBXUL_SDK      = @LIBXUL_SDK@
  451.32 +diff -Nur comm-beta.orig/mozilla/js/src/config/autoconf.mk.in comm-beta/mozilla/js/src/config/autoconf.mk.in
  451.33 +--- comm-beta.orig/mozilla/js/src/config/autoconf.mk.in	2011-11-06 14:39:48.014955070 +0000
  451.34 ++++ comm-beta/mozilla/js/src/config/autoconf.mk.in	2011-11-06 14:44:32.977635875 +0000
  451.35 +@@ -61,8 +61,8 @@
  451.36 + datadir		= @datadir@
  451.37 + mandir		= @mandir@
  451.38 +
  451.39 +-installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  451.40 +-sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
  451.41 ++installdir	= $(libdir)/$(MOZ_APP_NAME)
  451.42 ++sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel
  451.43 +
  451.44 + TOP_DIST	= @TOP_DIST@
  451.45 + ifneq (,$(filter /%,$(TOP_DIST)))
   452.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   452.2 +++ b/seamonkey/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   452.3 @@ -0,0 +1,3 @@
   452.4 +#-p1|google-breakpad.u
   452.5 +seamonkey-2.0-lang.patch
   452.6 +seamonkey-install-dir.patch
   453.1 --- a/seamonkey/stuff/seamonkey-2.0-lang.patch	Wed May 09 17:03:28 2018 +0300
   453.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   453.3 @@ -1,11 +0,0 @@
   453.4 ---- comm-1.9.1/mozilla/modules/libpref/src/init/all.js	2009-10-11 02:12:44.000000000 +0200
   453.5 -+++ comm-1.9.1/mozilla/modules/libpref/src/init/all.js	2009-09-16 02:56:45.000000000 +0200
   453.6 -@@ -890,7 +890,7 @@
   453.7 - pref("intl.charset.detector",               "chrome://global/locale/intl.properties");
   453.8 - pref("intl.charset.default",                "chrome://global-platform/locale/intl.properties");
   453.9 - pref("intl.ellipsis",                       "chrome://global-platform/locale/intl.properties");
  453.10 --pref("intl.locale.matchOS",                 false);
  453.11 -+pref("intl.locale.matchOS",                 true);
  453.12 - // fallback charset list for Unicode conversion (converting from Unicode)
  453.13 - // currently used for mail send only to handle symbol characters (e.g Euro, trademark, smartquotes)
  453.14 - // for ISO-8859-1
   454.1 --- a/seamonkey/stuff/seamonkey-install-dir.patch	Wed May 09 17:03:28 2018 +0300
   454.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   454.3 @@ -1,42 +0,0 @@
   454.4 -diff -Nur comm-beta.orig/config/autoconf.mk.in comm-beta/config/autoconf.mk.in
   454.5 ---- comm-beta.orig/config/autoconf.mk.in	2011-11-06 14:39:51.064983780 +0000
   454.6 -+++ comm-beta/config/autoconf.mk.in	2011-11-06 14:42:57.216735333 +0000
   454.7 -@@ -65,8 +65,8 @@
   454.8 - mandir		= @mandir@
   454.9 - idldir		= $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  454.10 -
  454.11 --installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  454.12 --sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
  454.13 -+installdir	= $(libdir)/$(MOZ_APP_NAME)
  454.14 -+sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel
  454.15 -
  454.16 - MOZDEPTH	= $(DEPTH)/mozilla
  454.17 - DIST		= $(MOZDEPTH)/dist
  454.18 -diff -Nur comm-beta.orig/mozilla/config/autoconf.mk.in comm-beta/mozilla/config/autoconf.mk.in
  454.19 ---- comm-beta.orig/mozilla/config/autoconf.mk.in	2011-11-06 14:39:41.771562967 +0000
  454.20 -+++ comm-beta/mozilla/config/autoconf.mk.in	2011-11-06 14:44:18.404165515 +0000
  454.21 -@@ -68,8 +68,8 @@
  454.22 - mandir		= @mandir@
  454.23 - idldir		= $(datadir)/idl/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  454.24 -
  454.25 --installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  454.26 --sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
  454.27 -+installdir	= $(libdir)/$(MOZ_APP_NAME)
  454.28 -+sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel
  454.29 -
  454.30 - DIST		= $(DEPTH)/dist
  454.31 - LIBXUL_SDK      = @LIBXUL_SDK@
  454.32 -diff -Nur comm-beta.orig/mozilla/js/src/config/autoconf.mk.in comm-beta/mozilla/js/src/config/autoconf.mk.in
  454.33 ---- comm-beta.orig/mozilla/js/src/config/autoconf.mk.in	2011-11-06 14:39:48.014955070 +0000
  454.34 -+++ comm-beta/mozilla/js/src/config/autoconf.mk.in	2011-11-06 14:44:32.977635875 +0000
  454.35 -@@ -61,8 +61,8 @@
  454.36 - datadir		= @datadir@
  454.37 - mandir		= @mandir@
  454.38 -
  454.39 --installdir	= $(libdir)/$(MOZ_APP_NAME)-$(MOZ_APP_VERSION)
  454.40 --sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel-$(MOZ_APP_VERSION)
  454.41 -+installdir	= $(libdir)/$(MOZ_APP_NAME)
  454.42 -+sdkdir		= $(libdir)/$(MOZ_APP_NAME)-devel
  454.43 -
  454.44 - TOP_DIST	= @TOP_DIST@
  454.45 - ifneq (,$(filter /%,$(TOP_DIST)))
   455.1 --- a/setserial/receipt	Wed May 09 17:03:28 2018 +0300
   455.2 +++ b/setserial/receipt	Thu May 10 21:12:00 2018 +0300
   455.3 @@ -15,10 +15,6 @@
   455.4  {
   455.5  	mkdir -p $DESTDIR/usr/bin
   455.6  	
   455.7 -	# http://bugs.gentoo.org/309883
   455.8 -	#  & remove warnings 
   455.9 -	patch -p1 < $stuff/setserial-2.17.u || return 1
  455.10 -	
  455.11  	./configure \
  455.12  		--prefix=/usr \
  455.13  		$CONFIGURE_ARGS &&
   456.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   456.2 +++ b/setserial/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   456.3 @@ -0,0 +1,3 @@
   456.4 +# http://bugs.gentoo.org/309883
   456.5 +#  & remove warnings
   456.6 +-p1|setserial-2.17.u
   457.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   457.2 +++ b/setserial/stuff/patches/setserial-2.17.u	Thu May 10 21:12:00 2018 +0300
   457.3 @@ -0,0 +1,24 @@
   457.4 +--- setserial-2.17-ori/setserial.c.orig	2000-01-27 16:40:52.000000000 +0100
   457.5 ++++ setserial-2.17/setserial.c	2010-03-25 21:48:21.554872081 +0100
   457.6 +@@ -24,6 +24,8 @@
   457.7 + #endif
   457.8 + #include <linux/serial.h>
   457.9 + 
  457.10 ++#undef TIOCGHAYESESP
  457.11 ++
  457.12 + #include "version.h"
  457.13 + 
  457.14 + static char version_str[] = "setserial version " SETSERIAL_VERSION ", "
  457.15 +
  457.16 +Common subdirectories: setserial-2.17-ori/Documentation and setserial-2.17/Documentation
  457.17 +Common subdirectories: setserial-2.17-ori/linux and setserial-2.17/linux
  457.18 +--- setserial-2.17-ori/setserial.c	Thu Jan 27 16:40:52 2000
  457.19 ++++ setserial-2.17/setserial.c	Thu Jul 22 09:51:23 2010
  457.20 +@@ -15,6 +15,7 @@
  457.21 + #include <termios.h>
  457.22 + #include <string.h>
  457.23 + #include <errno.h>
  457.24 ++#include <stdlib.h>
  457.25 + 
  457.26 + #ifdef HAVE_ASM_IOCTLS_H
  457.27 + #include <asm/ioctls.h>
   458.1 --- a/setserial/stuff/setserial-2.17.u	Wed May 09 17:03:28 2018 +0300
   458.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   458.3 @@ -1,24 +0,0 @@
   458.4 ---- setserial-2.17-ori/setserial.c.orig	2000-01-27 16:40:52.000000000 +0100
   458.5 -+++ setserial-2.17/setserial.c	2010-03-25 21:48:21.554872081 +0100
   458.6 -@@ -24,6 +24,8 @@
   458.7 - #endif
   458.8 - #include <linux/serial.h>
   458.9 - 
  458.10 -+#undef TIOCGHAYESESP
  458.11 -+
  458.12 - #include "version.h"
  458.13 - 
  458.14 - static char version_str[] = "setserial version " SETSERIAL_VERSION ", "
  458.15 -
  458.16 -Common subdirectories: setserial-2.17-ori/Documentation and setserial-2.17/Documentation
  458.17 -Common subdirectories: setserial-2.17-ori/linux and setserial-2.17/linux
  458.18 ---- setserial-2.17-ori/setserial.c	Thu Jan 27 16:40:52 2000
  458.19 -+++ setserial-2.17/setserial.c	Thu Jul 22 09:51:23 2010
  458.20 -@@ -15,6 +15,7 @@
  458.21 - #include <termios.h>
  458.22 - #include <string.h>
  458.23 - #include <errno.h>
  458.24 -+#include <stdlib.h>
  458.25 - 
  458.26 - #ifdef HAVE_ASM_IOCTLS_H
  458.27 - #include <asm/ioctls.h>
   459.1 --- a/sheerdns/receipt	Wed May 09 17:03:28 2018 +0300
   459.2 +++ b/sheerdns/receipt	Thu May 10 21:12:00 2018 +0300
   459.3 @@ -14,11 +14,6 @@
   459.4  compile_rules() {
   459.5  	mv $PACKAGE $src 2>/dev/null
   459.6  	cd $src
   459.7 -	for i in $( cd $stuff ; ls *.u); do
   459.8 -		[ -f done.$i ] && continue
   459.9 -		patch -p0 < $stuff/$i
  459.10 -		touch done.$i
  459.11 -	done
  459.12  	make || return 1
  459.13  
  459.14  	mkdir -p $install/usr/bin/ $install/var/sheerdns/
   460.1 --- a/sheerdns/stuff/large-subdomains.u	Wed May 09 17:03:28 2018 +0300
   460.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   460.3 @@ -1,34 +0,0 @@
   460.4 ---- dir.c
   460.5 -+++ dir.c
   460.6 -@@ -77,16 +77,17 @@
   460.7 -     while (!get_file_name (buf, sizeof (buf), qtype, (unsigned char *) q)
   460.8 - 	   && (fd = open (buf, O_RDONLY)) == -1 && (q = strchr (q, '.')) && q++ && (qtype == REQ_SOA
   460.9 - 										    || qtype == REQ_NS));
  460.10 --    if (fd == -1) {
  460.11 --/* try lookup "*.example.com" where asking for "nonexistant.example.com": */
  460.12 -+    for (i = 0; fd == -1; i++) {
  460.13 -+/* try lookup "*.example.com" where asking for "nonexistant.example.com" or "any.where.example.com": */
  460.14 - 	char *t;
  460.15 - 	if (qtype == REQ_SOA || qtype == REQ_NS)	/* probably a bad idea to wildcard these, so return */
  460.16 - 	    return NULL;
  460.17 - 	q = t = (char *) strdup (s);
  460.18 --	while (*t && *t != '.')
  460.19 -+	for (c = i; *t && *t != '.' || --c >= 0;)
  460.20 - 	    t++;
  460.21 --	if (!*t || t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
  460.22 --	    || (fd = open (buf, O_RDONLY)) == -1) {
  460.23 -+	t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
  460.24 -+	    || (fd = open (buf, O_RDONLY));
  460.25 -+	if (fd == -1 && !*++t ) {
  460.26 - 	    free (q);
  460.27 - 	    return NULL; }
  460.28 - 	free (q); }
  460.29 -
  460.30 ---- dir.h
  460.31 -+++ dir.h
  460.32 -@@ -11,4 +11,4 @@
  460.33 - char **directory_lookup (int qtype, unsigned char *s);
  460.34 - time_t get_mtime (int qtype, unsigned char *s);
  460.35 - 
  460.36 --#define SHEERDNS_DIR	"/var/sheerdns"
  460.37 -+#define SHEERDNS_DIR	"/var/sheerdns"
   461.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   461.2 +++ b/sheerdns/stuff/patches/large-subdomains.u	Thu May 10 21:12:00 2018 +0300
   461.3 @@ -0,0 +1,34 @@
   461.4 +--- dir.c
   461.5 ++++ dir.c
   461.6 +@@ -77,16 +77,17 @@
   461.7 +     while (!get_file_name (buf, sizeof (buf), qtype, (unsigned char *) q)
   461.8 + 	   && (fd = open (buf, O_RDONLY)) == -1 && (q = strchr (q, '.')) && q++ && (qtype == REQ_SOA
   461.9 + 										    || qtype == REQ_NS));
  461.10 +-    if (fd == -1) {
  461.11 +-/* try lookup "*.example.com" where asking for "nonexistant.example.com": */
  461.12 ++    for (i = 0; fd == -1; i++) {
  461.13 ++/* try lookup "*.example.com" where asking for "nonexistant.example.com" or "any.where.example.com": */
  461.14 + 	char *t;
  461.15 + 	if (qtype == REQ_SOA || qtype == REQ_NS)	/* probably a bad idea to wildcard these, so return */
  461.16 + 	    return NULL;
  461.17 + 	q = t = (char *) strdup (s);
  461.18 +-	while (*t && *t != '.')
  461.19 ++	for (c = i; *t && *t != '.' || --c >= 0;)
  461.20 + 	    t++;
  461.21 +-	if (!*t || t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
  461.22 +-	    || (fd = open (buf, O_RDONLY)) == -1) {
  461.23 ++	t == q || !(*--t = '*') || get_file_name (buf, sizeof (buf), qtype, (unsigned char *) t)
  461.24 ++	    || (fd = open (buf, O_RDONLY));
  461.25 ++	if (fd == -1 && !*++t ) {
  461.26 + 	    free (q);
  461.27 + 	    return NULL; }
  461.28 + 	free (q); }
  461.29 +
  461.30 +--- dir.h
  461.31 ++++ dir.h
  461.32 +@@ -11,4 +11,4 @@
  461.33 + char **directory_lookup (int qtype, unsigned char *s);
  461.34 + time_t get_mtime (int qtype, unsigned char *s);
  461.35 + 
  461.36 +-#define SHEERDNS_DIR	"/var/sheerdns"
  461.37 ++#define SHEERDNS_DIR	"/var/sheerdns"
   462.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   462.2 +++ b/sheerdns/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   462.3 @@ -0,0 +1,1 @@
   462.4 +-p0|large-subdomains.u
   463.1 --- a/soundtouch/receipt	Wed May 09 17:03:28 2018 +0300
   463.2 +++ b/soundtouch/receipt	Thu May 10 21:12:00 2018 +0300
   463.3 @@ -17,7 +17,6 @@
   463.4  compile_rules() {
   463.5  	./bootstrap
   463.6  	sed -i 's|/doc/|/share&|' Makefile*
   463.7 -	patch -Np1 -i $stuff/$PACKAGE-1.4.0-mmx-sse-compile-fix.patch
   463.8  
   463.9  	./configure \
  463.10  		--enable-shared \
   464.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   464.2 +++ b/soundtouch/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   464.3 @@ -0,0 +1,1 @@
   464.4 +soundtouch-1.4.0-mmx-sse-compile-fix.patch
   465.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   465.2 +++ b/soundtouch/stuff/patches/soundtouch-1.4.0-mmx-sse-compile-fix.patch	Thu May 10 21:12:00 2018 +0300
   465.3 @@ -0,0 +1,14 @@
   465.4 +diff -up soundtouch/source/SoundTouch/Makefile.in~ soundtouch/source/SoundTouch/Makefile.in
   465.5 +--- soundtouch/source/SoundTouch/Makefile.in~	2009-02-15 11:21:36.000000000 +0100
   465.6 ++++ soundtouch/source/SoundTouch/Makefile.in	2009-02-15 11:23:30.000000000 +0100
   465.7 +@@ -209,7 +209,9 @@ libSoundTouch_la_SOURCES = AAFilter.cpp 
   465.8 + # Note by authore: '-msse2' might not work in non-X86 compilations. If someone can
   465.9 + # fix this script to automatically check for CPU architecture, please submit a patch 
  465.10 + # to me.
  465.11 +-AM_CXXFLAGS = -O3 -msse2 -fcheck-new -I../../include
  465.12 ++AM_CXXFLAGS = -fcheck-new -I../../include
  465.13 ++mmx_optimized.lo : AM_CXXFLAGS = -mmmx -fcheck-new -I../../include
  465.14 ++sse_optimized.lo : AM_CXXFLAGS = -msse -fcheck-new -I../../include
  465.15 + all: all-am
  465.16 + 
  465.17 + .SUFFIXES:
   466.1 --- a/soundtouch/stuff/soundtouch-1.4.0-mmx-sse-compile-fix.patch	Wed May 09 17:03:28 2018 +0300
   466.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   466.3 @@ -1,14 +0,0 @@
   466.4 -diff -up soundtouch/source/SoundTouch/Makefile.in~ soundtouch/source/SoundTouch/Makefile.in
   466.5 ---- soundtouch/source/SoundTouch/Makefile.in~	2009-02-15 11:21:36.000000000 +0100
   466.6 -+++ soundtouch/source/SoundTouch/Makefile.in	2009-02-15 11:23:30.000000000 +0100
   466.7 -@@ -209,7 +209,9 @@ libSoundTouch_la_SOURCES = AAFilter.cpp 
   466.8 - # Note by authore: '-msse2' might not work in non-X86 compilations. If someone can
   466.9 - # fix this script to automatically check for CPU architecture, please submit a patch 
  466.10 - # to me.
  466.11 --AM_CXXFLAGS = -O3 -msse2 -fcheck-new -I../../include
  466.12 -+AM_CXXFLAGS = -fcheck-new -I../../include
  466.13 -+mmx_optimized.lo : AM_CXXFLAGS = -mmmx -fcheck-new -I../../include
  466.14 -+sse_optimized.lo : AM_CXXFLAGS = -msse -fcheck-new -I../../include
  466.15 - all: all-am
  466.16 - 
  466.17 - .SUFFIXES:
   467.1 --- a/spidermonkey/receipt	Wed May 09 17:03:28 2018 +0300
   467.2 +++ b/spidermonkey/receipt	Thu May 10 21:12:00 2018 +0300
   467.3 @@ -21,10 +21,7 @@
   467.4  
   467.5  	# Fix from Archlinux
   467.6  	# http://projects.archlinux.org/svntogit/community.git/tree/spidermonkey/trunk/PKGBUILD
   467.7 -	#patch -p0 < $stuff/spidermonkey-Makefile.patch || return 1
   467.8  	sed -i 's|include|include/js|' rules.mk || return 1
   467.9 -	# patch Makefile for threadsafe support with native nspr
  467.10 -	patch -p2 -i $stuff/spidermonkey-1.7-threadsafe.patch || return 1
  467.11  	# FS#16673
  467.12  	export CFLAGS="${CFLAGS} -DJS_C_STRINGS_ARE_UTF8"
  467.13  	# build - threadsafe
   468.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   468.2 +++ b/spidermonkey/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   468.3 @@ -0,0 +1,6 @@
   468.4 +# Fix from Archlinux
   468.5 +# http://projects.archlinux.org/svntogit/community.git/tree/spidermonkey/trunk/PKGBUILD
   468.6 +#-p0|spidermonkey-Makefile.patch
   468.7 +
   468.8 +# patch Makefile for threadsafe support with native nspr
   468.9 +-p2|spidermonkey-1.7-threadsafe.patch
   469.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   469.2 +++ b/spidermonkey/stuff/patches/spidermonkey-1.7-threadsafe.patch	Thu May 10 21:12:00 2018 +0300
   469.3 @@ -0,0 +1,16 @@
   469.4 +--- js/src/Makefile.ref.orig	2008-05-28 19:51:32.000000000 -0400
   469.5 ++++ js/src/Makefile.ref	2008-05-28 19:52:17.000000000 -0400
   469.6 +@@ -63,11 +63,11 @@
   469.7 + 
   469.8 + ifdef JS_THREADSAFE
   469.9 + DEFINES += -DJS_THREADSAFE
  469.10 +-INCLUDES += -I$(DIST)/include/nspr
  469.11 ++INCLUDES += -I/usr/include/nspr
  469.12 + ifdef USE_MSVC
  469.13 + OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
  469.14 + else
  469.15 +-OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
  469.16 ++OTHER_LIBS += -L/usr/$(LIBDIR)/nspr -lnspr${NSPR_LIBSUFFIX}
  469.17 + endif
  469.18 + endif
  469.19 + 
   470.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   470.2 +++ b/spidermonkey/stuff/patches/spidermonkey-Makefile.patch	Thu May 10 21:12:00 2018 +0300
   470.3 @@ -0,0 +1,22 @@
   470.4 +*** Makefile.ref.orig	2009-02-16 09:56:29.000000000 -0600
   470.5 +--- Makefile.ref	2009-02-16 09:58:59.000000000 -0600
   470.6 +***************
   470.7 +*** 169,184 ****
   470.8 +--- 169,185 ----
   470.9 +  	jstypes.h	\
  470.10 +  	jsprvtd.h	\
  470.11 +  	jspubtd.h	\
  470.12 +  	jsregexp.h	\
  470.13 +  	jsscan.h	\
  470.14 +  	jsscope.h	\
  470.15 +  	jsscript.h	\
  470.16 +  	jsstr.h		\
  470.17 ++ 	jsutil.h        \
  470.18 +  	jsxdrapi.h	\
  470.19 +  	jsxml.h		\
  470.20 +  	$(NULL)
  470.21 +  
  470.22 +  API_HFILES =		\
  470.23 +  	jsapi.h		\
  470.24 +  	jsdbgapi.h	\
  470.25 +  	$(NULL)
   471.1 --- a/spidermonkey/stuff/spidermonkey-1.7-threadsafe.patch	Wed May 09 17:03:28 2018 +0300
   471.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   471.3 @@ -1,16 +0,0 @@
   471.4 ---- js/src/Makefile.ref.orig	2008-05-28 19:51:32.000000000 -0400
   471.5 -+++ js/src/Makefile.ref	2008-05-28 19:52:17.000000000 -0400
   471.6 -@@ -63,11 +63,11 @@
   471.7 - 
   471.8 - ifdef JS_THREADSAFE
   471.9 - DEFINES += -DJS_THREADSAFE
  471.10 --INCLUDES += -I$(DIST)/include/nspr
  471.11 -+INCLUDES += -I/usr/include/nspr
  471.12 - ifdef USE_MSVC
  471.13 - OTHER_LIBS += $(DIST)/lib/libnspr$(NSPR_LIBSUFFIX).lib
  471.14 - else
  471.15 --OTHER_LIBS += -L$(DIST)/lib -lnspr$(NSPR_LIBSUFFIX)
  471.16 -+OTHER_LIBS += -L/usr/$(LIBDIR)/nspr -lnspr${NSPR_LIBSUFFIX}
  471.17 - endif
  471.18 - endif
  471.19 - 
   472.1 --- a/spidermonkey/stuff/spidermonkey-Makefile.patch	Wed May 09 17:03:28 2018 +0300
   472.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   472.3 @@ -1,22 +0,0 @@
   472.4 -*** Makefile.ref.orig	2009-02-16 09:56:29.000000000 -0600
   472.5 ---- Makefile.ref	2009-02-16 09:58:59.000000000 -0600
   472.6 -***************
   472.7 -*** 169,184 ****
   472.8 ---- 169,185 ----
   472.9 -  	jstypes.h	\
  472.10 -  	jsprvtd.h	\
  472.11 -  	jspubtd.h	\
  472.12 -  	jsregexp.h	\
  472.13 -  	jsscan.h	\
  472.14 -  	jsscope.h	\
  472.15 -  	jsscript.h	\
  472.16 -  	jsstr.h		\
  472.17 -+ 	jsutil.h        \
  472.18 -  	jsxdrapi.h	\
  472.19 -  	jsxml.h		\
  472.20 -  	$(NULL)
  472.21 -  
  472.22 -  API_HFILES =		\
  472.23 -  	jsapi.h		\
  472.24 -  	jsdbgapi.h	\
  472.25 -  	$(NULL)
   473.1 --- a/stardict/receipt	Wed May 09 17:03:28 2018 +0300
   473.2 +++ b/stardict/receipt	Thu May 10 21:12:00 2018 +0300
   473.3 @@ -16,8 +16,6 @@
   473.4  
   473.5  compile_rules() {
   473.6  	sed -i 's/<vector>/&\n#include <stdio.h>/' stardict-plugins/stardict-wordnet-plugin/scene.hpp
   473.7 -	patch -p1 < $stuff/sigc++.patch || return 1
   473.8 -	patch -p1 < $stuff/stardict_gcc43.patch || return 1
   473.9  
  473.10  	./configure \
  473.11  		--disable-man \
   474.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   474.2 +++ b/stardict/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   474.3 @@ -0,0 +1,2 @@
   474.4 +-p1|sigc++.patch
   474.5 +-p1|stardict_gcc43.patch
   475.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   475.2 +++ b/stardict/stuff/patches/sigc++.patch	Thu May 10 21:12:00 2018 +0300
   475.3 @@ -0,0 +1,177 @@
   475.4 +diff -Naur stardict-3.0.1.orig/src/gconf_file.cpp stardict-3.0.1/src/gconf_file.cpp
   475.5 +--- stardict-3.0.1.orig/src/gconf_file.cpp	2007-07-10 08:16:04.000000000 +0100
   475.6 ++++ stardict-3.0.1/src/gconf_file.cpp	2008-04-11 18:18:43.000000000 +0100
   475.7 +@@ -22,6 +22,8 @@
   475.8 + #  include "config.h"
   475.9 + #endif
  475.10 + 
  475.11 ++#include <memory>
  475.12 ++
  475.13 + #include <glib/gi18n.h>
  475.14 + 
  475.15 + #include "gconf_file.hpp"
  475.16 +diff -Naur stardict-3.0.1.orig/src/inifile.cpp stardict-3.0.1/src/inifile.cpp
  475.17 +--- stardict-3.0.1.orig/src/inifile.cpp	2007-08-01 10:43:00.000000000 +0100
  475.18 ++++ stardict-3.0.1/src/inifile.cpp	2008-04-11 18:18:43.000000000 +0100
  475.19 +@@ -25,6 +25,7 @@
  475.20 + #include <vector>
  475.21 + #include <cerrno>
  475.22 + #include <cstring>
  475.23 ++#include <cstdlib>
  475.24 + #include <cstdio>
  475.25 + #include <glib/gi18n.h>
  475.26 + #include <glib/gstdio.h>
  475.27 +diff -Naur stardict-3.0.1.orig/src/pangoview.cpp stardict-3.0.1/src/pangoview.cpp
  475.28 +--- stardict-3.0.1.orig/src/pangoview.cpp	2007-09-25 08:11:48.000000000 +0100
  475.29 ++++ stardict-3.0.1/src/pangoview.cpp	2008-04-11 18:18:43.000000000 +0100
  475.30 +@@ -22,6 +22,8 @@
  475.31 + #  include "config.h"
  475.32 + #endif
  475.33 + 
  475.34 ++#include <cstring>
  475.35 ++
  475.36 + #include "gtktextviewpango.h"
  475.37 + #include "utils.h"
  475.38 + #include "skin.h"//for SkinCursor definition
  475.39 +diff -Naur stardict-3.0.1.orig/src/prefsdlg.cpp stardict-3.0.1/src/prefsdlg.cpp
  475.40 +--- stardict-3.0.1.orig/src/prefsdlg.cpp	2007-10-30 08:14:07.000000000 +0000
  475.41 ++++ stardict-3.0.1/src/prefsdlg.cpp	2008-04-11 18:18:43.000000000 +0100
  475.42 +@@ -21,6 +21,8 @@
  475.43 + #  include "config.h"
  475.44 + #endif
  475.45 + 
  475.46 ++#include <cstdlib>
  475.47 ++
  475.48 + #include <glib/gi18n.h>
  475.49 + #include <glib/gstdio.h>
  475.50 + 
  475.51 +diff -Naur stardict-3.0.1.orig/src/readword.cpp stardict-3.0.1/src/readword.cpp
  475.52 +--- stardict-3.0.1.orig/src/readword.cpp	2007-07-10 08:16:04.000000000 +0100
  475.53 ++++ stardict-3.0.1/src/readword.cpp	2008-04-11 17:53:43.000000000 +0100
  475.54 +@@ -3,6 +3,7 @@
  475.55 + #endif
  475.56 + 
  475.57 + #include <cstring>
  475.58 ++#include <cstdlib>
  475.59 + #include <string>
  475.60 + 
  475.61 + #include <glib/gi18n.h>
  475.62 +diff -Naur stardict-3.0.1.orig/src/sigc++/signal.h stardict-3.0.1/src/sigc++/signal.h
  475.63 +--- stardict-3.0.1.orig/src/sigc++/signal.h	2007-07-10 08:16:01.000000000 +0100
  475.64 ++++ stardict-3.0.1/src/sigc++/signal.h	2008-04-11 17:50:11.000000000 +0100
  475.65 +@@ -18,7 +18,7 @@
  475.66 +   //Compilers, such as older versions of SUN Forte C++, that do not allow this also often
  475.67 +   //do not allow a typedef to have the same name as a class in the typedef's definition.
  475.68 +   //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build.
  475.69 +-  #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1
  475.70 ++//  #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1
  475.71 + #endif
  475.72 + 
  475.73 + namespace sigc {
  475.74 +diff -Naur stardict-3.0.1.orig/src/utils.cpp stardict-3.0.1/src/utils.cpp
  475.75 +--- stardict-3.0.1.orig/src/utils.cpp	2007-10-22 03:25:02.000000000 +0100
  475.76 ++++ stardict-3.0.1/src/utils.cpp	2008-04-11 18:18:43.000000000 +0100
  475.77 +@@ -22,6 +22,8 @@
  475.78 + #  include "config.h"
  475.79 + #endif
  475.80 + 
  475.81 ++#include <cstring>
  475.82 ++
  475.83 + #include <glib.h>
  475.84 + #include <glib/gi18n.h>
  475.85 + #include <cstdlib>
  475.86 +diff -Naur stardict-3.0.1.orig/src/x11_iskeyspressed.hpp stardict-3.0.1/src/x11_iskeyspressed.hpp
  475.87 +--- stardict-3.0.1.orig/src/x11_iskeyspressed.hpp	2007-07-10 08:16:04.000000000 +0100
  475.88 ++++ stardict-3.0.1/src/x11_iskeyspressed.hpp	2008-04-11 17:57:08.000000000 +0100
  475.89 +@@ -1,6 +1,8 @@
  475.90 + #ifndef _X11_ISKEYSPRESSED_HPP_
  475.91 + #define _X11_ISKEYSPRESSED_HPP_
  475.92 + 
  475.93 ++#include <memory>
  475.94 ++
  475.95 + #include <gdk/gdkx.h>
  475.96 + #include <X11/keysym.h>
  475.97 + #include <gtk/gtk.h>
  475.98 +
  475.99 + #ifdef _WIN32
 475.100 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp
 475.101 +--- stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp	2007-09-19 09:27:18.000000000 +0100
 475.102 ++++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp	2008-04-11 18:02:55.000000000 +0100
 475.103 +@@ -1,4 +1,5 @@
 475.104 + #include "stardict_espeak.h"
 475.105 ++#include <cstring>
 475.106 + #include <espeak/speak_lib.h>
 475.107 + #include <glib/gi18n.h>
 475.108 + 
 475.109 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp
 475.110 +--- stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp	2007-09-13 08:51:55.000000000 +0100
 475.111 ++++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp	2008-04-11 17:59:50.000000000 +0100
 475.112 +@@ -1,4 +1,6 @@
 475.113 + #include "stardict_html_parsedata.h"
 475.114 ++#include <cstring>
 475.115 ++#include <cstdlib>
 475.116 + #include <glib/gi18n.h>
 475.117 + 
 475.118 + #ifdef _WIN32
 475.119 +
 475.120 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp
 475.121 +--- stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp	2007-09-19 09:29:21.000000000 +0100
 475.122 ++++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp	2008-04-11 18:02:38.000000000 +0100
 475.123 +@@ -1,4 +1,5 @@
 475.124 + #include "stardict_spell.h"
 475.125 ++#include <cstring>
 475.126 + #include <glib.h>
 475.127 + #include <glib/gi18n.h>
 475.128 + #include <enchant.h>
 475.129 +
 475.130 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp
 475.131 +--- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp	2007-10-18 02:36:22.000000000 +0100
 475.132 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp	2008-04-11 18:01:10.000000000 +0100
 475.133 +@@ -1,4 +1,5 @@
 475.134 + #include "court_widget.h"
 475.135 ++#include <cstring>
 475.136 + #include <math.h>
 475.137 + #include <list>
 475.138 + 
 475.139 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp
 475.140 +--- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp	2007-10-15 04:32:04.000000000 +0100
 475.141 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp	2008-04-11 18:00:35.000000000 +0100
 475.142 +@@ -1,5 +1,6 @@
 475.143 + #include "stardict_wordnet.h"
 475.144 + #include "court_widget.h"
 475.145 ++#include <cstring>
 475.146 + #include <glib/gi18n.h>
 475.147 + 
 475.148 + #ifdef _WIN32
 475.149 +
 475.150 +diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp
 475.151 +--- stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp	2007-08-31 07:41:54.000000000 +0100
 475.152 ++++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp	2008-04-11 18:00:12.000000000 +0100
 475.153 +@@ -1,4 +1,5 @@
 475.154 + #include "stardict_xdxf_parsedata.h"
 475.155 ++#include <cstring>
 475.156 + #include <glib/gi18n.h>
 475.157 + 
 475.158 + #ifdef _WIN32
 475.159 +diff -Naur stardict-3.0.1.orig/tests/t_config_file.cpp stardict-3.0.1/tests/t_config_file.cpp
 475.160 +--- stardict-3.0.1.orig/tests/t_config_file.cpp	2007-07-10 08:16:04.000000000 +0100
 475.161 ++++ stardict-3.0.1/tests/t_config_file.cpp	2008-04-11 18:04:13.000000000 +0100
 475.162 +@@ -8,6 +8,7 @@
 475.163 + #include <cstring>
 475.164 + #include <iterator>
 475.165 + #include <iostream>
 475.166 ++#include <memory>
 475.167 + #include <gtk/gtk.h>
 475.168 + 
 475.169 + #include "config_file.hpp"
 475.170 +diff -Naur stardict-3.0.1.orig/tests/t_xml.cpp stardict-3.0.1/tests/t_xml.cpp
 475.171 +--- stardict-3.0.1.orig/tests/t_xml.cpp	2007-07-10 08:16:04.000000000 +0100
 475.172 ++++ stardict-3.0.1/tests/t_xml.cpp	2008-04-11 18:04:58.000000000 +0100
 475.173 +@@ -5,6 +5,7 @@
 475.174 + #include <glib.h>
 475.175 + #include <cstdlib>
 475.176 + #include <string>
 475.177 ++#include <cstring>
 475.178 + 
 475.179 + 
 475.180 + static void xml_decode(const char *str, std::string& decoded)
   476.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   476.2 +++ b/stardict/stuff/patches/stardict_gcc43.patch	Thu May 10 21:12:00 2018 +0300
   476.3 @@ -0,0 +1,357 @@
   476.4 +--- stardict-3.0.1/src/Makefile.am.gcc43	2007-07-10 16:16:04.000000000 +0900
   476.5 ++++ stardict-3.0.1/src/Makefile.am	2008-02-26 19:35:12.000000000 +0900
   476.6 +@@ -14,6 +14,8 @@
   476.7 + 
   476.8 + bin_PROGRAMS = stardict
   476.9 + 
  476.10 ++DEFAULT_INCLUDES = -I$(top_builddir)
  476.11 ++
  476.12 + INCLUDES =							                            \
  476.13 + 	$(STARDICT_CFLAGS)						                    \
  476.14 + 	$(LOCAL_SIGCPP_INCLUDE)	\
  476.15 +
  476.16 +--- stardict-3.0.1/src/config_file.hpp.gcc43	2007-07-10 16:16:04.000000000 +0900
  476.17 ++++ stardict-3.0.1/src/config_file.hpp	2008-02-26 19:35:00.000000000 +0900
  476.18 +@@ -5,7 +5,7 @@
  476.19 + #include <list>
  476.20 + #include <string>
  476.21 + 
  476.22 +-#include "sigc++/sigc++.h"
  476.23 ++#include <sigc++/sigc++.h>
  476.24 + 
  476.25 + class config_file;
  476.26 + 
  476.27 +--- stardict-3.0.1/src/gconf_file.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
  476.28 ++++ stardict-3.0.1/src/gconf_file.cpp	2008-02-26 19:37:18.000000000 +0900
  476.29 +@@ -22,6 +22,7 @@
  476.30 + #  include "config.h"
  476.31 + #endif
  476.32 + 
  476.33 ++#include <memory>
  476.34 + #include <glib/gi18n.h>
  476.35 + 
  476.36 + #include "gconf_file.hpp"
  476.37 +
  476.38 +--- stardict-3.0.1/src/gtk_iskeyspressed.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
  476.39 ++++ stardict-3.0.1/src/gtk_iskeyspressed.cpp	2008-02-26 19:37:35.000000000 +0900
  476.40 +@@ -97,7 +97,7 @@
  476.41 +     GDK_BUTTON5_MASK  = 1 << 12,
  476.42 +   */
  476.43 + 
  476.44 +-  mask = GdkModifierType(guint(mask) & (1<<13)-1);
  476.45 ++  mask = GdkModifierType(guint(mask) & ((1<<13)-1));
  476.46 + 
  476.47 +   mask = 
  476.48 +     GdkModifierType(guint(mask) & ~(GDK_LOCK_MASK | GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
  476.49 +
  476.50 +--- stardict-3.0.1/src/inifile.cpp.gcc43	2007-08-01 18:43:00.000000000 +0900
  476.51 ++++ stardict-3.0.1/src/inifile.cpp	2008-02-26 19:37:51.000000000 +0900
  476.52 +@@ -28,6 +28,7 @@
  476.53 + #include <cstdio>
  476.54 + #include <glib/gi18n.h>
  476.55 + #include <glib/gstdio.h>
  476.56 ++#include <stdlib.h>
  476.57 + 
  476.58 + #include "utils.h"
  476.59 + 
  476.60 +--- stardict-3.0.1/src/lib/common.cpp.gcc43	2007-09-25 11:27:24.000000000 +0900
  476.61 ++++ stardict-3.0.1/src/lib/common.cpp	2008-02-26 19:34:01.000000000 +0900
  476.62 +@@ -24,6 +24,8 @@
  476.63 + #  include "config.h"
  476.64 + #endif
  476.65 + 
  476.66 ++#include <cstring>
  476.67 ++#include <stdlib.h>
  476.68 + #include "common.hpp"
  476.69 + 
  476.70 + static void parse_description(const char *p, long len, std::string &description)
  476.71 +
  476.72 +--- stardict-3.0.1/src/lib/data.cpp.gcc43	2007-09-21 10:09:52.000000000 +0900
  476.73 ++++ stardict-3.0.1/src/lib/data.cpp	2008-02-26 19:33:38.000000000 +0900
  476.74 +@@ -26,6 +26,8 @@
  476.75 + 
  476.76 + #include "data.hpp"
  476.77 + #include "getuint32.h"
  476.78 ++#include <cstring>
  476.79 ++#include <cstdio>
  476.80 + 
  476.81 + 
  476.82 + DictBase::DictBase()
  476.83 +
  476.84 +--- stardict-3.0.1/src/lib/http_client.cpp.gcc43	2007-09-06 17:29:30.000000000 +0900
  476.85 ++++ stardict-3.0.1/src/lib/http_client.cpp	2008-02-26 19:34:27.000000000 +0900
  476.86 +@@ -4,6 +4,7 @@
  476.87 + 
  476.88 + #include "http_client.h"
  476.89 + #include "sockets.hpp"
  476.90 ++#include <cstring>
  476.91 + 
  476.92 + sigc::signal<void, HttpClient *, const char *> HttpClient::on_error_;
  476.93 + sigc::signal<void, HttpClient *> HttpClient::on_response_;
  476.94 +
  476.95 +--- stardict-3.0.1/src/lib/pluginmanager.cpp.gcc43	2007-10-10 12:26:45.000000000 +0900
  476.96 ++++ stardict-3.0.1/src/lib/pluginmanager.cpp	2008-02-26 19:34:36.000000000 +0900
  476.97 +@@ -1,6 +1,7 @@
  476.98 + #include "pluginmanager.h"
  476.99 + #include "file.hpp"
 476.100 + #include <string>
 476.101 ++#include <cstring>
 476.102 + 
 476.103 + StarDictPluginBaseObject::StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_):
 476.104 + 	plugin_filename(filename), module(module_), configure_func(configure_func_)
 476.105 +
 476.106 +--- stardict-3.0.1/src/lib/stardict_client.cpp.gcc43	2007-10-31 17:32:11.000000000 +0900
 476.107 ++++ stardict-3.0.1/src/lib/stardict_client.cpp	2008-02-26 19:34:16.000000000 +0900
 476.108 +@@ -25,6 +25,9 @@
 476.109 + #include <glib.h>
 476.110 + #include <glib/gi18n.h>
 476.111 + 
 476.112 ++#include <cstring>
 476.113 ++#include <stdlib.h>
 476.114 ++#include <cstdio>
 476.115 + #include "sockets.hpp"
 476.116 + #include "md5.h"
 476.117 + #include "getuint32.h"
 476.118 +
 476.119 +--- stardict-3.0.1/src/lib/stddict.cpp.gcc43	2007-10-30 18:06:07.000000000 +0900
 476.120 ++++ stardict-3.0.1/src/lib/stddict.cpp	2008-02-26 19:33:46.000000000 +0900
 476.121 +@@ -28,6 +28,7 @@
 476.122 + #  include "config.h"
 476.123 + #endif
 476.124 + 
 476.125 ++#include <cstring>
 476.126 + #include <glib/gi18n.h>
 476.127 + #include <glib/gstdio.h>
 476.128 + 
 476.129 +--- stardict-3.0.1/src/lib/treedict.cpp.gcc43	2007-09-21 10:09:52.000000000 +0900
 476.130 ++++ stardict-3.0.1/src/lib/treedict.cpp	2008-02-26 19:33:52.000000000 +0900
 476.131 +@@ -25,6 +25,7 @@
 476.132 + #  include "config.h"
 476.133 + #endif
 476.134 + 
 476.135 ++#include <cstring>
 476.136 + #include "file.hpp"
 476.137 + #include "getuint32.h"
 476.138 + 
 476.139 +--- stardict-3.0.1/src/pangoview.cpp.gcc43	2007-09-25 16:11:48.000000000 +0900
 476.140 ++++ stardict-3.0.1/src/pangoview.cpp	2008-02-26 19:37:02.000000000 +0900
 476.141 +@@ -22,6 +22,7 @@
 476.142 + #  include "config.h"
 476.143 + #endif
 476.144 + 
 476.145 ++#include <cstring>
 476.146 + #include "gtktextviewpango.h"
 476.147 + #include "utils.h"
 476.148 + #include "skin.h"//for SkinCursor definition
 476.149 +
 476.150 +--- stardict-3.0.1/src/utils.cpp.gcc43	2007-10-22 11:25:02.000000000 +0900
 476.151 ++++ stardict-3.0.1/src/utils.cpp	2008-02-26 19:36:01.000000000 +0900
 476.152 +@@ -22,6 +22,7 @@
 476.153 + #  include "config.h"
 476.154 + #endif
 476.155 + 
 476.156 ++#include <cstring>
 476.157 + #include <glib.h>
 476.158 + #include <glib/gi18n.h>
 476.159 + #include <cstdlib>
 476.160 +
 476.161 +--- stardict-3.0.1/src/x11_iskeyspressed.hpp.gcc43	2007-07-10 16:16:04.000000000 +0900
 476.162 ++++ stardict-3.0.1/src/x11_iskeyspressed.hpp	2008-02-27 16:16:17.000000000 +0900
 476.163 +@@ -5,6 +5,8 @@
 476.164 + #include <X11/keysym.h>
 476.165 + #include <gtk/gtk.h>
 476.166 + 
 476.167 ++#include <memory>
 476.168 ++
 476.169 + #include "iskeyspressed.hpp"
 476.170 + 
 476.171 + typedef enum { SYM, CODE, BUTTON } KeyType_t;
 476.172 +
 476.173 +--- stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp.gcc43	2007-09-21 10:09:53.000000000 +0900
 476.174 ++++ stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp	2008-02-26 19:39:34.000000000 +0900
 476.175 +@@ -2,6 +2,7 @@
 476.176 + #include <glib.h>
 476.177 + #include <glib/gi18n.h>
 476.178 + #include <glib/gstdio.h>
 476.179 ++#include <cstring>
 476.180 + #include <string>
 476.181 + #include <map>
 476.182 + #include <list>
 476.183 +
 476.184 +--- stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp.gcc43	2007-10-10 18:28:29.000000000 +0900
 476.185 ++++ stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp	2008-02-26 19:38:56.000000000 +0900
 476.186 +@@ -1,5 +1,6 @@
 476.187 + #include "stardict_dictdotcn.h"
 476.188 + #include <glib/gi18n.h>
 476.189 ++#include <cstring>
 476.190 + #include <string>
 476.191 + #include <list>
 476.192 + 
 476.193 +--- stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp.gcc43	2007-09-19 17:27:18.000000000 +0900
 476.194 ++++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp	2008-02-26 19:45:43.000000000 +0900
 476.195 +@@ -1,6 +1,7 @@
 476.196 + #include "stardict_espeak.h"
 476.197 + #include <espeak/speak_lib.h>
 476.198 + #include <glib/gi18n.h>
 476.199 ++#include <cstring>
 476.200 + 
 476.201 + static const StarDictPluginSystemInfo *plugin_info = NULL;
 476.202 + static std::string voice_engine;
 476.203 +
 476.204 +--- stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp.gcc43	2007-08-31 16:10:41.000000000 +0900
 476.205 ++++ stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp	2008-02-26 19:45:27.000000000 +0900
 476.206 +@@ -1,6 +1,8 @@
 476.207 + #include "stardict_gucharmap.h"
 476.208 + #include <glib/gi18n.h>
 476.209 + #include <gucharmap/gucharmap.h>
 476.210 ++#include <stdlib.h>
 476.211 ++#include <cstring>
 476.212 + #include <string>
 476.213 + 
 476.214 + static char *build_dictdata(char type, const char *definition)
 476.215 +
 476.216 +--- stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp.gcc43	2007-09-13 16:51:55.000000000 +0900
 476.217 ++++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp	2008-02-26 19:41:11.000000000 +0900
 476.218 +@@ -1,5 +1,7 @@
 476.219 + #include "stardict_html_parsedata.h"
 476.220 + #include <glib/gi18n.h>
 476.221 ++#include <cstring>
 476.222 ++#include <stdlib.h>
 476.223 + 
 476.224 + #ifdef _WIN32
 476.225 + #include <windows.h>
 476.226 +
 476.227 +--- stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp.gcc43	2007-09-19 17:30:54.000000000 +0900
 476.228 ++++ stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp	2008-02-26 19:40:22.000000000 +0900
 476.229 +@@ -1,5 +1,6 @@
 476.230 + #include "stardict_man.h"
 476.231 + #include <glib/gi18n.h>
 476.232 ++#include <cstring>
 476.233 + #include <string>
 476.234 + 
 476.235 + static const StarDictPluginSystemInfo *plugin_info = NULL;
 476.236 +
 476.237 +--- stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp.gcc43	2007-10-25 17:16:37.000000000 +0900
 476.238 ++++ stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp	2008-02-26 19:44:06.000000000 +0900
 476.239 +@@ -1,4 +1,5 @@
 476.240 + #include "stardict_powerword_parsedata.h"
 476.241 ++#include <cstring>
 476.242 + #include <glib/gi18n.h>
 476.243 + 
 476.244 + #ifdef _WIN32
 476.245 +
 476.246 +--- stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp.gcc43	2007-11-02 17:41:26.000000000 +0900
 476.247 ++++ stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp	2008-02-26 19:45:57.000000000 +0900
 476.248 +@@ -1,6 +1,8 @@
 476.249 + #include "stardict_qqwry.h"
 476.250 + #include <glib/gi18n.h>
 476.251 + #include <glib/gstdio.h>
 476.252 ++#include <cstring>
 476.253 ++#include <stdlib.h>
 476.254 + #include <string>
 476.255 + 
 476.256 + #ifdef _WIN32
 476.257 +
 476.258 +--- stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp.gcc43	2007-09-19 17:29:21.000000000 +0900
 476.259 ++++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp	2008-02-26 19:45:13.000000000 +0900
 476.260 +@@ -3,6 +3,7 @@
 476.261 + #include <glib/gi18n.h>
 476.262 + #include <enchant.h>
 476.263 + #include <pango/pango.h>
 476.264 ++#include <cstring>
 476.265 + #include <string>
 476.266 + #include <vector>
 476.267 + 
 476.268 +--- stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp.gcc43	2007-09-19 17:34:36.000000000 +0900
 476.269 ++++ stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp	2008-02-26 19:40:46.000000000 +0900
 476.270 +@@ -1,5 +1,7 @@
 476.271 + #include "stardict_update_info.h"
 476.272 + #include <glib/gi18n.h>
 476.273 ++#include <cstring>
 476.274 ++#include <stdlib.h>
 476.275 + 
 476.276 + #ifdef _WIN32
 476.277 + #include <windows.h>
 476.278 +
 476.279 +--- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp.gcc43	2007-07-10 16:16:15.000000000 +0900
 476.280 ++++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp	2008-02-26 19:45:00.000000000 +0900
 476.281 +@@ -1,5 +1,6 @@
 476.282 + #include "stardict_wiki2xml.h"
 476.283 + #include "WIKI2XML.h"
 476.284 ++#include <cstring>
 476.285 + #include <glib.h>
 476.286 + 
 476.287 + std::string wiki2xml(std::string &str)
 476.288 +
 476.289 +--- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp.gcc43	2007-08-31 15:41:21.000000000 +0900
 476.290 ++++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp	2008-02-26 19:44:40.000000000 +0900
 476.291 +@@ -1,5 +1,6 @@
 476.292 + #include "stardict_wiki_parsedata.h"
 476.293 + #include "stardict_wiki2xml.h"
 476.294 ++#include <cstring>
 476.295 + #include <glib/gi18n.h>
 476.296 + 
 476.297 + #ifdef _WIN32
 476.298 +
 476.299 +--- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp.gcc43	2007-10-18 10:36:22.000000000 +0900
 476.300 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp	2008-02-26 19:42:25.000000000 +0900
 476.301 +@@ -1,6 +1,7 @@
 476.302 + #include "court_widget.h"
 476.303 + #include <math.h>
 476.304 + #include <list>
 476.305 ++#include <cstring>
 476.306 + 
 476.307 + 
 476.308 + wnobj::wnobj(partic_t & p, unsigned int t) : _p(p), _t(t), highlight(false)
 476.309 +
 476.310 +--- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp.gcc43	2007-10-15 12:32:04.000000000 +0900
 476.311 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp	2008-02-26 19:42:05.000000000 +0900
 476.312 +@@ -1,6 +1,7 @@
 476.313 + #include "stardict_wordnet.h"
 476.314 + #include "court_widget.h"
 476.315 + #include <glib/gi18n.h>
 476.316 ++#include <cstring>
 476.317 + 
 476.318 + #ifdef _WIN32
 476.319 + #include <windows.h>
 476.320 +
 476.321 +--- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp.gcc43	2007-10-10 18:39:10.000000000 +0900
 476.322 ++++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp	2008-02-26 19:43:21.000000000 +0900
 476.323 +@@ -1,4 +1,5 @@
 476.324 + #include "stardict_wordnet_parsedata.h"
 476.325 ++#include <cstring>
 476.326 + #include <glib/gi18n.h>
 476.327 + 
 476.328 + #ifdef _WIN32
 476.329 +
 476.330 +--- stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp.gcc43	2007-08-31 15:41:54.000000000 +0900
 476.331 ++++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp	2008-02-26 19:41:36.000000000 +0900
 476.332 +@@ -1,5 +1,6 @@
 476.333 + #include "stardict_xdxf_parsedata.h"
 476.334 + #include <glib/gi18n.h>
 476.335 ++#include <cstring>
 476.336 + 
 476.337 + #ifdef _WIN32
 476.338 + #include <windows.h>
 476.339 +
 476.340 +--- stardict-3.0.1/tests/t_config_file.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
 476.341 ++++ stardict-3.0.1/tests/t_config_file.cpp	2008-02-26 19:38:14.000000000 +0900
 476.342 +@@ -2,6 +2,7 @@
 476.343 + #  include "config.h"
 476.344 + #endif
 476.345 + 
 476.346 ++#include <memory>
 476.347 + #include <cerrno>
 476.348 + #include <cstdio>
 476.349 + #include <cstdlib>
 476.350 +
 476.351 +--- stardict-3.0.1/tests/t_xml.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
 476.352 ++++ stardict-3.0.1/tests/t_xml.cpp	2008-02-26 19:38:04.000000000 +0900
 476.353 +@@ -3,6 +3,7 @@
 476.354 + #endif
 476.355 + 
 476.356 + #include <glib.h>
 476.357 ++#include <cstring>
 476.358 + #include <cstdlib>
 476.359 + #include <string>
 476.360 +
   477.1 --- a/stardict/stuff/sigc++.patch	Wed May 09 17:03:28 2018 +0300
   477.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   477.3 @@ -1,177 +0,0 @@
   477.4 -diff -Naur stardict-3.0.1.orig/src/gconf_file.cpp stardict-3.0.1/src/gconf_file.cpp
   477.5 ---- stardict-3.0.1.orig/src/gconf_file.cpp	2007-07-10 08:16:04.000000000 +0100
   477.6 -+++ stardict-3.0.1/src/gconf_file.cpp	2008-04-11 18:18:43.000000000 +0100
   477.7 -@@ -22,6 +22,8 @@
   477.8 - #  include "config.h"
   477.9 - #endif
  477.10 - 
  477.11 -+#include <memory>
  477.12 -+
  477.13 - #include <glib/gi18n.h>
  477.14 - 
  477.15 - #include "gconf_file.hpp"
  477.16 -diff -Naur stardict-3.0.1.orig/src/inifile.cpp stardict-3.0.1/src/inifile.cpp
  477.17 ---- stardict-3.0.1.orig/src/inifile.cpp	2007-08-01 10:43:00.000000000 +0100
  477.18 -+++ stardict-3.0.1/src/inifile.cpp	2008-04-11 18:18:43.000000000 +0100
  477.19 -@@ -25,6 +25,7 @@
  477.20 - #include <vector>
  477.21 - #include <cerrno>
  477.22 - #include <cstring>
  477.23 -+#include <cstdlib>
  477.24 - #include <cstdio>
  477.25 - #include <glib/gi18n.h>
  477.26 - #include <glib/gstdio.h>
  477.27 -diff -Naur stardict-3.0.1.orig/src/pangoview.cpp stardict-3.0.1/src/pangoview.cpp
  477.28 ---- stardict-3.0.1.orig/src/pangoview.cpp	2007-09-25 08:11:48.000000000 +0100
  477.29 -+++ stardict-3.0.1/src/pangoview.cpp	2008-04-11 18:18:43.000000000 +0100
  477.30 -@@ -22,6 +22,8 @@
  477.31 - #  include "config.h"
  477.32 - #endif
  477.33 - 
  477.34 -+#include <cstring>
  477.35 -+
  477.36 - #include "gtktextviewpango.h"
  477.37 - #include "utils.h"
  477.38 - #include "skin.h"//for SkinCursor definition
  477.39 -diff -Naur stardict-3.0.1.orig/src/prefsdlg.cpp stardict-3.0.1/src/prefsdlg.cpp
  477.40 ---- stardict-3.0.1.orig/src/prefsdlg.cpp	2007-10-30 08:14:07.000000000 +0000
  477.41 -+++ stardict-3.0.1/src/prefsdlg.cpp	2008-04-11 18:18:43.000000000 +0100
  477.42 -@@ -21,6 +21,8 @@
  477.43 - #  include "config.h"
  477.44 - #endif
  477.45 - 
  477.46 -+#include <cstdlib>
  477.47 -+
  477.48 - #include <glib/gi18n.h>
  477.49 - #include <glib/gstdio.h>
  477.50 - 
  477.51 -diff -Naur stardict-3.0.1.orig/src/readword.cpp stardict-3.0.1/src/readword.cpp
  477.52 ---- stardict-3.0.1.orig/src/readword.cpp	2007-07-10 08:16:04.000000000 +0100
  477.53 -+++ stardict-3.0.1/src/readword.cpp	2008-04-11 17:53:43.000000000 +0100
  477.54 -@@ -3,6 +3,7 @@
  477.55 - #endif
  477.56 - 
  477.57 - #include <cstring>
  477.58 -+#include <cstdlib>
  477.59 - #include <string>
  477.60 - 
  477.61 - #include <glib/gi18n.h>
  477.62 -diff -Naur stardict-3.0.1.orig/src/sigc++/signal.h stardict-3.0.1/src/sigc++/signal.h
  477.63 ---- stardict-3.0.1.orig/src/sigc++/signal.h	2007-07-10 08:16:01.000000000 +0100
  477.64 -+++ stardict-3.0.1/src/sigc++/signal.h	2008-04-11 17:50:11.000000000 +0100
  477.65 -@@ -18,7 +18,7 @@
  477.66 -   //Compilers, such as older versions of SUN Forte C++, that do not allow this also often
  477.67 -   //do not allow a typedef to have the same name as a class in the typedef's definition.
  477.68 -   //For Sun Forte CC 5.7 (SUN Workshop 10), comment this out to fix the build.
  477.69 --  #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1
  477.70 -+//  #define SIGC_TYPEDEF_REDEFINE_ALLOWED 1
  477.71 - #endif
  477.72 - 
  477.73 - namespace sigc {
  477.74 -diff -Naur stardict-3.0.1.orig/src/utils.cpp stardict-3.0.1/src/utils.cpp
  477.75 ---- stardict-3.0.1.orig/src/utils.cpp	2007-10-22 03:25:02.000000000 +0100
  477.76 -+++ stardict-3.0.1/src/utils.cpp	2008-04-11 18:18:43.000000000 +0100
  477.77 -@@ -22,6 +22,8 @@
  477.78 - #  include "config.h"
  477.79 - #endif
  477.80 - 
  477.81 -+#include <cstring>
  477.82 -+
  477.83 - #include <glib.h>
  477.84 - #include <glib/gi18n.h>
  477.85 - #include <cstdlib>
  477.86 -diff -Naur stardict-3.0.1.orig/src/x11_iskeyspressed.hpp stardict-3.0.1/src/x11_iskeyspressed.hpp
  477.87 ---- stardict-3.0.1.orig/src/x11_iskeyspressed.hpp	2007-07-10 08:16:04.000000000 +0100
  477.88 -+++ stardict-3.0.1/src/x11_iskeyspressed.hpp	2008-04-11 17:57:08.000000000 +0100
  477.89 -@@ -1,6 +1,8 @@
  477.90 - #ifndef _X11_ISKEYSPRESSED_HPP_
  477.91 - #define _X11_ISKEYSPRESSED_HPP_
  477.92 - 
  477.93 -+#include <memory>
  477.94 -+
  477.95 - #include <gdk/gdkx.h>
  477.96 - #include <X11/keysym.h>
  477.97 - #include <gtk/gtk.h>
  477.98 -
  477.99 - #ifdef _WIN32
 477.100 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp
 477.101 ---- stardict-3.0.1.orig/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp	2007-09-19 09:27:18.000000000 +0100
 477.102 -+++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp	2008-04-11 18:02:55.000000000 +0100
 477.103 -@@ -1,4 +1,5 @@
 477.104 - #include "stardict_espeak.h"
 477.105 -+#include <cstring>
 477.106 - #include <espeak/speak_lib.h>
 477.107 - #include <glib/gi18n.h>
 477.108 - 
 477.109 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp
 477.110 ---- stardict-3.0.1.orig/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp	2007-09-13 08:51:55.000000000 +0100
 477.111 -+++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp	2008-04-11 17:59:50.000000000 +0100
 477.112 -@@ -1,4 +1,6 @@
 477.113 - #include "stardict_html_parsedata.h"
 477.114 -+#include <cstring>
 477.115 -+#include <cstdlib>
 477.116 - #include <glib/gi18n.h>
 477.117 - 
 477.118 - #ifdef _WIN32
 477.119 -
 477.120 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp
 477.121 ---- stardict-3.0.1.orig/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp	2007-09-19 09:29:21.000000000 +0100
 477.122 -+++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp	2008-04-11 18:02:38.000000000 +0100
 477.123 -@@ -1,4 +1,5 @@
 477.124 - #include "stardict_spell.h"
 477.125 -+#include <cstring>
 477.126 - #include <glib.h>
 477.127 - #include <glib/gi18n.h>
 477.128 - #include <enchant.h>
 477.129 -
 477.130 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp
 477.131 ---- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp	2007-10-18 02:36:22.000000000 +0100
 477.132 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp	2008-04-11 18:01:10.000000000 +0100
 477.133 -@@ -1,4 +1,5 @@
 477.134 - #include "court_widget.h"
 477.135 -+#include <cstring>
 477.136 - #include <math.h>
 477.137 - #include <list>
 477.138 - 
 477.139 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp
 477.140 ---- stardict-3.0.1.orig/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp	2007-10-15 04:32:04.000000000 +0100
 477.141 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp	2008-04-11 18:00:35.000000000 +0100
 477.142 -@@ -1,5 +1,6 @@
 477.143 - #include "stardict_wordnet.h"
 477.144 - #include "court_widget.h"
 477.145 -+#include <cstring>
 477.146 - #include <glib/gi18n.h>
 477.147 - 
 477.148 - #ifdef _WIN32
 477.149 -
 477.150 -diff -Naur stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp
 477.151 ---- stardict-3.0.1.orig/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp	2007-08-31 07:41:54.000000000 +0100
 477.152 -+++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp	2008-04-11 18:00:12.000000000 +0100
 477.153 -@@ -1,4 +1,5 @@
 477.154 - #include "stardict_xdxf_parsedata.h"
 477.155 -+#include <cstring>
 477.156 - #include <glib/gi18n.h>
 477.157 - 
 477.158 - #ifdef _WIN32
 477.159 -diff -Naur stardict-3.0.1.orig/tests/t_config_file.cpp stardict-3.0.1/tests/t_config_file.cpp
 477.160 ---- stardict-3.0.1.orig/tests/t_config_file.cpp	2007-07-10 08:16:04.000000000 +0100
 477.161 -+++ stardict-3.0.1/tests/t_config_file.cpp	2008-04-11 18:04:13.000000000 +0100
 477.162 -@@ -8,6 +8,7 @@
 477.163 - #include <cstring>
 477.164 - #include <iterator>
 477.165 - #include <iostream>
 477.166 -+#include <memory>
 477.167 - #include <gtk/gtk.h>
 477.168 - 
 477.169 - #include "config_file.hpp"
 477.170 -diff -Naur stardict-3.0.1.orig/tests/t_xml.cpp stardict-3.0.1/tests/t_xml.cpp
 477.171 ---- stardict-3.0.1.orig/tests/t_xml.cpp	2007-07-10 08:16:04.000000000 +0100
 477.172 -+++ stardict-3.0.1/tests/t_xml.cpp	2008-04-11 18:04:58.000000000 +0100
 477.173 -@@ -5,6 +5,7 @@
 477.174 - #include <glib.h>
 477.175 - #include <cstdlib>
 477.176 - #include <string>
 477.177 -+#include <cstring>
 477.178 - 
 477.179 - 
 477.180 - static void xml_decode(const char *str, std::string& decoded)
   478.1 --- a/stardict/stuff/stardict_gcc43.patch	Wed May 09 17:03:28 2018 +0300
   478.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   478.3 @@ -1,357 +0,0 @@
   478.4 ---- stardict-3.0.1/src/Makefile.am.gcc43	2007-07-10 16:16:04.000000000 +0900
   478.5 -+++ stardict-3.0.1/src/Makefile.am	2008-02-26 19:35:12.000000000 +0900
   478.6 -@@ -14,6 +14,8 @@
   478.7 - 
   478.8 - bin_PROGRAMS = stardict
   478.9 - 
  478.10 -+DEFAULT_INCLUDES = -I$(top_builddir)
  478.11 -+
  478.12 - INCLUDES =							                            \
  478.13 - 	$(STARDICT_CFLAGS)						                    \
  478.14 - 	$(LOCAL_SIGCPP_INCLUDE)	\
  478.15 -
  478.16 ---- stardict-3.0.1/src/config_file.hpp.gcc43	2007-07-10 16:16:04.000000000 +0900
  478.17 -+++ stardict-3.0.1/src/config_file.hpp	2008-02-26 19:35:00.000000000 +0900
  478.18 -@@ -5,7 +5,7 @@
  478.19 - #include <list>
  478.20 - #include <string>
  478.21 - 
  478.22 --#include "sigc++/sigc++.h"
  478.23 -+#include <sigc++/sigc++.h>
  478.24 - 
  478.25 - class config_file;
  478.26 - 
  478.27 ---- stardict-3.0.1/src/gconf_file.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
  478.28 -+++ stardict-3.0.1/src/gconf_file.cpp	2008-02-26 19:37:18.000000000 +0900
  478.29 -@@ -22,6 +22,7 @@
  478.30 - #  include "config.h"
  478.31 - #endif
  478.32 - 
  478.33 -+#include <memory>
  478.34 - #include <glib/gi18n.h>
  478.35 - 
  478.36 - #include "gconf_file.hpp"
  478.37 -
  478.38 ---- stardict-3.0.1/src/gtk_iskeyspressed.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
  478.39 -+++ stardict-3.0.1/src/gtk_iskeyspressed.cpp	2008-02-26 19:37:35.000000000 +0900
  478.40 -@@ -97,7 +97,7 @@
  478.41 -     GDK_BUTTON5_MASK  = 1 << 12,
  478.42 -   */
  478.43 - 
  478.44 --  mask = GdkModifierType(guint(mask) & (1<<13)-1);
  478.45 -+  mask = GdkModifierType(guint(mask) & ((1<<13)-1));
  478.46 - 
  478.47 -   mask = 
  478.48 -     GdkModifierType(guint(mask) & ~(GDK_LOCK_MASK | GDK_BUTTON1_MASK | GDK_BUTTON2_MASK |
  478.49 -
  478.50 ---- stardict-3.0.1/src/inifile.cpp.gcc43	2007-08-01 18:43:00.000000000 +0900
  478.51 -+++ stardict-3.0.1/src/inifile.cpp	2008-02-26 19:37:51.000000000 +0900
  478.52 -@@ -28,6 +28,7 @@
  478.53 - #include <cstdio>
  478.54 - #include <glib/gi18n.h>
  478.55 - #include <glib/gstdio.h>
  478.56 -+#include <stdlib.h>
  478.57 - 
  478.58 - #include "utils.h"
  478.59 - 
  478.60 ---- stardict-3.0.1/src/lib/common.cpp.gcc43	2007-09-25 11:27:24.000000000 +0900
  478.61 -+++ stardict-3.0.1/src/lib/common.cpp	2008-02-26 19:34:01.000000000 +0900
  478.62 -@@ -24,6 +24,8 @@
  478.63 - #  include "config.h"
  478.64 - #endif
  478.65 - 
  478.66 -+#include <cstring>
  478.67 -+#include <stdlib.h>
  478.68 - #include "common.hpp"
  478.69 - 
  478.70 - static void parse_description(const char *p, long len, std::string &description)
  478.71 -
  478.72 ---- stardict-3.0.1/src/lib/data.cpp.gcc43	2007-09-21 10:09:52.000000000 +0900
  478.73 -+++ stardict-3.0.1/src/lib/data.cpp	2008-02-26 19:33:38.000000000 +0900
  478.74 -@@ -26,6 +26,8 @@
  478.75 - 
  478.76 - #include "data.hpp"
  478.77 - #include "getuint32.h"
  478.78 -+#include <cstring>
  478.79 -+#include <cstdio>
  478.80 - 
  478.81 - 
  478.82 - DictBase::DictBase()
  478.83 -
  478.84 ---- stardict-3.0.1/src/lib/http_client.cpp.gcc43	2007-09-06 17:29:30.000000000 +0900
  478.85 -+++ stardict-3.0.1/src/lib/http_client.cpp	2008-02-26 19:34:27.000000000 +0900
  478.86 -@@ -4,6 +4,7 @@
  478.87 - 
  478.88 - #include "http_client.h"
  478.89 - #include "sockets.hpp"
  478.90 -+#include <cstring>
  478.91 - 
  478.92 - sigc::signal<void, HttpClient *, const char *> HttpClient::on_error_;
  478.93 - sigc::signal<void, HttpClient *> HttpClient::on_response_;
  478.94 -
  478.95 ---- stardict-3.0.1/src/lib/pluginmanager.cpp.gcc43	2007-10-10 12:26:45.000000000 +0900
  478.96 -+++ stardict-3.0.1/src/lib/pluginmanager.cpp	2008-02-26 19:34:36.000000000 +0900
  478.97 -@@ -1,6 +1,7 @@
  478.98 - #include "pluginmanager.h"
  478.99 - #include "file.hpp"
 478.100 - #include <string>
 478.101 -+#include <cstring>
 478.102 - 
 478.103 - StarDictPluginBaseObject::StarDictPluginBaseObject(const char *filename, GModule *module_, plugin_configure_func_t configure_func_):
 478.104 - 	plugin_filename(filename), module(module_), configure_func(configure_func_)
 478.105 -
 478.106 ---- stardict-3.0.1/src/lib/stardict_client.cpp.gcc43	2007-10-31 17:32:11.000000000 +0900
 478.107 -+++ stardict-3.0.1/src/lib/stardict_client.cpp	2008-02-26 19:34:16.000000000 +0900
 478.108 -@@ -25,6 +25,9 @@
 478.109 - #include <glib.h>
 478.110 - #include <glib/gi18n.h>
 478.111 - 
 478.112 -+#include <cstring>
 478.113 -+#include <stdlib.h>
 478.114 -+#include <cstdio>
 478.115 - #include "sockets.hpp"
 478.116 - #include "md5.h"
 478.117 - #include "getuint32.h"
 478.118 -
 478.119 ---- stardict-3.0.1/src/lib/stddict.cpp.gcc43	2007-10-30 18:06:07.000000000 +0900
 478.120 -+++ stardict-3.0.1/src/lib/stddict.cpp	2008-02-26 19:33:46.000000000 +0900
 478.121 -@@ -28,6 +28,7 @@
 478.122 - #  include "config.h"
 478.123 - #endif
 478.124 - 
 478.125 -+#include <cstring>
 478.126 - #include <glib/gi18n.h>
 478.127 - #include <glib/gstdio.h>
 478.128 - 
 478.129 ---- stardict-3.0.1/src/lib/treedict.cpp.gcc43	2007-09-21 10:09:52.000000000 +0900
 478.130 -+++ stardict-3.0.1/src/lib/treedict.cpp	2008-02-26 19:33:52.000000000 +0900
 478.131 -@@ -25,6 +25,7 @@
 478.132 - #  include "config.h"
 478.133 - #endif
 478.134 - 
 478.135 -+#include <cstring>
 478.136 - #include "file.hpp"
 478.137 - #include "getuint32.h"
 478.138 - 
 478.139 ---- stardict-3.0.1/src/pangoview.cpp.gcc43	2007-09-25 16:11:48.000000000 +0900
 478.140 -+++ stardict-3.0.1/src/pangoview.cpp	2008-02-26 19:37:02.000000000 +0900
 478.141 -@@ -22,6 +22,7 @@
 478.142 - #  include "config.h"
 478.143 - #endif
 478.144 - 
 478.145 -+#include <cstring>
 478.146 - #include "gtktextviewpango.h"
 478.147 - #include "utils.h"
 478.148 - #include "skin.h"//for SkinCursor definition
 478.149 -
 478.150 ---- stardict-3.0.1/src/utils.cpp.gcc43	2007-10-22 11:25:02.000000000 +0900
 478.151 -+++ stardict-3.0.1/src/utils.cpp	2008-02-26 19:36:01.000000000 +0900
 478.152 -@@ -22,6 +22,7 @@
 478.153 - #  include "config.h"
 478.154 - #endif
 478.155 - 
 478.156 -+#include <cstring>
 478.157 - #include <glib.h>
 478.158 - #include <glib/gi18n.h>
 478.159 - #include <cstdlib>
 478.160 -
 478.161 ---- stardict-3.0.1/src/x11_iskeyspressed.hpp.gcc43	2007-07-10 16:16:04.000000000 +0900
 478.162 -+++ stardict-3.0.1/src/x11_iskeyspressed.hpp	2008-02-27 16:16:17.000000000 +0900
 478.163 -@@ -5,6 +5,8 @@
 478.164 - #include <X11/keysym.h>
 478.165 - #include <gtk/gtk.h>
 478.166 - 
 478.167 -+#include <memory>
 478.168 -+
 478.169 - #include "iskeyspressed.hpp"
 478.170 - 
 478.171 - typedef enum { SYM, CODE, BUTTON } KeyType_t;
 478.172 -
 478.173 ---- stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp.gcc43	2007-09-21 10:09:53.000000000 +0900
 478.174 -+++ stardict-3.0.1/stardict-plugins/stardict-advertisement-plugin/advertisement.cpp	2008-02-26 19:39:34.000000000 +0900
 478.175 -@@ -2,6 +2,7 @@
 478.176 - #include <glib.h>
 478.177 - #include <glib/gi18n.h>
 478.178 - #include <glib/gstdio.h>
 478.179 -+#include <cstring>
 478.180 - #include <string>
 478.181 - #include <map>
 478.182 - #include <list>
 478.183 -
 478.184 ---- stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp.gcc43	2007-10-10 18:28:29.000000000 +0900
 478.185 -+++ stardict-3.0.1/stardict-plugins/stardict-dictdotcn-plugin/stardict_dictdotcn.cpp	2008-02-26 19:38:56.000000000 +0900
 478.186 -@@ -1,5 +1,6 @@
 478.187 - #include "stardict_dictdotcn.h"
 478.188 - #include <glib/gi18n.h>
 478.189 -+#include <cstring>
 478.190 - #include <string>
 478.191 - #include <list>
 478.192 - 
 478.193 ---- stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp.gcc43	2007-09-19 17:27:18.000000000 +0900
 478.194 -+++ stardict-3.0.1/stardict-plugins/stardict-espeak-tts-plugin/stardict_espeak.cpp	2008-02-26 19:45:43.000000000 +0900
 478.195 -@@ -1,6 +1,7 @@
 478.196 - #include "stardict_espeak.h"
 478.197 - #include <espeak/speak_lib.h>
 478.198 - #include <glib/gi18n.h>
 478.199 -+#include <cstring>
 478.200 - 
 478.201 - static const StarDictPluginSystemInfo *plugin_info = NULL;
 478.202 - static std::string voice_engine;
 478.203 -
 478.204 ---- stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp.gcc43	2007-08-31 16:10:41.000000000 +0900
 478.205 -+++ stardict-3.0.1/stardict-plugins/stardict-gucharmap-plugin/stardict_gucharmap.cpp	2008-02-26 19:45:27.000000000 +0900
 478.206 -@@ -1,6 +1,8 @@
 478.207 - #include "stardict_gucharmap.h"
 478.208 - #include <glib/gi18n.h>
 478.209 - #include <gucharmap/gucharmap.h>
 478.210 -+#include <stdlib.h>
 478.211 -+#include <cstring>
 478.212 - #include <string>
 478.213 - 
 478.214 - static char *build_dictdata(char type, const char *definition)
 478.215 -
 478.216 ---- stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp.gcc43	2007-09-13 16:51:55.000000000 +0900
 478.217 -+++ stardict-3.0.1/stardict-plugins/stardict-html-parsedata-plugin/stardict_html_parsedata.cpp	2008-02-26 19:41:11.000000000 +0900
 478.218 -@@ -1,5 +1,7 @@
 478.219 - #include "stardict_html_parsedata.h"
 478.220 - #include <glib/gi18n.h>
 478.221 -+#include <cstring>
 478.222 -+#include <stdlib.h>
 478.223 - 
 478.224 - #ifdef _WIN32
 478.225 - #include <windows.h>
 478.226 -
 478.227 ---- stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp.gcc43	2007-09-19 17:30:54.000000000 +0900
 478.228 -+++ stardict-3.0.1/stardict-plugins/stardict-man-plugin/stardict_man.cpp	2008-02-26 19:40:22.000000000 +0900
 478.229 -@@ -1,5 +1,6 @@
 478.230 - #include "stardict_man.h"
 478.231 - #include <glib/gi18n.h>
 478.232 -+#include <cstring>
 478.233 - #include <string>
 478.234 - 
 478.235 - static const StarDictPluginSystemInfo *plugin_info = NULL;
 478.236 -
 478.237 ---- stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp.gcc43	2007-10-25 17:16:37.000000000 +0900
 478.238 -+++ stardict-3.0.1/stardict-plugins/stardict-powerword-parsedata-plugin/stardict_powerword_parsedata.cpp	2008-02-26 19:44:06.000000000 +0900
 478.239 -@@ -1,4 +1,5 @@
 478.240 - #include "stardict_powerword_parsedata.h"
 478.241 -+#include <cstring>
 478.242 - #include <glib/gi18n.h>
 478.243 - 
 478.244 - #ifdef _WIN32
 478.245 -
 478.246 ---- stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp.gcc43	2007-11-02 17:41:26.000000000 +0900
 478.247 -+++ stardict-3.0.1/stardict-plugins/stardict-qqwry-plugin/stardict_qqwry.cpp	2008-02-26 19:45:57.000000000 +0900
 478.248 -@@ -1,6 +1,8 @@
 478.249 - #include "stardict_qqwry.h"
 478.250 - #include <glib/gi18n.h>
 478.251 - #include <glib/gstdio.h>
 478.252 -+#include <cstring>
 478.253 -+#include <stdlib.h>
 478.254 - #include <string>
 478.255 - 
 478.256 - #ifdef _WIN32
 478.257 -
 478.258 ---- stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp.gcc43	2007-09-19 17:29:21.000000000 +0900
 478.259 -+++ stardict-3.0.1/stardict-plugins/stardict-spell-plugin/stardict_spell.cpp	2008-02-26 19:45:13.000000000 +0900
 478.260 -@@ -3,6 +3,7 @@
 478.261 - #include <glib/gi18n.h>
 478.262 - #include <enchant.h>
 478.263 - #include <pango/pango.h>
 478.264 -+#include <cstring>
 478.265 - #include <string>
 478.266 - #include <vector>
 478.267 - 
 478.268 ---- stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp.gcc43	2007-09-19 17:34:36.000000000 +0900
 478.269 -+++ stardict-3.0.1/stardict-plugins/stardict-update-info-plugin/stardict_update_info.cpp	2008-02-26 19:40:46.000000000 +0900
 478.270 -@@ -1,5 +1,7 @@
 478.271 - #include "stardict_update_info.h"
 478.272 - #include <glib/gi18n.h>
 478.273 -+#include <cstring>
 478.274 -+#include <stdlib.h>
 478.275 - 
 478.276 - #ifdef _WIN32
 478.277 - #include <windows.h>
 478.278 -
 478.279 ---- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp.gcc43	2007-07-10 16:16:15.000000000 +0900
 478.280 -+++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki2xml.cpp	2008-02-26 19:45:00.000000000 +0900
 478.281 -@@ -1,5 +1,6 @@
 478.282 - #include "stardict_wiki2xml.h"
 478.283 - #include "WIKI2XML.h"
 478.284 -+#include <cstring>
 478.285 - #include <glib.h>
 478.286 - 
 478.287 - std::string wiki2xml(std::string &str)
 478.288 -
 478.289 ---- stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp.gcc43	2007-08-31 15:41:21.000000000 +0900
 478.290 -+++ stardict-3.0.1/stardict-plugins/stardict-wiki-parsedata-plugin/stardict_wiki_parsedata.cpp	2008-02-26 19:44:40.000000000 +0900
 478.291 -@@ -1,5 +1,6 @@
 478.292 - #include "stardict_wiki_parsedata.h"
 478.293 - #include "stardict_wiki2xml.h"
 478.294 -+#include <cstring>
 478.295 - #include <glib/gi18n.h>
 478.296 - 
 478.297 - #ifdef _WIN32
 478.298 -
 478.299 ---- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp.gcc43	2007-10-18 10:36:22.000000000 +0900
 478.300 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/court_widget.cpp	2008-02-26 19:42:25.000000000 +0900
 478.301 -@@ -1,6 +1,7 @@
 478.302 - #include "court_widget.h"
 478.303 - #include <math.h>
 478.304 - #include <list>
 478.305 -+#include <cstring>
 478.306 - 
 478.307 - 
 478.308 - wnobj::wnobj(partic_t & p, unsigned int t) : _p(p), _t(t), highlight(false)
 478.309 -
 478.310 ---- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp.gcc43	2007-10-15 12:32:04.000000000 +0900
 478.311 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet.cpp	2008-02-26 19:42:05.000000000 +0900
 478.312 -@@ -1,6 +1,7 @@
 478.313 - #include "stardict_wordnet.h"
 478.314 - #include "court_widget.h"
 478.315 - #include <glib/gi18n.h>
 478.316 -+#include <cstring>
 478.317 - 
 478.318 - #ifdef _WIN32
 478.319 - #include <windows.h>
 478.320 -
 478.321 ---- stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp.gcc43	2007-10-10 18:39:10.000000000 +0900
 478.322 -+++ stardict-3.0.1/stardict-plugins/stardict-wordnet-plugin/stardict_wordnet_parsedata.cpp	2008-02-26 19:43:21.000000000 +0900
 478.323 -@@ -1,4 +1,5 @@
 478.324 - #include "stardict_wordnet_parsedata.h"
 478.325 -+#include <cstring>
 478.326 - #include <glib/gi18n.h>
 478.327 - 
 478.328 - #ifdef _WIN32
 478.329 -
 478.330 ---- stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp.gcc43	2007-08-31 15:41:54.000000000 +0900
 478.331 -+++ stardict-3.0.1/stardict-plugins/stardict-xdxf-parsedata-plugin/stardict_xdxf_parsedata.cpp	2008-02-26 19:41:36.000000000 +0900
 478.332 -@@ -1,5 +1,6 @@
 478.333 - #include "stardict_xdxf_parsedata.h"
 478.334 - #include <glib/gi18n.h>
 478.335 -+#include <cstring>
 478.336 - 
 478.337 - #ifdef _WIN32
 478.338 - #include <windows.h>
 478.339 -
 478.340 ---- stardict-3.0.1/tests/t_config_file.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
 478.341 -+++ stardict-3.0.1/tests/t_config_file.cpp	2008-02-26 19:38:14.000000000 +0900
 478.342 -@@ -2,6 +2,7 @@
 478.343 - #  include "config.h"
 478.344 - #endif
 478.345 - 
 478.346 -+#include <memory>
 478.347 - #include <cerrno>
 478.348 - #include <cstdio>
 478.349 - #include <cstdlib>
 478.350 -
 478.351 ---- stardict-3.0.1/tests/t_xml.cpp.gcc43	2007-07-10 16:16:04.000000000 +0900
 478.352 -+++ stardict-3.0.1/tests/t_xml.cpp	2008-02-26 19:38:04.000000000 +0900
 478.353 -@@ -3,6 +3,7 @@
 478.354 - #endif
 478.355 - 
 478.356 - #include <glib.h>
 478.357 -+#include <cstring>
 478.358 - #include <cstdlib>
 478.359 - #include <string>
 478.360 -
   479.1 --- a/sundown/receipt	Wed May 09 17:03:28 2018 +0300
   479.2 +++ b/sundown/receipt	Thu May 10 21:12:00 2018 +0300
   479.3 @@ -18,7 +18,6 @@
   479.4  compile_rules()
   479.5  {
   479.6  	#sed -i 's|O3|Os|' $src/Makefile
   479.7 -	patch -p1 -i $stuff/sundown.options.patch
   479.8  	sed -i 's|-Wl||' Makefile
   479.9  
  479.10  	make
   480.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   480.2 +++ b/sundown/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   480.3 @@ -0,0 +1,1 @@
   480.4 +-p1|sundown.options.patch
   481.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   481.2 +++ b/sundown/stuff/patches/sundown.options.patch	Thu May 10 21:12:00 2018 +0300
   481.3 @@ -0,0 +1,20 @@
   481.4 +Enable next extensions in the sundown example:
   481.5 +  * tables
   481.6 +  * fenced_code
   481.7 +  * autolink
   481.8 +  * strikethrough
   481.9 +  * space_headers
  481.10 +  * superscript
  481.11 +See `markdown.h` to calculate mkd_extensions value.
  481.12 +
  481.13 +--- a/examples/sundown.c
  481.14 ++++ b/examples/sundown.c
  481.15 +@@ -62,7 +62,7 @@
  481.16 + 	ob = bufnew(OUTPUT_UNIT);
  481.17 + 
  481.18 + 	sdhtml_renderer(&callbacks, &options, 0);
  481.19 +-	markdown = sd_markdown_new(0, 16, &callbacks, &options);
  481.20 ++	markdown = sd_markdown_new(222, 16, &callbacks, &options);
  481.21 + 
  481.22 + 	sd_markdown_render(ob, ib->data, ib->size, markdown);
  481.23 + 	sd_markdown_free(markdown);
   482.1 --- a/sundown/stuff/sundown.options.patch	Wed May 09 17:03:28 2018 +0300
   482.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   482.3 @@ -1,20 +0,0 @@
   482.4 -Enable next extensions in the sundown example:
   482.5 -  * tables
   482.6 -  * fenced_code
   482.7 -  * autolink
   482.8 -  * strikethrough
   482.9 -  * space_headers
  482.10 -  * superscript
  482.11 -See `markdown.h` to calculate mkd_extensions value.
  482.12 -
  482.13 ---- a/examples/sundown.c
  482.14 -+++ b/examples/sundown.c
  482.15 -@@ -62,7 +62,7 @@
  482.16 - 	ob = bufnew(OUTPUT_UNIT);
  482.17 - 
  482.18 - 	sdhtml_renderer(&callbacks, &options, 0);
  482.19 --	markdown = sd_markdown_new(0, 16, &callbacks, &options);
  482.20 -+	markdown = sd_markdown_new(222, 16, &callbacks, &options);
  482.21 - 
  482.22 - 	sd_markdown_render(ob, ib->data, ib->size, markdown);
  482.23 - 	sd_markdown_free(markdown);
   483.1 --- a/superswitcher/receipt	Wed May 09 17:03:28 2018 +0300
   483.2 +++ b/superswitcher/receipt	Thu May 10 21:12:00 2018 +0300
   483.3 @@ -19,8 +19,6 @@
   483.4  {
   483.5  	find . -name '*.[ch]*' | xargs sed -i 's|<glib/.*h|<glib.h|'
   483.6  
   483.7 -	# Fix from Gentoo: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-misc/superswitcher/superswitcher-0.6.ebuild
   483.8 -	patch -p1 < $stuff/superswitcher-0.6-wnck-workspace.patch
   483.9  	sed -i '/-DG.*_DISABLE_DEPRECATED/d;s/@WARN_CFLAGS@//' src/Makefile.am 
  483.10  	aclocal
  483.11  	autoconf
   484.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   484.2 +++ b/superswitcher/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   484.3 @@ -0,0 +1,2 @@
   484.4 +# Fix from Gentoo: http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/x11-misc/superswitcher/superswitcher-0.6.ebuild
   484.5 +-p1|superswitcher-0.6-wnck-workspace.patch
   485.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   485.2 +++ b/superswitcher/stuff/patches/superswitcher-0.6-wnck-workspace.patch	Thu May 10 21:12:00 2018 +0300
   485.3 @@ -0,0 +1,62 @@
   485.4 +It seems like wnck_window_is_skip_pager isn't all we need to check.
   485.5 +
   485.6 +--- superswitcher/src/screen.c
   485.7 ++++ superswitcher/src/screen.c
   485.8 +@@ -505,6 +505,7 @@
   485.9 + static SSWindow *
  485.10 + add_window_to_screen (SSScreen *screen, WnckWindow *wnck_window)
  485.11 + {
  485.12 ++  WnckWorkspace *wnck_workspace;
  485.13 +   SSWindow *window;
  485.14 +   SSWorkspace *workspace;
  485.15 +   int n;
  485.16 +@@ -513,7 +514,13 @@
  485.17 +     return NULL;
  485.18 +   }
  485.19 + 
  485.20 +-  n = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window));
  485.21 ++  wnck_workspace = wnck_window_get_workspace (wnck_window);
  485.22 ++
  485.23 ++  if (wnck_workspace == NULL) {
  485.24 ++    return NULL;
  485.25 ++  }
  485.26 ++
  485.27 ++  n = wnck_workspace_get_number (wnck_workspace);
  485.28 +   workspace = ss_screen_get_nth_workspace (screen, n);
  485.29 + 
  485.30 +   window = ss_window_new (workspace, wnck_window);
  485.31 +--- superswitcher/src/window.c
  485.32 ++++ superswitcher/src/window.c
  485.33 +@@ -254,6 +254,7 @@
  485.34 + static void
  485.35 + on_workspace_changed (WnckWindow *wnck_window, gpointer data)
  485.36 + {
  485.37 ++  WnckWorkspace *wnck_workspace;
  485.38 +   SSWindow *window;
  485.39 +   SSWorkspace *old_workspace;
  485.40 +   SSWorkspace *new_workspace;
  485.41 +@@ -261,12 +262,19 @@
  485.42 + 
  485.43 +   window = (SSWindow *) data;
  485.44 +   old_workspace = window->workspace;
  485.45 +-  new_workspace_id = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window));
  485.46 +-  new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id);
  485.47 +-
  485.48 +   ss_workspace_remove_window (old_workspace, window);
  485.49 ++
  485.50 ++  wnck_workspace = wnck_window_get_workspace (wnck_window);
  485.51 ++  if (wnck_workspace) {
  485.52 ++    new_workspace_id = wnck_workspace_get_number (wnck_workspace);
  485.53 ++    new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id);
  485.54 ++
  485.55 ++    ss_workspace_add_window (new_workspace, window);
  485.56 ++    window->workspace = new_workspace;
  485.57 ++  } else {
  485.58 ++    window->workspace = NULL;
  485.59 ++  }
  485.60 ++
  485.61 +-  window->workspace = new_workspace;
  485.62 +-  ss_workspace_add_window (new_workspace, window);
  485.63 +   window->new_window_index = -1;
  485.64 +   gtk_widget_queue_draw (gtk_widget_get_toplevel (window->widget));
  485.65 + }
   486.1 --- a/superswitcher/stuff/superswitcher-0.6-wnck-workspace.patch	Wed May 09 17:03:28 2018 +0300
   486.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   486.3 @@ -1,62 +0,0 @@
   486.4 -It seems like wnck_window_is_skip_pager isn't all we need to check.
   486.5 -
   486.6 ---- superswitcher/src/screen.c
   486.7 -+++ superswitcher/src/screen.c
   486.8 -@@ -505,6 +505,7 @@
   486.9 - static SSWindow *
  486.10 - add_window_to_screen (SSScreen *screen, WnckWindow *wnck_window)
  486.11 - {
  486.12 -+  WnckWorkspace *wnck_workspace;
  486.13 -   SSWindow *window;
  486.14 -   SSWorkspace *workspace;
  486.15 -   int n;
  486.16 -@@ -513,7 +514,13 @@
  486.17 -     return NULL;
  486.18 -   }
  486.19 - 
  486.20 --  n = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window));
  486.21 -+  wnck_workspace = wnck_window_get_workspace (wnck_window);
  486.22 -+
  486.23 -+  if (wnck_workspace == NULL) {
  486.24 -+    return NULL;
  486.25 -+  }
  486.26 -+
  486.27 -+  n = wnck_workspace_get_number (wnck_workspace);
  486.28 -   workspace = ss_screen_get_nth_workspace (screen, n);
  486.29 - 
  486.30 -   window = ss_window_new (workspace, wnck_window);
  486.31 ---- superswitcher/src/window.c
  486.32 -+++ superswitcher/src/window.c
  486.33 -@@ -254,6 +254,7 @@
  486.34 - static void
  486.35 - on_workspace_changed (WnckWindow *wnck_window, gpointer data)
  486.36 - {
  486.37 -+  WnckWorkspace *wnck_workspace;
  486.38 -   SSWindow *window;
  486.39 -   SSWorkspace *old_workspace;
  486.40 -   SSWorkspace *new_workspace;
  486.41 -@@ -261,12 +262,19 @@
  486.42 - 
  486.43 -   window = (SSWindow *) data;
  486.44 -   old_workspace = window->workspace;
  486.45 --  new_workspace_id = wnck_workspace_get_number (wnck_window_get_workspace (wnck_window));
  486.46 --  new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id);
  486.47 --
  486.48 -   ss_workspace_remove_window (old_workspace, window);
  486.49 -+
  486.50 -+  wnck_workspace = wnck_window_get_workspace (wnck_window);
  486.51 -+  if (wnck_workspace) {
  486.52 -+    new_workspace_id = wnck_workspace_get_number (wnck_workspace);
  486.53 -+    new_workspace = ss_screen_get_nth_workspace (old_workspace->screen, new_workspace_id);
  486.54 -+
  486.55 -+    ss_workspace_add_window (new_workspace, window);
  486.56 -+    window->workspace = new_workspace;
  486.57 -+  } else {
  486.58 -+    window->workspace = NULL;
  486.59 -+  }
  486.60 -+
  486.61 --  window->workspace = new_workspace;
  486.62 --  ss_workspace_add_window (new_workspace, window);
  486.63 -   window->new_window_index = -1;
  486.64 -   gtk_widget_queue_draw (gtk_widget_get_toplevel (window->widget));
  486.65 - }
   487.1 --- a/syslinux/receipt	Wed May 09 17:03:28 2018 +0300
   487.2 +++ b/syslinux/receipt	Thu May 10 21:12:00 2018 +0300
   487.3 @@ -21,10 +21,6 @@
   487.4  compile_rules()
   487.5  {
   487.6  	rm -f $src/core/isolinux.bin
   487.7 -	patch -p 0 < $stuff/extra/loadhigh.u
   487.8 -	patch -p 0 < $stuff/extra/iso9660.u
   487.9 -	patch -p 0 < $stuff/extra/readconfig.u
  487.10 -	patch -p 0 < $stuff/extra/keytab-lilo.u
  487.11  	cp -f $stuff/slitaz-next/miniacc.h $src/lzo/src/ # use latest https://raw.githubusercontent.com/upx/upx/master/src/miniacc.h
  487.12  	cp $stuff/tools/isohybrid.sh .
  487.13  	cp $stuff/extra/md5sum.c com32/modules
   488.1 --- a/syslinux/stuff/extra/iso9660.u	Wed May 09 17:03:28 2018 +0300
   488.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   488.3 @@ -1,74 +0,0 @@
   488.4 ---- core/fs/iso9660/iso9660.c
   488.5 -+++ core/fs/iso9660/iso9660.c
   488.6 -@@ -89,6 +89,24 @@
   488.7 -     return true;
   488.8 - }
   488.9 - 
  488.10 -+#define __ROCKRIDGE
  488.11 -+#ifdef __ROCKRIDGE
  488.12 -+static size_t rockname(const struct iso_dir_entry *de, char **name)
  488.13 -+{
  488.14 -+	size_t len, delen, n = (de->name_len + 34) & -2;
  488.15 -+	char *data = (char *) de;
  488.16 -+	
  488.17 -+	for (delen = 0; n + 2 < de->length; n += len) {
  488.18 -+		len = data[n + 2];
  488.19 -+		if (* (short *) (data + n) == 0x4D4E) { /* NM */
  488.20 -+			*name = data + n + 5;
  488.21 -+			delen = len - 5;
  488.22 -+		}
  488.23 -+	}
  488.24 -+	return delen;
  488.25 -+}
  488.26 -+#endif
  488.27 -+
  488.28 - /*
  488.29 -  * Find a entry in the specified dir with name _dname_.
  488.30 -  */
  488.31 -@@ -132,6 +150,20 @@
  488.32 - 	
  488.33 - 	de_name_len = de->name_len;
  488.34 - 	de_name = de->name;
  488.35 -+#ifdef __ROCKRIDGE
  488.36 -+	{
  488.37 -+		char *name;
  488.38 -+		size_t len = rockname(de, &name);
  488.39 -+
  488.40 -+		if (len) {
  488.41 -+			name[len] = 0;
  488.42 -+			if (!strcmp(name, dname)) {
  488.43 -+				dprintf("Found rockridge.\n");
  488.44 -+				return de;
  488.45 -+			}
  488.46 -+		}
  488.47 -+	}
  488.48 -+#endif
  488.49 - 	if (iso_compare_name(de_name, de_name_len, dname)) {
  488.50 - 	    dprintf("Found.\n");
  488.51 - 	    return de;
  488.52 -@@ -217,11 +249,22 @@
  488.53 -     dirent->d_ino = 0;           /* Inode number is invalid to ISO fs */
  488.54 -     dirent->d_off = file->offset;
  488.55 -     dirent->d_type = get_inode_mode(de->flags);
  488.56 --    dirent->d_reclen = offsetof(struct dirent, d_name) + 1 +
  488.57 --	iso_convert_name(dirent->d_name, de->name, de->name_len);
  488.58 -+    iso_convert_name(dirent->d_name, de->name, de->name_len);
  488.59 - 
  488.60 -+#ifdef __ROCKRIDGE
  488.61 -+	{
  488.62 -+		char *name;
  488.63 -+		size_t len = rockname(de, &name);
  488.64 -+
  488.65 -+		if (len) {
  488.66 -+			strcpy(dirent->d_name, name);
  488.67 -+			dirent->d_name[len] = 0;
  488.68 -+		}
  488.69 -+	}
  488.70 -+#endif
  488.71 -+    dirent->d_reclen = offsetof(struct dirent, d_name) + 1 + strlen(dirent->d_name);
  488.72 -     file->offset += de->length;  /* Update for next reading */
  488.73 --    
  488.74 -+
  488.75 -     return 0;
  488.76 - }
  488.77 - 
   489.1 --- a/syslinux/stuff/extra/keytab-lilo.u	Wed May 09 17:03:28 2018 +0300
   489.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   489.3 @@ -1,15 +0,0 @@
   489.4 -kbd 2.0.3 support
   489.5 ---- utils/keytab-lilo
   489.6 -+++ utils/keytab-lilo
   489.7 -@@ -48,9 +48,9 @@
   489.8 -     $empty = 1;
   489.9 -     while (<FILE>) {
  489.10 - 	chop;
  489.11 --	if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
  489.12 -+	if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
  489.13 - 	    die "active at beginning of map" if defined $current;
  489.14 --	    $current = $pfx.":".$2;
  489.15 -+	    $current = $pfx.":".$3;
  489.16 - 	    next;
  489.17 - 	}
  489.18 - 	undef $current if /^};\s*$/;
   490.1 --- a/syslinux/stuff/extra/loadhigh.u	Wed May 09 17:03:28 2018 +0300
   490.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   490.3 @@ -1,557 +0,0 @@
   490.4 ---- core/fs/loadhigh.c
   490.5 -+++ core/fs/loadhigh.c
   490.6 -@@ -36,6 +36,11 @@
   490.7 - #include <minmax.h>
   490.8 - #include "core.h"
   490.9 - #include "fs.h"
  490.10 -+#define LZLOAD	".c32 modules can be compressed with lz4 or lzma"
  490.11 -+#ifdef LZLOAD
  490.12 -+#include "../unlz4.c"
  490.13 -+#include "../unlzma.c"
  490.14 -+#endif
  490.15 - 
  490.16 - #define MAX_CHUNK	(1 << 20) /* 1 MB */
  490.17 - 
  490.18 -@@ -51,6 +56,9 @@
  490.19 -     uint32_t sector_mask;
  490.20 -     size_t pad;
  490.21 -     uint32_t retflags = 0;
  490.22 -+#ifdef LZLOAD
  490.23 -+    char *unpacked = (char *) regs->edi.l;
  490.24 -+#endif
  490.25 - 
  490.26 -     bytes     = regs->eax.l;
  490.27 -     zero_mask = regs->edx.w[0];
  490.28 -@@ -101,6 +109,27 @@
  490.29 - 	    break;
  490.30 - 	}
  490.31 -     }
  490.32 -+
  490.33 -+#ifdef LZLOAD
  490.34 -+    switch (* (short *) unpacked) {
  490.35 -+	char *packed;
  490.36 -+	size_t packedsz, unpackedsz;
  490.37 -+    case 0x005D:
  490.38 -+  	packedsz = buf - unpacked;
  490.39 -+	unpackedsz = * (unsigned long *) (unpacked + 5);
  490.40 -+	if (unpackedsz > 1000000) break; /* no size? */
  490.41 -+	packed = unpacked + unpackedsz - packedsz + 1024;
  490.42 -+	if (packed < unpacked + 1024) packed = unpacked + 1024;
  490.43 -+	memmove(packed, unpacked, packedsz);
  490.44 -+	unlzma(packed, unpacked, packed + packedsz /* heap */);
  490.45 -+	buf = packed;
  490.46 -+	break;
  490.47 -+    case 0x2204:
  490.48 -+    case 0x2102:
  490.49 -+	buf = (char *) unlz4((unsigned char *) unpacked, (unsigned char *) buf);
  490.50 -+	break;
  490.51 -+    }
  490.52 -+#endif
  490.53 - 
  490.54 -     pad = (size_t)buf & zero_mask;
  490.55 -     if (pad)
  490.56 ---- /dev/null
  490.57 -+++ core/unlzma.c
  490.58 -@@ -0,0 +1,385 @@
  490.59 -+typedef unsigned char uint8_t;
  490.60 -+typedef unsigned short uint16_t;
  490.61 -+typedef unsigned uint32_t;
  490.62 -+typedef unsigned long long uint64_t;
  490.63 -+typedef unsigned size_t;
  490.64 -+#define SWAP_LE32(x)	(x)
  490.65 -+#define SWAP_LE64(x)	(x)
  490.66 -+/* vi: set sw=4 ts=4: */
  490.67 -+/*
  490.68 -+ * Small lzma deflate implementation.
  490.69 -+ * Copyright (C) 2006  Aurelien Jacobs <aurel@gnuage.org>
  490.70 -+ *
  490.71 -+ * Based on LzmaDecode.c from the LZMA SDK 4.22 (http://www.7-zip.org/)
  490.72 -+ * Copyright (C) 1999-2005  Igor Pavlov
  490.73 -+ *
  490.74 -+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  490.75 -+ */
  490.76 -+
  490.77 -+#include <string.h>
  490.78 -+
  490.79 -+#define PACKED __attribute__ ((packed))
  490.80 -+#define ALWAYS_INLINE inline
  490.81 -+#define speed_inline
  490.82 -+#define size_inline ALWAYS_INLINE
  490.83 -+
  490.84 -+
  490.85 -+typedef struct {
  490.86 -+	uint8_t *ptr;
  490.87 -+
  490.88 -+	uint32_t code;
  490.89 -+	uint32_t range;
  490.90 -+	uint32_t bound;
  490.91 -+} rc_t;
  490.92 -+
  490.93 -+#define RC_TOP_BITS 24
  490.94 -+#define RC_MOVE_BITS 5
  490.95 -+#define RC_MODEL_TOTAL_BITS 11
  490.96 -+
  490.97 -+/* Called twice, but one callsite is in speed_inline'd rc_is_bit_1() */
  490.98 -+static void rc_do_normalize(rc_t *rc)
  490.99 -+{
 490.100 -+	rc->range <<= 8;
 490.101 -+	rc->code = (rc->code << 8) | *rc->ptr++;
 490.102 -+}
 490.103 -+
 490.104 -+static ALWAYS_INLINE void rc_normalize(rc_t *rc)
 490.105 -+{
 490.106 -+	if (rc->range < (1 << RC_TOP_BITS)) {
 490.107 -+		rc_do_normalize(rc);
 490.108 -+	}
 490.109 -+}
 490.110 -+
 490.111 -+/* Called once */
 490.112 -+static void rc_init(rc_t *rc) /*, int buffer_size) */
 490.113 -+{
 490.114 -+	int i;
 490.115 -+
 490.116 -+	rc->range = 0;
 490.117 -+	for (i = 0; i < 5; i++) {
 490.118 -+		rc_do_normalize(rc);
 490.119 -+	}
 490.120 -+	rc->range = 0xffffffff;
 490.121 -+}
 490.122 -+
 490.123 -+/* rc_is_bit_1 is called 9 times */
 490.124 -+static speed_inline int rc_is_bit_1(rc_t *rc, uint16_t *p)
 490.125 -+{
 490.126 -+	rc_normalize(rc);
 490.127 -+	rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS);
 490.128 -+	if (rc->code < rc->bound) {
 490.129 -+		rc->range = rc->bound;
 490.130 -+		*p += ((1 << RC_MODEL_TOTAL_BITS) - *p) >> RC_MOVE_BITS;
 490.131 -+		return 0;
 490.132 -+	}
 490.133 -+	rc->range -= rc->bound;
 490.134 -+	rc->code -= rc->bound;
 490.135 -+	*p -= *p >> RC_MOVE_BITS;
 490.136 -+	return 1;
 490.137 -+}
 490.138 -+
 490.139 -+/* Called 4 times in unlzma loop */
 490.140 -+static ALWAYS_INLINE int rc_get_bit(rc_t *rc, uint16_t *p, int *symbol)
 490.141 -+{
 490.142 -+	int ret = rc_is_bit_1(rc, p);
 490.143 -+	*symbol = *symbol * 2 + ret;
 490.144 -+	return ret;
 490.145 -+}
 490.146 -+
 490.147 -+/* Called once */
 490.148 -+static ALWAYS_INLINE int rc_direct_bit(rc_t *rc)
 490.149 -+{
 490.150 -+	rc_normalize(rc);
 490.151 -+	rc->range >>= 1;
 490.152 -+	if (rc->code >= rc->range) {
 490.153 -+		rc->code -= rc->range;
 490.154 -+		return 1;
 490.155 -+	}
 490.156 -+	return 0;
 490.157 -+}
 490.158 -+
 490.159 -+/* Called twice */
 490.160 -+static speed_inline void
 490.161 -+rc_bit_tree_decode(rc_t *rc, uint16_t *p, int num_levels, int *symbol)
 490.162 -+{
 490.163 -+	int i = num_levels;
 490.164 -+
 490.165 -+	*symbol = 1;
 490.166 -+	while (i--)
 490.167 -+		rc_get_bit(rc, p + *symbol, symbol);
 490.168 -+	*symbol -= 1 << num_levels;
 490.169 -+}
 490.170 -+
 490.171 -+
 490.172 -+typedef struct {
 490.173 -+	uint8_t pos;
 490.174 -+	uint32_t dict_size;
 490.175 -+	uint64_t dst_size;
 490.176 -+} PACKED lzma_header_t;
 490.177 -+
 490.178 -+
 490.179 -+/* #defines will force compiler to compute/optimize each one with each usage.
 490.180 -+ * Have heart and use enum instead. */
 490.181 -+enum {
 490.182 -+	LZMA_BASE_SIZE = 1846,
 490.183 -+	LZMA_LIT_SIZE  = 768,
 490.184 -+
 490.185 -+	LZMA_NUM_POS_BITS_MAX = 4,
 490.186 -+
 490.187 -+	LZMA_LEN_NUM_LOW_BITS  = 3,
 490.188 -+	LZMA_LEN_NUM_MID_BITS  = 3,
 490.189 -+	LZMA_LEN_NUM_HIGH_BITS = 8,
 490.190 -+
 490.191 -+	LZMA_LEN_CHOICE     = 0,
 490.192 -+	LZMA_LEN_CHOICE_2   = (LZMA_LEN_CHOICE + 1),
 490.193 -+	LZMA_LEN_LOW        = (LZMA_LEN_CHOICE_2 + 1),
 490.194 -+	LZMA_LEN_MID        = (LZMA_LEN_LOW \
 490.195 -+	                      + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS))),
 490.196 -+	LZMA_LEN_HIGH       = (LZMA_LEN_MID \
 490.197 -+	                      + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS))),
 490.198 -+	LZMA_NUM_LEN_PROBS  = (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS)),
 490.199 -+
 490.200 -+	LZMA_NUM_STATES     = 12,
 490.201 -+	LZMA_NUM_LIT_STATES = 7,
 490.202 -+
 490.203 -+	LZMA_START_POS_MODEL_INDEX = 4,
 490.204 -+	LZMA_END_POS_MODEL_INDEX   = 14,
 490.205 -+	LZMA_NUM_FULL_DISTANCES    = (1 << (LZMA_END_POS_MODEL_INDEX >> 1)),
 490.206 -+
 490.207 -+	LZMA_NUM_POS_SLOT_BITS = 6,
 490.208 -+	LZMA_NUM_LEN_TO_POS_STATES = 4,
 490.209 -+
 490.210 -+	LZMA_NUM_ALIGN_BITS = 4,
 490.211 -+
 490.212 -+	LZMA_MATCH_MIN_LEN  = 2,
 490.213 -+
 490.214 -+	LZMA_IS_MATCH       = 0,
 490.215 -+	LZMA_IS_REP         = (LZMA_IS_MATCH + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),
 490.216 -+	LZMA_IS_REP_G0      = (LZMA_IS_REP + LZMA_NUM_STATES),
 490.217 -+	LZMA_IS_REP_G1      = (LZMA_IS_REP_G0 + LZMA_NUM_STATES),
 490.218 -+	LZMA_IS_REP_G2      = (LZMA_IS_REP_G1 + LZMA_NUM_STATES),
 490.219 -+	LZMA_IS_REP_0_LONG  = (LZMA_IS_REP_G2 + LZMA_NUM_STATES),
 490.220 -+	LZMA_POS_SLOT       = (LZMA_IS_REP_0_LONG \
 490.221 -+	                      + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),
 490.222 -+	LZMA_SPEC_POS       = (LZMA_POS_SLOT \
 490.223 -+	                      + (LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS)),
 490.224 -+	LZMA_ALIGN          = (LZMA_SPEC_POS \
 490.225 -+	                      + LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX),
 490.226 -+	LZMA_LEN_CODER      = (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS)),
 490.227 -+	LZMA_REP_LEN_CODER  = (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS),
 490.228 -+	LZMA_LITERAL        = (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS),
 490.229 -+};
 490.230 -+
 490.231 -+
 490.232 -+void unlzma(char *from, char *to, char *heap)
 490.233 -+{
 490.234 -+	lzma_header_t header;
 490.235 -+	int lc, pb, lp;
 490.236 -+	uint32_t pos_state_mask;
 490.237 -+	uint32_t literal_pos_mask;
 490.238 -+	uint16_t *p;
 490.239 -+	rc_t *rc = (rc_t *) heap;
 490.240 -+	int i;
 490.241 -+	uint8_t *buffer = (void *) to;
 490.242 -+	uint8_t previous_byte = 0;
 490.243 -+	size_t buffer_pos = 0;
 490.244 -+	int len = 0;
 490.245 -+	int state = 0;
 490.246 -+	uint32_t rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
 490.247 -+
 490.248 -+	memcpy(&header, from, sizeof(header));
 490.249 -+	from += sizeof(header);
 490.250 -+	heap += sizeof(*rc);
 490.251 -+	rc->ptr = (void *) from;
 490.252 -+
 490.253 -+	i = header.pos / 9;
 490.254 -+	lc = header.pos % 9;
 490.255 -+	pb = i / 5;
 490.256 -+	lp = i % 5;
 490.257 -+	pos_state_mask = (1 << pb) - 1;
 490.258 -+	literal_pos_mask = (1 << lp) - 1;
 490.259 -+
 490.260 -+	/* Example values from linux-3.3.4.tar.lzma:
 490.261 -+	 * dict_size: 64M, dst_size: 2^64-1
 490.262 -+	 */
 490.263 -+	header.dict_size = SWAP_LE32(header.dict_size);
 490.264 -+	header.dst_size = SWAP_LE64(header.dst_size);
 490.265 -+
 490.266 -+	//if (header.dict_size == 0)
 490.267 -+	//	header.dict_size++;
 490.268 -+
 490.269 -+	rc_init(rc);
 490.270 -+
 490.271 -+	{
 490.272 -+		int num_probs;
 490.273 -+
 490.274 -+		num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp));
 490.275 -+		//p = xmalloc(num_probs * sizeof(*p));
 490.276 -+		p = (void *) heap;
 490.277 -+		num_probs += LZMA_LITERAL - LZMA_BASE_SIZE;
 490.278 -+		for (i = 0; i < num_probs; i++)
 490.279 -+			p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1;
 490.280 -+	}
 490.281 -+
 490.282 -+
 490.283 -+	while (buffer_pos < header.dst_size) {
 490.284 -+		int pos_state = buffer_pos & pos_state_mask;
 490.285 -+		uint16_t *prob = p + LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state;
 490.286 -+
 490.287 -+		if (!rc_is_bit_1(rc, prob)) {
 490.288 -+			static const char next_state[LZMA_NUM_STATES] =
 490.289 -+				{ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 };
 490.290 -+			int mi = 1;
 490.291 -+
 490.292 -+			prob = (p + LZMA_LITERAL
 490.293 -+			        + (LZMA_LIT_SIZE * (((buffer_pos & literal_pos_mask) << lc)
 490.294 -+			                            + (previous_byte >> (8 - lc))
 490.295 -+			                           )
 490.296 -+			          )
 490.297 -+			);
 490.298 -+
 490.299 -+			if (state >= LZMA_NUM_LIT_STATES) {
 490.300 -+				int match_byte;
 490.301 -+				uint32_t pos = buffer_pos - rep0;
 490.302 -+
 490.303 -+				while (pos >= header.dict_size)
 490.304 -+					pos += header.dict_size;
 490.305 -+				match_byte = buffer[pos];
 490.306 -+				do {
 490.307 -+					int bit;
 490.308 -+
 490.309 -+					match_byte <<= 1;
 490.310 -+					bit = match_byte & 0x100;
 490.311 -+					bit ^= (rc_get_bit(rc, prob + 0x100 + bit + mi, &mi) << 8); /* 0x100 or 0 */
 490.312 -+					if (bit)
 490.313 -+						break;
 490.314 -+				} while (mi < 0x100);
 490.315 -+			}
 490.316 -+			while (mi < 0x100) {
 490.317 -+				rc_get_bit(rc, prob + mi, &mi);
 490.318 -+			}
 490.319 -+
 490.320 -+			state = next_state[state];
 490.321 -+
 490.322 -+			previous_byte = (uint8_t) mi;
 490.323 -+			len = 1;
 490.324 -+			goto one_byte2;
 490.325 -+		} else {
 490.326 -+			int num_bits;
 490.327 -+			int offset;
 490.328 -+			uint16_t *prob2;
 490.329 -+#define prob_len prob2
 490.330 -+
 490.331 -+			prob2 = p + LZMA_IS_REP + state;
 490.332 -+			if (!rc_is_bit_1(rc, prob2)) {
 490.333 -+				rep3 = rep2;
 490.334 -+				rep2 = rep1;
 490.335 -+				rep1 = rep0;
 490.336 -+				state = state < LZMA_NUM_LIT_STATES ? 0 : 3;
 490.337 -+				prob2 = p + LZMA_LEN_CODER;
 490.338 -+			} else {
 490.339 -+				prob2 += LZMA_IS_REP_G0 - LZMA_IS_REP;
 490.340 -+				if (!rc_is_bit_1(rc, prob2)) {
 490.341 -+					prob2 = (p + LZMA_IS_REP_0_LONG
 490.342 -+					        + (state << LZMA_NUM_POS_BITS_MAX)
 490.343 -+					        + pos_state
 490.344 -+					);
 490.345 -+					if (!rc_is_bit_1(rc, prob2)) {
 490.346 -+						state = state < LZMA_NUM_LIT_STATES ? 9 : 11;
 490.347 -+						len = 1;
 490.348 -+						goto string;
 490.349 -+					}
 490.350 -+				} else {
 490.351 -+					uint32_t distance;
 490.352 -+
 490.353 -+					prob2 += LZMA_IS_REP_G1 - LZMA_IS_REP_G0;
 490.354 -+					distance = rep1;
 490.355 -+					if (rc_is_bit_1(rc, prob2)) {
 490.356 -+						prob2 += LZMA_IS_REP_G2 - LZMA_IS_REP_G1;
 490.357 -+						distance = rep2;
 490.358 -+						if (rc_is_bit_1(rc, prob2)) {
 490.359 -+							distance = rep3;
 490.360 -+							rep3 = rep2;
 490.361 -+						}
 490.362 -+						rep2 = rep1;
 490.363 -+					}
 490.364 -+					rep1 = rep0;
 490.365 -+					rep0 = distance;
 490.366 -+				}
 490.367 -+				state = state < LZMA_NUM_LIT_STATES ? 8 : 11;
 490.368 -+				prob2 = p + LZMA_REP_LEN_CODER;
 490.369 -+			}
 490.370 -+
 490.371 -+			prob_len = prob2 + LZMA_LEN_CHOICE;
 490.372 -+			num_bits = LZMA_LEN_NUM_LOW_BITS;
 490.373 -+			if (!rc_is_bit_1(rc, prob_len)) {
 490.374 -+				prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE
 490.375 -+				            + (pos_state << LZMA_LEN_NUM_LOW_BITS);
 490.376 -+				offset = 0;
 490.377 -+			} else {
 490.378 -+				prob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE;
 490.379 -+				if (!rc_is_bit_1(rc, prob_len)) {
 490.380 -+					prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2
 490.381 -+					            + (pos_state << LZMA_LEN_NUM_MID_BITS);
 490.382 -+					offset = 1 << LZMA_LEN_NUM_LOW_BITS;
 490.383 -+					num_bits += LZMA_LEN_NUM_MID_BITS - LZMA_LEN_NUM_LOW_BITS;
 490.384 -+				} else {
 490.385 -+					prob_len += LZMA_LEN_HIGH - LZMA_LEN_CHOICE_2;
 490.386 -+					offset = ((1 << LZMA_LEN_NUM_LOW_BITS)
 490.387 -+					          + (1 << LZMA_LEN_NUM_MID_BITS));
 490.388 -+					num_bits += LZMA_LEN_NUM_HIGH_BITS - LZMA_LEN_NUM_LOW_BITS;
 490.389 -+				}
 490.390 -+			}
 490.391 -+			rc_bit_tree_decode(rc, prob_len, num_bits, &len);
 490.392 -+			len += offset;
 490.393 -+
 490.394 -+			if (state < 4) {
 490.395 -+				int pos_slot;
 490.396 -+				uint16_t *prob3;
 490.397 -+
 490.398 -+				state += LZMA_NUM_LIT_STATES;
 490.399 -+				prob3 = p + LZMA_POS_SLOT +
 490.400 -+				       ((len < LZMA_NUM_LEN_TO_POS_STATES ? len :
 490.401 -+				         LZMA_NUM_LEN_TO_POS_STATES - 1)
 490.402 -+				         << LZMA_NUM_POS_SLOT_BITS);
 490.403 -+				rc_bit_tree_decode(rc, prob3,
 490.404 -+					LZMA_NUM_POS_SLOT_BITS, &pos_slot);
 490.405 -+				rep0 = pos_slot;
 490.406 -+				if (pos_slot >= LZMA_START_POS_MODEL_INDEX) {
 490.407 -+					int i2, mi2, num_bits2 = (pos_slot >> 1) - 1;
 490.408 -+					rep0 = 2 | (pos_slot & 1);
 490.409 -+					if (pos_slot < LZMA_END_POS_MODEL_INDEX) {
 490.410 -+						rep0 <<= num_bits2;
 490.411 -+						prob3 = p + LZMA_SPEC_POS + rep0 - pos_slot - 1;
 490.412 -+					} else {
 490.413 -+						for (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--)
 490.414 -+							rep0 = (rep0 << 1) | rc_direct_bit(rc);
 490.415 -+						rep0 <<= LZMA_NUM_ALIGN_BITS;
 490.416 -+						prob3 = p + LZMA_ALIGN;
 490.417 -+					}
 490.418 -+					i2 = 1;
 490.419 -+					mi2 = 1;
 490.420 -+					while (num_bits2--) {
 490.421 -+						if (rc_get_bit(rc, prob3 + mi2, &mi2))
 490.422 -+							rep0 |= i2;
 490.423 -+						i2 <<= 1;
 490.424 -+					}
 490.425 -+				}
 490.426 -+				if (++rep0 == 0)
 490.427 -+					break;
 490.428 -+			}
 490.429 -+
 490.430 -+			len += LZMA_MATCH_MIN_LEN;
 490.431 -+ string:
 490.432 -+			do {
 490.433 -+				uint32_t pos = buffer_pos - rep0;
 490.434 -+				while (pos >= header.dict_size)
 490.435 -+					pos += header.dict_size;
 490.436 -+				previous_byte = buffer[pos];
 490.437 -+ one_byte2:
 490.438 -+				buffer[buffer_pos++] = previous_byte;
 490.439 -+				len--;
 490.440 -+			} while (len != 0 && buffer_pos < header.dst_size);
 490.441 -+		}
 490.442 -+	}
 490.443 -+}
 490.444 ---- /dev/null
 490.445 -+++ core/unlz4.c
 490.446 -@@ -0,0 +1,114 @@
 490.447 -+/*
 490.448 -+ * Copyright (C) 2015, pascal.bellard@slitaz.org
 490.449 -+ *
 490.450 -+ * This program is free software; you can redistribute it and/or modify
 490.451 -+ * it under the terms of the GNU General Public License version 2 as
 490.452 -+ * published by the Free Software Foundation.
 490.453 -+ */
 490.454 -+
 490.455 -+#include <string.h>
 490.456 -+
 490.457 -+#define LZ4_MAGIC	0x184D2204	/* Spec 1.5.0 */
 490.458 -+#define LZ4_LEGACY	0x184C2102
 490.459 -+#define LZ4_SKIP(n)	((((n) - 0x184D2A50) >> 4) == 0)
 490.460 -+
 490.461 -+static unsigned lz4cnt(unsigned char **p, unsigned n)
 490.462 -+{
 490.463 -+	int i;
 490.464 -+
 490.465 -+	if (n == 0xF) do {
 490.466 -+		i = *(*p)++;
 490.467 -+		n += i;
 490.468 -+	} while (i == 0xFF);
 490.469 -+	return n;
 490.470 -+}
 490.471 -+
 490.472 -+unsigned char *unlz4(unsigned char *from, unsigned char *end)
 490.473 -+{
 490.474 -+	unsigned char *p, *end_chunk, *to, flags, mask;
 490.475 -+	long magic;
 490.476 -+	unsigned i, n, size;
 490.477 -+
 490.478 -+	for (p = from, flags = size = 0; p < end;) {
 490.479 -+		while (1) {
 490.480 -+			magic = * (long *) p;
 490.481 -+			p += sizeof(long);
 490.482 -+			if (magic == LZ4_LEGACY) continue;
 490.483 -+			if (magic != LZ4_MAGIC) break;
 490.484 -+			flags = *p;
 490.485 -+			if (flags & 8) {
 490.486 -+				size = * (unsigned *) (p + 2);
 490.487 -+				goto sizefound;
 490.488 -+			}
 490.489 -+			p += 3; /* skip FLG BD HC */
 490.490 -+		}
 490.491 -+		if (LZ4_SKIP(magic)) {
 490.492 -+			p += 4 + * (long *) p;
 490.493 -+			continue;
 490.494 -+		}
 490.495 -+		mask = 4; /* Content checksum */
 490.496 -+		if (magic) {
 490.497 -+			if (magic > 0)
 490.498 -+			for (end_chunk = p + magic; p < end_chunk;) {
 490.499 -+				unsigned char token = *p++;
 490.500 -+
 490.501 -+				n = lz4cnt(&p, token >> 4);
 490.502 -+				size += n;
 490.503 -+				p += n;
 490.504 -+				if (p >= end_chunk) break;
 490.505 -+				p += sizeof(unsigned short);
 490.506 -+				size += 4 + lz4cnt(&p, token & 0xF);
 490.507 -+			}
 490.508 -+			else {
 490.509 -+				magic &= 0x7FffFFff;
 490.510 -+				p += magic;
 490.511 -+				size += magic;
 490.512 -+			}
 490.513 -+			mask = 0x10; /* Block checksum */
 490.514 -+		}
 490.515 -+		if (flags & mask) p += 4; /* skip block checksum */
 490.516 -+	}
 490.517 -+sizefound:
 490.518 -+	size += 16 - (p - from);
 490.519 -+	memmove(from + size, from, p - from);
 490.520 -+	for (to = from, p = from += size, end += size, flags = 0; p < end;) {
 490.521 -+		while (1) {
 490.522 -+			magic = * (long *) p;
 490.523 -+			p += sizeof(long);
 490.524 -+			if (magic == LZ4_LEGACY) continue;
 490.525 -+			if (magic != LZ4_MAGIC) break;
 490.526 -+			flags = *p;
 490.527 -+			if (flags & 8) p += 8; /* skip size */
 490.528 -+			p += 3; /* skip FLG BD HC */
 490.529 -+		}
 490.530 -+		if (LZ4_SKIP(magic)) {
 490.531 -+			p += 4 + * (long *) p;
 490.532 -+			continue;
 490.533 -+		}
 490.534 -+		mask = 4; /* Content checksum */
 490.535 -+		if (magic) {
 490.536 -+			if (magic > 0)
 490.537 -+			for (end_chunk = p + magic; p < end_chunk;) {
 490.538 -+				unsigned char *dico;
 490.539 -+				unsigned char token = *p++;
 490.540 -+
 490.541 -+				n = lz4cnt(&p, token >> 4);
 490.542 -+				for (i = 0; i < n; i++)
 490.543 -+					*to++ = *p++;
 490.544 -+				if (p >= end_chunk) break;
 490.545 -+				dico = to - (* (unsigned short *) p);
 490.546 -+				p += sizeof(unsigned short);
 490.547 -+				n = 4 + lz4cnt(&p, token & 0xF);
 490.548 -+				for (i = 0; i < n; i++)
 490.549 -+					*to++ = *dico++;
 490.550 -+			}
 490.551 -+			else for (end_chunk = p + (magic & 0x7FffFFff);
 490.552 -+				  p < end_chunk;) {
 490.553 -+				*to++ = *p++;
 490.554 -+			}
 490.555 -+			mask = 0x10; /* Block checksum */
 490.556 -+		}
 490.557 -+		if (flags & mask) p += 4; /* Skip checksum */
 490.558 -+	}
 490.559 -+	return to;
 490.560 -+}
   491.1 --- a/syslinux/stuff/extra/readconfig.u	Wed May 09 17:03:28 2018 +0300
   491.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   491.3 @@ -1,42 +0,0 @@
   491.4 ---- com32/menu/readconfig.c
   491.5 -+++ com32/menu/readconfig.c
   491.6 -@@ -23,6 +23,7 @@
   491.7 - #include <com32.h>
   491.8 - #include <syslinux/adv.h>
   491.9 - #include <syslinux/config.h>
  491.10 -+#include <syslinux/disk.h>
  491.11 - 
  491.12 - #include "menu.h"
  491.13 - 
  491.14 -@@ -874,6 +875,31 @@
  491.15 - 		}
  491.16 - 	    } else if (looking_at(p, "start")) {
  491.17 - 		start_menu = m;
  491.18 -+	    } else if ((ep = looking_at(p, "startifnoarg"))) {
  491.19 -+		const union syslinux_derivative_info *sdi;
  491.20 -+		int custom = 0;
  491.21 -+	    	size_t size;
  491.22 -+	    	int slot;
  491.23 -+		sdi = syslinux_derivative_info();
  491.24 -+		if (sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) {
  491.25 -+			struct disk_info diskinfo;
  491.26 -+			char *custom_buffer;
  491.27 -+			int got_config;
  491.28 -+
  491.29 -+			disk_get_params(sdi->iso.drive_number, &diskinfo);
  491.30 -+			custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1);
  491.31 -+			got_config = (*(unsigned long *) (custom_buffer + 80))
  491.32 -+				* 2048 / diskinfo.bps;
  491.33 -+			free(custom_buffer);
  491.34 -+			custom_buffer = disk_read_sectors(&diskinfo, got_config, 1);
  491.35 -+			if (!memcmp(custom_buffer,"#!boot ",7)) {
  491.36 -+				custom++;
  491.37 -+			}
  491.38 -+			free(custom_buffer);
  491.39 -+		}
  491.40 -+	    	slot = strtoul(ep, &ep, 0);
  491.41 -+	    	if (!custom && !syslinux_getadv(slot, &size))
  491.42 -+			start_menu = m;
  491.43 - 	    } else if (looking_at(p, "help")) {
  491.44 - 		if (ld.label) {
  491.45 - 		    ld.action = MA_HELP;
   492.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   492.2 +++ b/syslinux/stuff/patches/iso9660.u	Thu May 10 21:12:00 2018 +0300
   492.3 @@ -0,0 +1,74 @@
   492.4 +--- core/fs/iso9660/iso9660.c
   492.5 ++++ core/fs/iso9660/iso9660.c
   492.6 +@@ -89,6 +89,24 @@
   492.7 +     return true;
   492.8 + }
   492.9 + 
  492.10 ++#define __ROCKRIDGE
  492.11 ++#ifdef __ROCKRIDGE
  492.12 ++static size_t rockname(const struct iso_dir_entry *de, char **name)
  492.13 ++{
  492.14 ++	size_t len, delen, n = (de->name_len + 34) & -2;
  492.15 ++	char *data = (char *) de;
  492.16 ++	
  492.17 ++	for (delen = 0; n + 2 < de->length; n += len) {
  492.18 ++		len = data[n + 2];
  492.19 ++		if (* (short *) (data + n) == 0x4D4E) { /* NM */
  492.20 ++			*name = data + n + 5;
  492.21 ++			delen = len - 5;
  492.22 ++		}
  492.23 ++	}
  492.24 ++	return delen;
  492.25 ++}
  492.26 ++#endif
  492.27 ++
  492.28 + /*
  492.29 +  * Find a entry in the specified dir with name _dname_.
  492.30 +  */
  492.31 +@@ -132,6 +150,20 @@
  492.32 + 	
  492.33 + 	de_name_len = de->name_len;
  492.34 + 	de_name = de->name;
  492.35 ++#ifdef __ROCKRIDGE
  492.36 ++	{
  492.37 ++		char *name;
  492.38 ++		size_t len = rockname(de, &name);
  492.39 ++
  492.40 ++		if (len) {
  492.41 ++			name[len] = 0;
  492.42 ++			if (!strcmp(name, dname)) {
  492.43 ++				dprintf("Found rockridge.\n");
  492.44 ++				return de;
  492.45 ++			}
  492.46 ++		}
  492.47 ++	}
  492.48 ++#endif
  492.49 + 	if (iso_compare_name(de_name, de_name_len, dname)) {
  492.50 + 	    dprintf("Found.\n");
  492.51 + 	    return de;
  492.52 +@@ -217,11 +249,22 @@
  492.53 +     dirent->d_ino = 0;           /* Inode number is invalid to ISO fs */
  492.54 +     dirent->d_off = file->offset;
  492.55 +     dirent->d_type = get_inode_mode(de->flags);
  492.56 +-    dirent->d_reclen = offsetof(struct dirent, d_name) + 1 +
  492.57 +-	iso_convert_name(dirent->d_name, de->name, de->name_len);
  492.58 ++    iso_convert_name(dirent->d_name, de->name, de->name_len);
  492.59 + 
  492.60 ++#ifdef __ROCKRIDGE
  492.61 ++	{
  492.62 ++		char *name;
  492.63 ++		size_t len = rockname(de, &name);
  492.64 ++
  492.65 ++		if (len) {
  492.66 ++			strcpy(dirent->d_name, name);
  492.67 ++			dirent->d_name[len] = 0;
  492.68 ++		}
  492.69 ++	}
  492.70 ++#endif
  492.71 ++    dirent->d_reclen = offsetof(struct dirent, d_name) + 1 + strlen(dirent->d_name);
  492.72 +     file->offset += de->length;  /* Update for next reading */
  492.73 +-    
  492.74 ++
  492.75 +     return 0;
  492.76 + }
  492.77 + 
   493.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   493.2 +++ b/syslinux/stuff/patches/keytab-lilo.u	Thu May 10 21:12:00 2018 +0300
   493.3 @@ -0,0 +1,15 @@
   493.4 +kbd 2.0.3 support
   493.5 +--- utils/keytab-lilo
   493.6 ++++ utils/keytab-lilo
   493.7 +@@ -48,9 +48,9 @@
   493.8 +     $empty = 1;
   493.9 +     while (<FILE>) {
  493.10 + 	chop;
  493.11 +-	if (/^(static\s+)?u_short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
  493.12 ++	if (/^(static\s+)?(u_|unsigned )short\s+(\S+)_map\[\S*\]\s+=\s+{\s*$/) {
  493.13 + 	    die "active at beginning of map" if defined $current;
  493.14 +-	    $current = $pfx.":".$2;
  493.15 ++	    $current = $pfx.":".$3;
  493.16 + 	    next;
  493.17 + 	}
  493.18 + 	undef $current if /^};\s*$/;
   494.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   494.2 +++ b/syslinux/stuff/patches/loadhigh.u	Thu May 10 21:12:00 2018 +0300
   494.3 @@ -0,0 +1,557 @@
   494.4 +--- core/fs/loadhigh.c
   494.5 ++++ core/fs/loadhigh.c
   494.6 +@@ -36,6 +36,11 @@
   494.7 + #include <minmax.h>
   494.8 + #include "core.h"
   494.9 + #include "fs.h"
  494.10 ++#define LZLOAD	".c32 modules can be compressed with lz4 or lzma"
  494.11 ++#ifdef LZLOAD
  494.12 ++#include "../unlz4.c"
  494.13 ++#include "../unlzma.c"
  494.14 ++#endif
  494.15 + 
  494.16 + #define MAX_CHUNK	(1 << 20) /* 1 MB */
  494.17 + 
  494.18 +@@ -51,6 +56,9 @@
  494.19 +     uint32_t sector_mask;
  494.20 +     size_t pad;
  494.21 +     uint32_t retflags = 0;
  494.22 ++#ifdef LZLOAD
  494.23 ++    char *unpacked = (char *) regs->edi.l;
  494.24 ++#endif
  494.25 + 
  494.26 +     bytes     = regs->eax.l;
  494.27 +     zero_mask = regs->edx.w[0];
  494.28 +@@ -101,6 +109,27 @@
  494.29 + 	    break;
  494.30 + 	}
  494.31 +     }
  494.32 ++
  494.33 ++#ifdef LZLOAD
  494.34 ++    switch (* (short *) unpacked) {
  494.35 ++	char *packed;
  494.36 ++	size_t packedsz, unpackedsz;
  494.37 ++    case 0x005D:
  494.38 ++  	packedsz = buf - unpacked;
  494.39 ++	unpackedsz = * (unsigned long *) (unpacked + 5);
  494.40 ++	if (unpackedsz > 1000000) break; /* no size? */
  494.41 ++	packed = unpacked + unpackedsz - packedsz + 1024;
  494.42 ++	if (packed < unpacked + 1024) packed = unpacked + 1024;
  494.43 ++	memmove(packed, unpacked, packedsz);
  494.44 ++	unlzma(packed, unpacked, packed + packedsz /* heap */);
  494.45 ++	buf = packed;
  494.46 ++	break;
  494.47 ++    case 0x2204:
  494.48 ++    case 0x2102:
  494.49 ++	buf = (char *) unlz4((unsigned char *) unpacked, (unsigned char *) buf);
  494.50 ++	break;
  494.51 ++    }
  494.52 ++#endif
  494.53 + 
  494.54 +     pad = (size_t)buf & zero_mask;
  494.55 +     if (pad)
  494.56 +--- /dev/null
  494.57 ++++ core/unlzma.c
  494.58 +@@ -0,0 +1,385 @@
  494.59 ++typedef unsigned char uint8_t;
  494.60 ++typedef unsigned short uint16_t;
  494.61 ++typedef unsigned uint32_t;
  494.62 ++typedef unsigned long long uint64_t;
  494.63 ++typedef unsigned size_t;
  494.64 ++#define SWAP_LE32(x)	(x)
  494.65 ++#define SWAP_LE64(x)	(x)
  494.66 ++/* vi: set sw=4 ts=4: */
  494.67 ++/*
  494.68 ++ * Small lzma deflate implementation.
  494.69 ++ * Copyright (C) 2006  Aurelien Jacobs <aurel@gnuage.org>
  494.70 ++ *
  494.71 ++ * Based on LzmaDecode.c from the LZMA SDK 4.22 (http://www.7-zip.org/)
  494.72 ++ * Copyright (C) 1999-2005  Igor Pavlov
  494.73 ++ *
  494.74 ++ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  494.75 ++ */
  494.76 ++
  494.77 ++#include <string.h>
  494.78 ++
  494.79 ++#define PACKED __attribute__ ((packed))
  494.80 ++#define ALWAYS_INLINE inline
  494.81 ++#define speed_inline
  494.82 ++#define size_inline ALWAYS_INLINE
  494.83 ++
  494.84 ++
  494.85 ++typedef struct {
  494.86 ++	uint8_t *ptr;
  494.87 ++
  494.88 ++	uint32_t code;
  494.89 ++	uint32_t range;
  494.90 ++	uint32_t bound;
  494.91 ++} rc_t;
  494.92 ++
  494.93 ++#define RC_TOP_BITS 24
  494.94 ++#define RC_MOVE_BITS 5
  494.95 ++#define RC_MODEL_TOTAL_BITS 11
  494.96 ++
  494.97 ++/* Called twice, but one callsite is in speed_inline'd rc_is_bit_1() */
  494.98 ++static void rc_do_normalize(rc_t *rc)
  494.99 ++{
 494.100 ++	rc->range <<= 8;
 494.101 ++	rc->code = (rc->code << 8) | *rc->ptr++;
 494.102 ++}
 494.103 ++
 494.104 ++static ALWAYS_INLINE void rc_normalize(rc_t *rc)
 494.105 ++{
 494.106 ++	if (rc->range < (1 << RC_TOP_BITS)) {
 494.107 ++		rc_do_normalize(rc);
 494.108 ++	}
 494.109 ++}
 494.110 ++
 494.111 ++/* Called once */
 494.112 ++static void rc_init(rc_t *rc) /*, int buffer_size) */
 494.113 ++{
 494.114 ++	int i;
 494.115 ++
 494.116 ++	rc->range = 0;
 494.117 ++	for (i = 0; i < 5; i++) {
 494.118 ++		rc_do_normalize(rc);
 494.119 ++	}
 494.120 ++	rc->range = 0xffffffff;
 494.121 ++}
 494.122 ++
 494.123 ++/* rc_is_bit_1 is called 9 times */
 494.124 ++static speed_inline int rc_is_bit_1(rc_t *rc, uint16_t *p)
 494.125 ++{
 494.126 ++	rc_normalize(rc);
 494.127 ++	rc->bound = *p * (rc->range >> RC_MODEL_TOTAL_BITS);
 494.128 ++	if (rc->code < rc->bound) {
 494.129 ++		rc->range = rc->bound;
 494.130 ++		*p += ((1 << RC_MODEL_TOTAL_BITS) - *p) >> RC_MOVE_BITS;
 494.131 ++		return 0;
 494.132 ++	}
 494.133 ++	rc->range -= rc->bound;
 494.134 ++	rc->code -= rc->bound;
 494.135 ++	*p -= *p >> RC_MOVE_BITS;
 494.136 ++	return 1;
 494.137 ++}
 494.138 ++
 494.139 ++/* Called 4 times in unlzma loop */
 494.140 ++static ALWAYS_INLINE int rc_get_bit(rc_t *rc, uint16_t *p, int *symbol)
 494.141 ++{
 494.142 ++	int ret = rc_is_bit_1(rc, p);
 494.143 ++	*symbol = *symbol * 2 + ret;
 494.144 ++	return ret;
 494.145 ++}
 494.146 ++
 494.147 ++/* Called once */
 494.148 ++static ALWAYS_INLINE int rc_direct_bit(rc_t *rc)
 494.149 ++{
 494.150 ++	rc_normalize(rc);
 494.151 ++	rc->range >>= 1;
 494.152 ++	if (rc->code >= rc->range) {
 494.153 ++		rc->code -= rc->range;
 494.154 ++		return 1;
 494.155 ++	}
 494.156 ++	return 0;
 494.157 ++}
 494.158 ++
 494.159 ++/* Called twice */
 494.160 ++static speed_inline void
 494.161 ++rc_bit_tree_decode(rc_t *rc, uint16_t *p, int num_levels, int *symbol)
 494.162 ++{
 494.163 ++	int i = num_levels;
 494.164 ++
 494.165 ++	*symbol = 1;
 494.166 ++	while (i--)
 494.167 ++		rc_get_bit(rc, p + *symbol, symbol);
 494.168 ++	*symbol -= 1 << num_levels;
 494.169 ++}
 494.170 ++
 494.171 ++
 494.172 ++typedef struct {
 494.173 ++	uint8_t pos;
 494.174 ++	uint32_t dict_size;
 494.175 ++	uint64_t dst_size;
 494.176 ++} PACKED lzma_header_t;
 494.177 ++
 494.178 ++
 494.179 ++/* #defines will force compiler to compute/optimize each one with each usage.
 494.180 ++ * Have heart and use enum instead. */
 494.181 ++enum {
 494.182 ++	LZMA_BASE_SIZE = 1846,
 494.183 ++	LZMA_LIT_SIZE  = 768,
 494.184 ++
 494.185 ++	LZMA_NUM_POS_BITS_MAX = 4,
 494.186 ++
 494.187 ++	LZMA_LEN_NUM_LOW_BITS  = 3,
 494.188 ++	LZMA_LEN_NUM_MID_BITS  = 3,
 494.189 ++	LZMA_LEN_NUM_HIGH_BITS = 8,
 494.190 ++
 494.191 ++	LZMA_LEN_CHOICE     = 0,
 494.192 ++	LZMA_LEN_CHOICE_2   = (LZMA_LEN_CHOICE + 1),
 494.193 ++	LZMA_LEN_LOW        = (LZMA_LEN_CHOICE_2 + 1),
 494.194 ++	LZMA_LEN_MID        = (LZMA_LEN_LOW \
 494.195 ++	                      + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_LOW_BITS))),
 494.196 ++	LZMA_LEN_HIGH       = (LZMA_LEN_MID \
 494.197 ++	                      + (1 << (LZMA_NUM_POS_BITS_MAX + LZMA_LEN_NUM_MID_BITS))),
 494.198 ++	LZMA_NUM_LEN_PROBS  = (LZMA_LEN_HIGH + (1 << LZMA_LEN_NUM_HIGH_BITS)),
 494.199 ++
 494.200 ++	LZMA_NUM_STATES     = 12,
 494.201 ++	LZMA_NUM_LIT_STATES = 7,
 494.202 ++
 494.203 ++	LZMA_START_POS_MODEL_INDEX = 4,
 494.204 ++	LZMA_END_POS_MODEL_INDEX   = 14,
 494.205 ++	LZMA_NUM_FULL_DISTANCES    = (1 << (LZMA_END_POS_MODEL_INDEX >> 1)),
 494.206 ++
 494.207 ++	LZMA_NUM_POS_SLOT_BITS = 6,
 494.208 ++	LZMA_NUM_LEN_TO_POS_STATES = 4,
 494.209 ++
 494.210 ++	LZMA_NUM_ALIGN_BITS = 4,
 494.211 ++
 494.212 ++	LZMA_MATCH_MIN_LEN  = 2,
 494.213 ++
 494.214 ++	LZMA_IS_MATCH       = 0,
 494.215 ++	LZMA_IS_REP         = (LZMA_IS_MATCH + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),
 494.216 ++	LZMA_IS_REP_G0      = (LZMA_IS_REP + LZMA_NUM_STATES),
 494.217 ++	LZMA_IS_REP_G1      = (LZMA_IS_REP_G0 + LZMA_NUM_STATES),
 494.218 ++	LZMA_IS_REP_G2      = (LZMA_IS_REP_G1 + LZMA_NUM_STATES),
 494.219 ++	LZMA_IS_REP_0_LONG  = (LZMA_IS_REP_G2 + LZMA_NUM_STATES),
 494.220 ++	LZMA_POS_SLOT       = (LZMA_IS_REP_0_LONG \
 494.221 ++	                      + (LZMA_NUM_STATES << LZMA_NUM_POS_BITS_MAX)),
 494.222 ++	LZMA_SPEC_POS       = (LZMA_POS_SLOT \
 494.223 ++	                      + (LZMA_NUM_LEN_TO_POS_STATES << LZMA_NUM_POS_SLOT_BITS)),
 494.224 ++	LZMA_ALIGN          = (LZMA_SPEC_POS \
 494.225 ++	                      + LZMA_NUM_FULL_DISTANCES - LZMA_END_POS_MODEL_INDEX),
 494.226 ++	LZMA_LEN_CODER      = (LZMA_ALIGN + (1 << LZMA_NUM_ALIGN_BITS)),
 494.227 ++	LZMA_REP_LEN_CODER  = (LZMA_LEN_CODER + LZMA_NUM_LEN_PROBS),
 494.228 ++	LZMA_LITERAL        = (LZMA_REP_LEN_CODER + LZMA_NUM_LEN_PROBS),
 494.229 ++};
 494.230 ++
 494.231 ++
 494.232 ++void unlzma(char *from, char *to, char *heap)
 494.233 ++{
 494.234 ++	lzma_header_t header;
 494.235 ++	int lc, pb, lp;
 494.236 ++	uint32_t pos_state_mask;
 494.237 ++	uint32_t literal_pos_mask;
 494.238 ++	uint16_t *p;
 494.239 ++	rc_t *rc = (rc_t *) heap;
 494.240 ++	int i;
 494.241 ++	uint8_t *buffer = (void *) to;
 494.242 ++	uint8_t previous_byte = 0;
 494.243 ++	size_t buffer_pos = 0;
 494.244 ++	int len = 0;
 494.245 ++	int state = 0;
 494.246 ++	uint32_t rep0 = 1, rep1 = 1, rep2 = 1, rep3 = 1;
 494.247 ++
 494.248 ++	memcpy(&header, from, sizeof(header));
 494.249 ++	from += sizeof(header);
 494.250 ++	heap += sizeof(*rc);
 494.251 ++	rc->ptr = (void *) from;
 494.252 ++
 494.253 ++	i = header.pos / 9;
 494.254 ++	lc = header.pos % 9;
 494.255 ++	pb = i / 5;
 494.256 ++	lp = i % 5;
 494.257 ++	pos_state_mask = (1 << pb) - 1;
 494.258 ++	literal_pos_mask = (1 << lp) - 1;
 494.259 ++
 494.260 ++	/* Example values from linux-3.3.4.tar.lzma:
 494.261 ++	 * dict_size: 64M, dst_size: 2^64-1
 494.262 ++	 */
 494.263 ++	header.dict_size = SWAP_LE32(header.dict_size);
 494.264 ++	header.dst_size = SWAP_LE64(header.dst_size);
 494.265 ++
 494.266 ++	//if (header.dict_size == 0)
 494.267 ++	//	header.dict_size++;
 494.268 ++
 494.269 ++	rc_init(rc);
 494.270 ++
 494.271 ++	{
 494.272 ++		int num_probs;
 494.273 ++
 494.274 ++		num_probs = LZMA_BASE_SIZE + (LZMA_LIT_SIZE << (lc + lp));
 494.275 ++		//p = xmalloc(num_probs * sizeof(*p));
 494.276 ++		p = (void *) heap;
 494.277 ++		num_probs += LZMA_LITERAL - LZMA_BASE_SIZE;
 494.278 ++		for (i = 0; i < num_probs; i++)
 494.279 ++			p[i] = (1 << RC_MODEL_TOTAL_BITS) >> 1;
 494.280 ++	}
 494.281 ++
 494.282 ++
 494.283 ++	while (buffer_pos < header.dst_size) {
 494.284 ++		int pos_state = buffer_pos & pos_state_mask;
 494.285 ++		uint16_t *prob = p + LZMA_IS_MATCH + (state << LZMA_NUM_POS_BITS_MAX) + pos_state;
 494.286 ++
 494.287 ++		if (!rc_is_bit_1(rc, prob)) {
 494.288 ++			static const char next_state[LZMA_NUM_STATES] =
 494.289 ++				{ 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5 };
 494.290 ++			int mi = 1;
 494.291 ++
 494.292 ++			prob = (p + LZMA_LITERAL
 494.293 ++			        + (LZMA_LIT_SIZE * (((buffer_pos & literal_pos_mask) << lc)
 494.294 ++			                            + (previous_byte >> (8 - lc))
 494.295 ++			                           )
 494.296 ++			          )
 494.297 ++			);
 494.298 ++
 494.299 ++			if (state >= LZMA_NUM_LIT_STATES) {
 494.300 ++				int match_byte;
 494.301 ++				uint32_t pos = buffer_pos - rep0;
 494.302 ++
 494.303 ++				while (pos >= header.dict_size)
 494.304 ++					pos += header.dict_size;
 494.305 ++				match_byte = buffer[pos];
 494.306 ++				do {
 494.307 ++					int bit;
 494.308 ++
 494.309 ++					match_byte <<= 1;
 494.310 ++					bit = match_byte & 0x100;
 494.311 ++					bit ^= (rc_get_bit(rc, prob + 0x100 + bit + mi, &mi) << 8); /* 0x100 or 0 */
 494.312 ++					if (bit)
 494.313 ++						break;
 494.314 ++				} while (mi < 0x100);
 494.315 ++			}
 494.316 ++			while (mi < 0x100) {
 494.317 ++				rc_get_bit(rc, prob + mi, &mi);
 494.318 ++			}
 494.319 ++
 494.320 ++			state = next_state[state];
 494.321 ++
 494.322 ++			previous_byte = (uint8_t) mi;
 494.323 ++			len = 1;
 494.324 ++			goto one_byte2;
 494.325 ++		} else {
 494.326 ++			int num_bits;
 494.327 ++			int offset;
 494.328 ++			uint16_t *prob2;
 494.329 ++#define prob_len prob2
 494.330 ++
 494.331 ++			prob2 = p + LZMA_IS_REP + state;
 494.332 ++			if (!rc_is_bit_1(rc, prob2)) {
 494.333 ++				rep3 = rep2;
 494.334 ++				rep2 = rep1;
 494.335 ++				rep1 = rep0;
 494.336 ++				state = state < LZMA_NUM_LIT_STATES ? 0 : 3;
 494.337 ++				prob2 = p + LZMA_LEN_CODER;
 494.338 ++			} else {
 494.339 ++				prob2 += LZMA_IS_REP_G0 - LZMA_IS_REP;
 494.340 ++				if (!rc_is_bit_1(rc, prob2)) {
 494.341 ++					prob2 = (p + LZMA_IS_REP_0_LONG
 494.342 ++					        + (state << LZMA_NUM_POS_BITS_MAX)
 494.343 ++					        + pos_state
 494.344 ++					);
 494.345 ++					if (!rc_is_bit_1(rc, prob2)) {
 494.346 ++						state = state < LZMA_NUM_LIT_STATES ? 9 : 11;
 494.347 ++						len = 1;
 494.348 ++						goto string;
 494.349 ++					}
 494.350 ++				} else {
 494.351 ++					uint32_t distance;
 494.352 ++
 494.353 ++					prob2 += LZMA_IS_REP_G1 - LZMA_IS_REP_G0;
 494.354 ++					distance = rep1;
 494.355 ++					if (rc_is_bit_1(rc, prob2)) {
 494.356 ++						prob2 += LZMA_IS_REP_G2 - LZMA_IS_REP_G1;
 494.357 ++						distance = rep2;
 494.358 ++						if (rc_is_bit_1(rc, prob2)) {
 494.359 ++							distance = rep3;
 494.360 ++							rep3 = rep2;
 494.361 ++						}
 494.362 ++						rep2 = rep1;
 494.363 ++					}
 494.364 ++					rep1 = rep0;
 494.365 ++					rep0 = distance;
 494.366 ++				}
 494.367 ++				state = state < LZMA_NUM_LIT_STATES ? 8 : 11;
 494.368 ++				prob2 = p + LZMA_REP_LEN_CODER;
 494.369 ++			}
 494.370 ++
 494.371 ++			prob_len = prob2 + LZMA_LEN_CHOICE;
 494.372 ++			num_bits = LZMA_LEN_NUM_LOW_BITS;
 494.373 ++			if (!rc_is_bit_1(rc, prob_len)) {
 494.374 ++				prob_len += LZMA_LEN_LOW - LZMA_LEN_CHOICE
 494.375 ++				            + (pos_state << LZMA_LEN_NUM_LOW_BITS);
 494.376 ++				offset = 0;
 494.377 ++			} else {
 494.378 ++				prob_len += LZMA_LEN_CHOICE_2 - LZMA_LEN_CHOICE;
 494.379 ++				if (!rc_is_bit_1(rc, prob_len)) {
 494.380 ++					prob_len += LZMA_LEN_MID - LZMA_LEN_CHOICE_2
 494.381 ++					            + (pos_state << LZMA_LEN_NUM_MID_BITS);
 494.382 ++					offset = 1 << LZMA_LEN_NUM_LOW_BITS;
 494.383 ++					num_bits += LZMA_LEN_NUM_MID_BITS - LZMA_LEN_NUM_LOW_BITS;
 494.384 ++				} else {
 494.385 ++					prob_len += LZMA_LEN_HIGH - LZMA_LEN_CHOICE_2;
 494.386 ++					offset = ((1 << LZMA_LEN_NUM_LOW_BITS)
 494.387 ++					          + (1 << LZMA_LEN_NUM_MID_BITS));
 494.388 ++					num_bits += LZMA_LEN_NUM_HIGH_BITS - LZMA_LEN_NUM_LOW_BITS;
 494.389 ++				}
 494.390 ++			}
 494.391 ++			rc_bit_tree_decode(rc, prob_len, num_bits, &len);
 494.392 ++			len += offset;
 494.393 ++
 494.394 ++			if (state < 4) {
 494.395 ++				int pos_slot;
 494.396 ++				uint16_t *prob3;
 494.397 ++
 494.398 ++				state += LZMA_NUM_LIT_STATES;
 494.399 ++				prob3 = p + LZMA_POS_SLOT +
 494.400 ++				       ((len < LZMA_NUM_LEN_TO_POS_STATES ? len :
 494.401 ++				         LZMA_NUM_LEN_TO_POS_STATES - 1)
 494.402 ++				         << LZMA_NUM_POS_SLOT_BITS);
 494.403 ++				rc_bit_tree_decode(rc, prob3,
 494.404 ++					LZMA_NUM_POS_SLOT_BITS, &pos_slot);
 494.405 ++				rep0 = pos_slot;
 494.406 ++				if (pos_slot >= LZMA_START_POS_MODEL_INDEX) {
 494.407 ++					int i2, mi2, num_bits2 = (pos_slot >> 1) - 1;
 494.408 ++					rep0 = 2 | (pos_slot & 1);
 494.409 ++					if (pos_slot < LZMA_END_POS_MODEL_INDEX) {
 494.410 ++						rep0 <<= num_bits2;
 494.411 ++						prob3 = p + LZMA_SPEC_POS + rep0 - pos_slot - 1;
 494.412 ++					} else {
 494.413 ++						for (; num_bits2 != LZMA_NUM_ALIGN_BITS; num_bits2--)
 494.414 ++							rep0 = (rep0 << 1) | rc_direct_bit(rc);
 494.415 ++						rep0 <<= LZMA_NUM_ALIGN_BITS;
 494.416 ++						prob3 = p + LZMA_ALIGN;
 494.417 ++					}
 494.418 ++					i2 = 1;
 494.419 ++					mi2 = 1;
 494.420 ++					while (num_bits2--) {
 494.421 ++						if (rc_get_bit(rc, prob3 + mi2, &mi2))
 494.422 ++							rep0 |= i2;
 494.423 ++						i2 <<= 1;
 494.424 ++					}
 494.425 ++				}
 494.426 ++				if (++rep0 == 0)
 494.427 ++					break;
 494.428 ++			}
 494.429 ++
 494.430 ++			len += LZMA_MATCH_MIN_LEN;
 494.431 ++ string:
 494.432 ++			do {
 494.433 ++				uint32_t pos = buffer_pos - rep0;
 494.434 ++				while (pos >= header.dict_size)
 494.435 ++					pos += header.dict_size;
 494.436 ++				previous_byte = buffer[pos];
 494.437 ++ one_byte2:
 494.438 ++				buffer[buffer_pos++] = previous_byte;
 494.439 ++				len--;
 494.440 ++			} while (len != 0 && buffer_pos < header.dst_size);
 494.441 ++		}
 494.442 ++	}
 494.443 ++}
 494.444 +--- /dev/null
 494.445 ++++ core/unlz4.c
 494.446 +@@ -0,0 +1,114 @@
 494.447 ++/*
 494.448 ++ * Copyright (C) 2015, pascal.bellard@slitaz.org
 494.449 ++ *
 494.450 ++ * This program is free software; you can redistribute it and/or modify
 494.451 ++ * it under the terms of the GNU General Public License version 2 as
 494.452 ++ * published by the Free Software Foundation.
 494.453 ++ */
 494.454 ++
 494.455 ++#include <string.h>
 494.456 ++
 494.457 ++#define LZ4_MAGIC	0x184D2204	/* Spec 1.5.0 */
 494.458 ++#define LZ4_LEGACY	0x184C2102
 494.459 ++#define LZ4_SKIP(n)	((((n) - 0x184D2A50) >> 4) == 0)
 494.460 ++
 494.461 ++static unsigned lz4cnt(unsigned char **p, unsigned n)
 494.462 ++{
 494.463 ++	int i;
 494.464 ++
 494.465 ++	if (n == 0xF) do {
 494.466 ++		i = *(*p)++;
 494.467 ++		n += i;
 494.468 ++	} while (i == 0xFF);
 494.469 ++	return n;
 494.470 ++}
 494.471 ++
 494.472 ++unsigned char *unlz4(unsigned char *from, unsigned char *end)
 494.473 ++{
 494.474 ++	unsigned char *p, *end_chunk, *to, flags, mask;
 494.475 ++	long magic;
 494.476 ++	unsigned i, n, size;
 494.477 ++
 494.478 ++	for (p = from, flags = size = 0; p < end;) {
 494.479 ++		while (1) {
 494.480 ++			magic = * (long *) p;
 494.481 ++			p += sizeof(long);
 494.482 ++			if (magic == LZ4_LEGACY) continue;
 494.483 ++			if (magic != LZ4_MAGIC) break;
 494.484 ++			flags = *p;
 494.485 ++			if (flags & 8) {
 494.486 ++				size = * (unsigned *) (p + 2);
 494.487 ++				goto sizefound;
 494.488 ++			}
 494.489 ++			p += 3; /* skip FLG BD HC */
 494.490 ++		}
 494.491 ++		if (LZ4_SKIP(magic)) {
 494.492 ++			p += 4 + * (long *) p;
 494.493 ++			continue;
 494.494 ++		}
 494.495 ++		mask = 4; /* Content checksum */
 494.496 ++		if (magic) {
 494.497 ++			if (magic > 0)
 494.498 ++			for (end_chunk = p + magic; p < end_chunk;) {
 494.499 ++				unsigned char token = *p++;
 494.500 ++
 494.501 ++				n = lz4cnt(&p, token >> 4);
 494.502 ++				size += n;
 494.503 ++				p += n;
 494.504 ++				if (p >= end_chunk) break;
 494.505 ++				p += sizeof(unsigned short);
 494.506 ++				size += 4 + lz4cnt(&p, token & 0xF);
 494.507 ++			}
 494.508 ++			else {
 494.509 ++				magic &= 0x7FffFFff;
 494.510 ++				p += magic;
 494.511 ++				size += magic;
 494.512 ++			}
 494.513 ++			mask = 0x10; /* Block checksum */
 494.514 ++		}
 494.515 ++		if (flags & mask) p += 4; /* skip block checksum */
 494.516 ++	}
 494.517 ++sizefound:
 494.518 ++	size += 16 - (p - from);
 494.519 ++	memmove(from + size, from, p - from);
 494.520 ++	for (to = from, p = from += size, end += size, flags = 0; p < end;) {
 494.521 ++		while (1) {
 494.522 ++			magic = * (long *) p;
 494.523 ++			p += sizeof(long);
 494.524 ++			if (magic == LZ4_LEGACY) continue;
 494.525 ++			if (magic != LZ4_MAGIC) break;
 494.526 ++			flags = *p;
 494.527 ++			if (flags & 8) p += 8; /* skip size */
 494.528 ++			p += 3; /* skip FLG BD HC */
 494.529 ++		}
 494.530 ++		if (LZ4_SKIP(magic)) {
 494.531 ++			p += 4 + * (long *) p;
 494.532 ++			continue;
 494.533 ++		}
 494.534 ++		mask = 4; /* Content checksum */
 494.535 ++		if (magic) {
 494.536 ++			if (magic > 0)
 494.537 ++			for (end_chunk = p + magic; p < end_chunk;) {
 494.538 ++				unsigned char *dico;
 494.539 ++				unsigned char token = *p++;
 494.540 ++
 494.541 ++				n = lz4cnt(&p, token >> 4);
 494.542 ++				for (i = 0; i < n; i++)
 494.543 ++					*to++ = *p++;
 494.544 ++				if (p >= end_chunk) break;
 494.545 ++				dico = to - (* (unsigned short *) p);
 494.546 ++				p += sizeof(unsigned short);
 494.547 ++				n = 4 + lz4cnt(&p, token & 0xF);
 494.548 ++				for (i = 0; i < n; i++)
 494.549 ++					*to++ = *dico++;
 494.550 ++			}
 494.551 ++			else for (end_chunk = p + (magic & 0x7FffFFff);
 494.552 ++				  p < end_chunk;) {
 494.553 ++				*to++ = *p++;
 494.554 ++			}
 494.555 ++			mask = 0x10; /* Block checksum */
 494.556 ++		}
 494.557 ++		if (flags & mask) p += 4; /* Skip checksum */
 494.558 ++	}
 494.559 ++	return to;
 494.560 ++}
   495.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   495.2 +++ b/syslinux/stuff/patches/readconfig.u	Thu May 10 21:12:00 2018 +0300
   495.3 @@ -0,0 +1,42 @@
   495.4 +--- com32/menu/readconfig.c
   495.5 ++++ com32/menu/readconfig.c
   495.6 +@@ -23,6 +23,7 @@
   495.7 + #include <com32.h>
   495.8 + #include <syslinux/adv.h>
   495.9 + #include <syslinux/config.h>
  495.10 ++#include <syslinux/disk.h>
  495.11 + 
  495.12 + #include "menu.h"
  495.13 + 
  495.14 +@@ -874,6 +875,31 @@
  495.15 + 		}
  495.16 + 	    } else if (looking_at(p, "start")) {
  495.17 + 		start_menu = m;
  495.18 ++	    } else if ((ep = looking_at(p, "startifnoarg"))) {
  495.19 ++		const union syslinux_derivative_info *sdi;
  495.20 ++		int custom = 0;
  495.21 ++	    	size_t size;
  495.22 ++	    	int slot;
  495.23 ++		sdi = syslinux_derivative_info();
  495.24 ++		if (sdi->c.filesystem == SYSLINUX_FS_ISOLINUX) {
  495.25 ++			struct disk_info diskinfo;
  495.26 ++			char *custom_buffer;
  495.27 ++			int got_config;
  495.28 ++
  495.29 ++			disk_get_params(sdi->iso.drive_number, &diskinfo);
  495.30 ++			custom_buffer = disk_read_sectors(&diskinfo, 32768 / diskinfo.bps, 1);
  495.31 ++			got_config = (*(unsigned long *) (custom_buffer + 80))
  495.32 ++				* 2048 / diskinfo.bps;
  495.33 ++			free(custom_buffer);
  495.34 ++			custom_buffer = disk_read_sectors(&diskinfo, got_config, 1);
  495.35 ++			if (!memcmp(custom_buffer,"#!boot ",7)) {
  495.36 ++				custom++;
  495.37 ++			}
  495.38 ++			free(custom_buffer);
  495.39 ++		}
  495.40 ++	    	slot = strtoul(ep, &ep, 0);
  495.41 ++	    	if (!custom && !syslinux_getadv(slot, &size))
  495.42 ++			start_menu = m;
  495.43 + 	    } else if (looking_at(p, "help")) {
  495.44 + 		if (ld.label) {
  495.45 + 		    ld.action = MA_HELP;
   496.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   496.2 +++ b/syslinux/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   496.3 @@ -0,0 +1,4 @@
   496.4 +-p0|loadhigh.u
   496.5 +-p0|iso9660.u
   496.6 +-p0|readconfig.u
   496.7 +-p0|keytab-lilo.u
   497.1 --- a/thttpd/receipt	Wed May 09 17:03:28 2018 +0300
   497.2 +++ b/thttpd/receipt	Thu May 10 21:12:00 2018 +0300
   497.3 @@ -15,8 +15,6 @@
   497.4  # Rules to configure and make the package.
   497.5  compile_rules()
   497.6  {
   497.7 -	cd $src
   497.8 -	patch -p1 -i $stuff/htpassword.c.u || exit 1
   497.9  	./configure \
  497.10  		--prefix=/usr \
  497.11  		--infodir=/usr/share/info \
   498.1 --- a/thttpd/stuff/htpassword.c.u	Wed May 09 17:03:28 2018 +0300
   498.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   498.3 @@ -1,20 +0,0 @@
   498.4 ---- thttpd-2.25b-ori/extras/htpasswd.c	Wed Dec 19 01:08:08 2001
   498.5 -+++ thttpd-2.25b/extras/htpasswd.c	Sun Feb 28 23:02:36 2010
   498.6 -@@ -49,7 +49,7 @@
   498.7 -     while((line[y++] = line[x++]));
   498.8 - }
   498.9 - 
  498.10 --static int getline(char *s, int n, FILE *f) {
  498.11 -+static int xgetline(char *s, int n, FILE *f) {
  498.12 -     register int i=0;
  498.13 - 
  498.14 -     while(1) {
  498.15 -@@ -189,7 +189,7 @@
  498.16 -     strcpy(user,argv[2]);
  498.17 - 
  498.18 -     found = 0;
  498.19 --    while(!(getline(line,MAX_STRING_LEN,f))) {
  498.20 -+    while(!(xgetline(line,MAX_STRING_LEN,f))) {
  498.21 -         if(found || (line[0] == '#') || (!line[0])) {
  498.22 -             putline(tfp,line);
  498.23 -             continue;
   499.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   499.2 +++ b/thttpd/stuff/patches/htpassword.c.u	Thu May 10 21:12:00 2018 +0300
   499.3 @@ -0,0 +1,20 @@
   499.4 +--- thttpd-2.25b-ori/extras/htpasswd.c	Wed Dec 19 01:08:08 2001
   499.5 ++++ thttpd-2.25b/extras/htpasswd.c	Sun Feb 28 23:02:36 2010
   499.6 +@@ -49,7 +49,7 @@
   499.7 +     while((line[y++] = line[x++]));
   499.8 + }
   499.9 + 
  499.10 +-static int getline(char *s, int n, FILE *f) {
  499.11 ++static int xgetline(char *s, int n, FILE *f) {
  499.12 +     register int i=0;
  499.13 + 
  499.14 +     while(1) {
  499.15 +@@ -189,7 +189,7 @@
  499.16 +     strcpy(user,argv[2]);
  499.17 + 
  499.18 +     found = 0;
  499.19 +-    while(!(getline(line,MAX_STRING_LEN,f))) {
  499.20 ++    while(!(xgetline(line,MAX_STRING_LEN,f))) {
  499.21 +         if(found || (line[0] == '#') || (!line[0])) {
  499.22 +             putline(tfp,line);
  499.23 +             continue;
   500.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   500.2 +++ b/thttpd/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   500.3 @@ -0,0 +1,1 @@
   500.4 +-p1|htpassword.c.u
   501.1 --- a/tinyproxy/receipt	Wed May 09 17:03:28 2018 +0300
   501.2 +++ b/tinyproxy/receipt	Thu May 10 21:12:00 2018 +0300
   501.3 @@ -12,8 +12,6 @@
   501.4  WGET_URL="https://banu.com/pub/$PACKAGE/${VERSION%.*}/$TARBALL"
   501.5  
   501.6  compile_rules() {
   501.7 -	patch -Np1 -i $stuff/no-docs-and-tests.diff
   501.8 -
   501.9  	./configure \
  501.10  		--sysconfdir=/etc/tinyproxy \
  501.11  		$CONFIGURE_ARGS &&
   502.1 --- a/tinyproxy/stuff/no-docs-and-tests.diff	Wed May 09 17:03:28 2018 +0300
   502.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   502.3 @@ -1,98 +0,0 @@
   502.4 -diff --git a/Makefile.am b/Makefile.am
   502.5 -index 7de41f2..9d1f99b 100644
   502.6 ---- a/Makefile.am
   502.7 -+++ b/Makefile.am
   502.8 -@@ -2,9 +2,7 @@ SUBDIRS = \
   502.9 - 	src \
  502.10 - 	data \
  502.11 - 	etc \
  502.12 --	docs \
  502.13 - 	m4macros \
  502.14 --	tests
  502.15 - 
  502.16 - # tools want this on a single line
  502.17 - ACLOCAL_AMFLAGS = -I m4macros
  502.18 -diff --git a/Makefile.in b/Makefile.in
  502.19 -index d0ec918..5be49d4 100644
  502.20 ---- a/Makefile.in
  502.21 -+++ b/Makefile.in
  502.22 -@@ -221,9 +221,7 @@ SUBDIRS = \
  502.23 - 	src \
  502.24 - 	data \
  502.25 - 	etc \
  502.26 --	docs \
  502.27 - 	m4macros \
  502.28 --	tests
  502.29 - 
  502.30 - 
  502.31 - # tools want this on a single line
  502.32 -diff --git a/configure b/configure
  502.33 -index 01d6883..facfadd 100755
  502.34 ---- a/configure
  502.35 -+++ b/configure
  502.36 -@@ -6810,65 +6810,8 @@
  502.37 - fi
  502.38 - 
  502.39 - 
  502.40 --
  502.41 --
  502.42 --
  502.43 --
  502.44 --
  502.45 --# Check for asciidoc
  502.46 --# Extract the first word of "a2x", so it can be a program name with args.
  502.47 --set dummy a2x; ac_word=$2
  502.48 --{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
  502.49 --$as_echo_n "checking for $ac_word... " >&6; }
  502.50 --if test "${ac_cv_path_A2X+set}" = set; then :
  502.51 --  $as_echo_n "(cached) " >&6
  502.52 --else
  502.53 --  case $A2X in
  502.54 --  [\\/]* | ?:[\\/]*)
  502.55 --  ac_cv_path_A2X="$A2X" # Let the user override the test with a path.
  502.56 --  ;;
  502.57 --  *)
  502.58 --  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  502.59 --for as_dir in $PATH
  502.60 --do
  502.61 --  IFS=$as_save_IFS
  502.62 --  test -z "$as_dir" && as_dir=.
  502.63 --    for ac_exec_ext in '' $ac_executable_extensions; do
  502.64 --  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
  502.65 --    ac_cv_path_A2X="$as_dir/$ac_word$ac_exec_ext"
  502.66 --    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
  502.67 --    break 2
  502.68 --  fi
  502.69 --done
  502.70 --  done
  502.71 --IFS=$as_save_IFS
  502.72 --
  502.73 --  test -z "$ac_cv_path_A2X" && ac_cv_path_A2X="no"
  502.74 --  ;;
  502.75 --esac
  502.76 --fi
  502.77 --A2X=$ac_cv_path_A2X
  502.78 --if test -n "$A2X"; then
  502.79 --  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5
  502.80 --$as_echo "$A2X" >&6; }
  502.81 --else
  502.82 --  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  502.83 --$as_echo "no" >&6; }
  502.84 --fi
  502.85 --
  502.86 --
  502.87 -- if test "x$A2X" != "xno"; then
  502.88 --  HAVE_A2X_TRUE=
  502.89 --  HAVE_A2X_FALSE='#'
  502.90 --else
  502.91 -   HAVE_A2X_TRUE='#'
  502.92 -   HAVE_A2X_FALSE=
  502.93 --fi
  502.94 --
  502.95 --if test x"$A2X" = x"no"; then
  502.96 --  as_fn_error $? "Test for asciidoc failed. See the file 'INSTALL' for help." "$LINENO" 5
  502.97 --fi
  502.98 --
  502.99 - ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile data/templates/Makefile etc/Makefile docs/Makefile docs/man5/Makefile docs/man5/tinyproxy.conf.txt docs/man8/Makefile docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile"
 502.100 - 
 502.101 - 
   503.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   503.2 +++ b/tinyproxy/stuff/patches/no-docs-and-tests.diff	Thu May 10 21:12:00 2018 +0300
   503.3 @@ -0,0 +1,98 @@
   503.4 +diff --git a/Makefile.am b/Makefile.am
   503.5 +index 7de41f2..9d1f99b 100644
   503.6 +--- a/Makefile.am
   503.7 ++++ b/Makefile.am
   503.8 +@@ -2,9 +2,7 @@ SUBDIRS = \
   503.9 + 	src \
  503.10 + 	data \
  503.11 + 	etc \
  503.12 +-	docs \
  503.13 + 	m4macros \
  503.14 +-	tests
  503.15 + 
  503.16 + # tools want this on a single line
  503.17 + ACLOCAL_AMFLAGS = -I m4macros
  503.18 +diff --git a/Makefile.in b/Makefile.in
  503.19 +index d0ec918..5be49d4 100644
  503.20 +--- a/Makefile.in
  503.21 ++++ b/Makefile.in
  503.22 +@@ -221,9 +221,7 @@ SUBDIRS = \
  503.23 + 	src \
  503.24 + 	data \
  503.25 + 	etc \
  503.26 +-	docs \
  503.27 + 	m4macros \
  503.28 +-	tests
  503.29 + 
  503.30 + 
  503.31 + # tools want this on a single line
  503.32 +diff --git a/configure b/configure
  503.33 +index 01d6883..facfadd 100755
  503.34 +--- a/configure
  503.35 ++++ b/configure
  503.36 +@@ -6810,65 +6810,8 @@
  503.37 + fi
  503.38 + 
  503.39 + 
  503.40 +-
  503.41 +-
  503.42 +-
  503.43 +-
  503.44 +-
  503.45 +-# Check for asciidoc
  503.46 +-# Extract the first word of "a2x", so it can be a program name with args.
  503.47 +-set dummy a2x; ac_word=$2
  503.48 +-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
  503.49 +-$as_echo_n "checking for $ac_word... " >&6; }
  503.50 +-if test "${ac_cv_path_A2X+set}" = set; then :
  503.51 +-  $as_echo_n "(cached) " >&6
  503.52 +-else
  503.53 +-  case $A2X in
  503.54 +-  [\\/]* | ?:[\\/]*)
  503.55 +-  ac_cv_path_A2X="$A2X" # Let the user override the test with a path.
  503.56 +-  ;;
  503.57 +-  *)
  503.58 +-  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
  503.59 +-for as_dir in $PATH
  503.60 +-do
  503.61 +-  IFS=$as_save_IFS
  503.62 +-  test -z "$as_dir" && as_dir=.
  503.63 +-    for ac_exec_ext in '' $ac_executable_extensions; do
  503.64 +-  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
  503.65 +-    ac_cv_path_A2X="$as_dir/$ac_word$ac_exec_ext"
  503.66 +-    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
  503.67 +-    break 2
  503.68 +-  fi
  503.69 +-done
  503.70 +-  done
  503.71 +-IFS=$as_save_IFS
  503.72 +-
  503.73 +-  test -z "$ac_cv_path_A2X" && ac_cv_path_A2X="no"
  503.74 +-  ;;
  503.75 +-esac
  503.76 +-fi
  503.77 +-A2X=$ac_cv_path_A2X
  503.78 +-if test -n "$A2X"; then
  503.79 +-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $A2X" >&5
  503.80 +-$as_echo "$A2X" >&6; }
  503.81 +-else
  503.82 +-  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
  503.83 +-$as_echo "no" >&6; }
  503.84 +-fi
  503.85 +-
  503.86 +-
  503.87 +- if test "x$A2X" != "xno"; then
  503.88 +-  HAVE_A2X_TRUE=
  503.89 +-  HAVE_A2X_FALSE='#'
  503.90 +-else
  503.91 +   HAVE_A2X_TRUE='#'
  503.92 +   HAVE_A2X_FALSE=
  503.93 +-fi
  503.94 +-
  503.95 +-if test x"$A2X" = x"no"; then
  503.96 +-  as_fn_error $? "Test for asciidoc failed. See the file 'INSTALL' for help." "$LINENO" 5
  503.97 +-fi
  503.98 +-
  503.99 + ac_config_files="$ac_config_files Makefile src/Makefile data/Makefile data/templates/Makefile etc/Makefile docs/Makefile docs/man5/Makefile docs/man5/tinyproxy.conf.txt docs/man8/Makefile docs/man8/tinyproxy.txt m4macros/Makefile tests/Makefile tests/scripts/Makefile"
 503.100 + 
 503.101 + 
   504.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   504.2 +++ b/tinyproxy/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   504.3 @@ -0,0 +1,1 @@
   504.4 +no-docs-and-tests.diff
   505.1 --- a/tpp/receipt	Wed May 09 17:03:28 2018 +0300
   505.2 +++ b/tpp/receipt	Thu May 10 21:12:00 2018 +0300
   505.3 @@ -12,10 +12,6 @@
   505.4  WGET_URL="http://www.ngolde.de/download/$TARBALL"
   505.5  
   505.6  compile_rules() {
   505.7 -	# use debian patches and fixes
   505.8 -	patch -i $stuff/ruby19.patch
   505.9 -	patch -i $stuff/optional-x.patch
  505.10 -
  505.11  	cd examples
  505.12  	for tppfile in *.tpp; do
  505.13  		iconv -f ISO-8859-1 -t UTF-8 -o $tppfile.new $tppfile &&
   506.1 --- a/tpp/stuff/optional-x.patch	Wed May 09 17:03:28 2018 +0300
   506.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   506.3 @@ -1,51 +0,0 @@
   506.4 -Description: Don't execute commands with --exec by default
   506.5 -Author: Axel Beckert <abe@debian.org>
   506.6 -Debian-Bug: 706644
   506.7 -
   506.8 -Index: tpp/tpp.rb
   506.9 -===================================================================
  506.10 ---- tpp.orig/tpp.rb	2013-06-12 22:13:55.000000000 +0200
  506.11 -+++ tpp/tpp.rb	2013-06-12 22:15:08.000000000 +0200
  506.12 -@@ -725,9 +725,13 @@
  506.13 -   end
  506.14 - 
  506.15 -   def do_exec(cmdline)
  506.16 --    rc = Kernel.system(cmdline)
  506.17 --    if not rc then
  506.18 --      # @todo: add error message
  506.19 -+    if $execok then
  506.20 -+      rc = Kernel.system(cmdline)
  506.21 -+      if not rc then
  506.22 -+        # @todo: add error message
  506.23 -+      end
  506.24 -+    else
  506.25 -+      @screen.addstr("--exec disabled by default for security reasons. Use option -x to enable it.")
  506.26 -     end
  506.27 -   end
  506.28 - 
  506.29 -@@ -1683,6 +1687,7 @@
  506.30 -   $stderr.puts "\t -t <type>\tset filetype <type> as output format"
  506.31 -   $stderr.puts "\t -o <file>\twrite output to file <file>"
  506.32 -   $stderr.puts "\t -s <seconds>\twait <seconds> seconds between slides (with -t autoplay)"
  506.33 -+  $stderr.puts "\t -x\t\tallow parsing of --exec in input files"
  506.34 -   $stderr.puts "\t --version\tprint the version"
  506.35 -   $stderr.puts "\t --help\t\tprint this help"
  506.36 -   $stderr.puts "\n\t currently available types: ncurses (default), autoplay, latex, txt"
  506.37 -@@ -1699,6 +1704,7 @@
  506.38 - output = nil
  506.39 - type = "ncurses"
  506.40 - time = 1
  506.41 -+$execok = nil
  506.42 - 
  506.43 - skip_next = false
  506.44 - 
  506.45 -@@ -1720,6 +1726,8 @@
  506.46 -     elsif ARGV[i] == "-s" then
  506.47 -       time = ARGV[i+1].to_i
  506.48 -       skip_next = true
  506.49 -+    elsif ARGV[i] == "-x" then
  506.50 -+      $execok = 1
  506.51 -     elsif input == nil then
  506.52 -       input = ARGV[i]
  506.53 -     end
  506.54 -
   507.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   507.2 +++ b/tpp/stuff/patches/optional-x.patch	Thu May 10 21:12:00 2018 +0300
   507.3 @@ -0,0 +1,51 @@
   507.4 +Description: Don't execute commands with --exec by default
   507.5 +Author: Axel Beckert <abe@debian.org>
   507.6 +Debian-Bug: 706644
   507.7 +
   507.8 +Index: tpp/tpp.rb
   507.9 +===================================================================
  507.10 +--- tpp.orig/tpp.rb	2013-06-12 22:13:55.000000000 +0200
  507.11 ++++ tpp/tpp.rb	2013-06-12 22:15:08.000000000 +0200
  507.12 +@@ -725,9 +725,13 @@
  507.13 +   end
  507.14 + 
  507.15 +   def do_exec(cmdline)
  507.16 +-    rc = Kernel.system(cmdline)
  507.17 +-    if not rc then
  507.18 +-      # @todo: add error message
  507.19 ++    if $execok then
  507.20 ++      rc = Kernel.system(cmdline)
  507.21 ++      if not rc then
  507.22 ++        # @todo: add error message
  507.23 ++      end
  507.24 ++    else
  507.25 ++      @screen.addstr("--exec disabled by default for security reasons. Use option -x to enable it.")
  507.26 +     end
  507.27 +   end
  507.28 + 
  507.29 +@@ -1683,6 +1687,7 @@
  507.30 +   $stderr.puts "\t -t <type>\tset filetype <type> as output format"
  507.31 +   $stderr.puts "\t -o <file>\twrite output to file <file>"
  507.32 +   $stderr.puts "\t -s <seconds>\twait <seconds> seconds between slides (with -t autoplay)"
  507.33 ++  $stderr.puts "\t -x\t\tallow parsing of --exec in input files"
  507.34 +   $stderr.puts "\t --version\tprint the version"
  507.35 +   $stderr.puts "\t --help\t\tprint this help"
  507.36 +   $stderr.puts "\n\t currently available types: ncurses (default), autoplay, latex, txt"
  507.37 +@@ -1699,6 +1704,7 @@
  507.38 + output = nil
  507.39 + type = "ncurses"
  507.40 + time = 1
  507.41 ++$execok = nil
  507.42 + 
  507.43 + skip_next = false
  507.44 + 
  507.45 +@@ -1720,6 +1726,8 @@
  507.46 +     elsif ARGV[i] == "-s" then
  507.47 +       time = ARGV[i+1].to_i
  507.48 +       skip_next = true
  507.49 ++    elsif ARGV[i] == "-x" then
  507.50 ++      $execok = 1
  507.51 +     elsif input == nil then
  507.52 +       input = ARGV[i]
  507.53 +     end
  507.54 +
   508.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   508.2 +++ b/tpp/stuff/patches/ruby19.patch	Thu May 10 21:12:00 2018 +0300
   508.3 @@ -0,0 +1,294 @@
   508.4 +Description: make key events work on ruby 1.9 
   508.5 +Author: Chad Fowler <chad@chadfowler.com>
   508.6 +Debian-Bug: 671530
   508.7 +
   508.8 +Index: tpp/tpp.rb
   508.9 +===================================================================
  508.10 +--- tpp.orig/tpp.rb	2013-06-12 18:13:40.000000000 +0200
  508.11 ++++ tpp/tpp.rb	2013-06-12 21:05:55.000000000 +0200
  508.12 +@@ -44,7 +44,7 @@
  508.13 +                "blue" => 5,
  508.14 +                "cyan" => 6,
  508.15 +                "magenta" => 7,
  508.16 +-               "black" => 8, 
  508.17 ++               "black" => 8,
  508.18 +                "default" =>-1}
  508.19 +     colors[color]
  508.20 +   end
  508.21 +@@ -95,7 +95,7 @@
  508.22 + end # class FileParser
  508.23 + 
  508.24 + 
  508.25 +-# Represents a page (aka `slide') in TPP. A page consists of a title and one or 
  508.26 ++# Represents a page (aka `slide') in TPP. A page consists of a title and one or
  508.27 + # more lines.
  508.28 + class Page
  508.29 + 
  508.30 +@@ -145,8 +145,8 @@
  508.31 + 
  508.32 + 
  508.33 + 
  508.34 +-# Implements a generic visualizer from which all other visualizers need to be 
  508.35 +-# derived. If Ruby supported abstract methods, all the do_* methods would be 
  508.36 ++# Implements a generic visualizer from which all other visualizers need to be
  508.37 ++# derived. If Ruby supported abstract methods, all the do_* methods would be
  508.38 + # abstract.
  508.39 + class TppVisualizer
  508.40 + 
  508.41 +@@ -154,8 +154,8 @@
  508.42 +     # nothing
  508.43 +   end
  508.44 + 
  508.45 +-  # Splits a line into several lines, where each of the result lines is at most 
  508.46 +-  # _width_ characters long, caring about word boundaries, and returns an array 
  508.47 ++  # Splits a line into several lines, where each of the result lines is at most
  508.48 ++  # _width_ characters long, caring about word boundaries, and returns an array
  508.49 +   # of strings.
  508.50 +   def split_lines(text,width)
  508.51 +     lines = []
  508.52 +@@ -190,13 +190,13 @@
  508.53 +     $stderr.puts "Error: TppVisualizer#do_footer has been called directly."
  508.54 +     Kernel.exit(1)
  508.55 +   end
  508.56 +-  
  508.57 ++
  508.58 +   def do_header(header_text)
  508.59 +     $stderr.puts "Error: TppVisualizer#do_header has been called directly."
  508.60 +     Kernel.exit(1)
  508.61 +   end
  508.62 + 
  508.63 +-    
  508.64 ++
  508.65 +   def do_refresh
  508.66 +     $stderr.puts "Error: TppVisualizer#do_refresh has been called directly."
  508.67 +     Kernel.exit(1)
  508.68 +@@ -316,7 +316,7 @@
  508.69 +     $stderr.puts "Error: TppVisualizer#do_command_prompt has been called directly."
  508.70 +     Kernel.exit(1)
  508.71 +   end
  508.72 +-  
  508.73 ++
  508.74 +   def do_beginslideright
  508.75 +     $stderr.puts "Error: TppVisualizer#do_beginslideright has been called directly."
  508.76 +     Kernel.exit(1)
  508.77 +@@ -377,7 +377,7 @@
  508.78 +     Kernel.exit(1)
  508.79 +   end
  508.80 + 
  508.81 +-  # Receives a _line_, parses it if necessary, and dispatches it 
  508.82 ++  # Receives a _line_, parses it if necessary, and dispatches it
  508.83 +   # to the correct method which then does the correct processing.
  508.84 +   # It returns whether the controller shall wait for input.
  508.85 +   def visualize(line,eop)
  508.86 +@@ -446,10 +446,10 @@
  508.87 +         do_huge(figlet_text)
  508.88 +       when /^--footer /
  508.89 +         @footer_txt = line.sub(/^--footer /,"")
  508.90 +-        do_footer(@footer_txt) 
  508.91 ++        do_footer(@footer_txt)
  508.92 +       when /^--header /
  508.93 +         @header_txt = line.sub(/^--header /,"")
  508.94 +-        do_header(@header_txt) 
  508.95 ++        do_header(@header_txt)
  508.96 +       when /^--title /
  508.97 +         title = line.sub(/^--title /,"")
  508.98 +         do_title(title)
  508.99 +@@ -547,7 +547,7 @@
 508.100 +     @withborder = true
 508.101 +     draw_border
 508.102 +   end
 508.103 +-  
 508.104 ++
 508.105 +   def do_command_prompt()
 508.106 +     message = "Press any key to continue :)"
 508.107 +     cursor_pos = 0
 508.108 +@@ -614,11 +614,11 @@
 508.109 +     (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr("'")
 508.110 +     1.upto(@termheight-3) do |y|
 508.111 +       @screen.move(y,0)
 508.112 +-      @screen.addstr("|") 
 508.113 ++      @screen.addstr("|")
 508.114 +     end
 508.115 +     1.upto(@termheight-3) do |y|
 508.116 +       @screen.move(y,@termwidth-1)
 508.117 +-      @screen.addstr("|") 
 508.118 ++      @screen.addstr("|")
 508.119 +     end
 508.120 +   end
 508.121 + 
 508.122 +@@ -700,7 +700,7 @@
 508.123 +   end
 508.124 + 
 508.125 +   def show_help_page
 508.126 +-    help_text = [ "tpp help", 
 508.127 ++    help_text = [ "tpp help",
 508.128 +                   "",
 508.129 +                   "space bar ............................... display next entry within page",
 508.130 +                   "space bar, cursor-down, cursor-right .... display next page",
 508.131 +@@ -775,7 +775,7 @@
 508.132 +     @screen.move(@termheight - 3, (@termwidth - footer_txt.length)/2)
 508.133 +     @screen.addstr(footer_txt)
 508.134 +   end
 508.135 +- 
 508.136 ++
 508.137 +  def do_header(header_txt)
 508.138 +     @screen.move(@termheight - @termheight+1, (@termwidth - header_txt.length)/2)
 508.139 +     @screen.addstr(header_txt)
 508.140 +@@ -918,7 +918,7 @@
 508.141 +         time_to_sleep = 1.to_f / 20
 508.142 +         Kernel.sleep(time_to_sleep)
 508.143 +         xcount -= 1
 508.144 +-      end  
 508.145 ++      end
 508.146 +     when "right"
 508.147 +       (@termwidth - @indent).times do |pos|
 508.148 +         @screen.move(@cur_line,@termwidth - pos - 1)
 508.149 +@@ -991,7 +991,7 @@
 508.150 +       @screen.move(line,col*15 + 2)
 508.151 +       if current_page == i then
 508.152 +         @screen.printw("%2d %s <=",i+1,pages[i].title[0..80])
 508.153 +-      else  
 508.154 ++      else
 508.155 +         @screen.printw("%2d %s",i+1,pages[i].title[0..80])
 508.156 +       end
 508.157 +       line += 1
 508.158 +@@ -1092,7 +1092,7 @@
 508.159 + 
 508.160 +   def do_footer(footer_text)
 508.161 +   end
 508.162 +-  
 508.163 ++
 508.164 +   def do_header(header_text)
 508.165 +   end
 508.166 + 
 508.167 +@@ -1166,7 +1166,7 @@
 508.168 + 
 508.169 +   def do_revon
 508.170 +   end
 508.171 +- 
 508.172 ++
 508.173 +   def do_command_prompt
 508.174 +   end
 508.175 +   def do_revoff
 508.176 +@@ -1183,7 +1183,7 @@
 508.177 + 
 508.178 +   def do_endslide
 508.179 +   end
 508.180 +-  
 508.181 ++
 508.182 +   def do_beginslideright
 508.183 +   end
 508.184 + 
 508.185 +@@ -1349,7 +1349,7 @@
 508.186 + 
 508.187 + end
 508.188 + 
 508.189 +-# Implements an interactive controller which feeds the visualizer until it is 
 508.190 ++# Implements an interactive controller which feeds the visualizer until it is
 508.191 + # told to stop, and then reads a key press and executes the appropiate action.
 508.192 + class InteractiveController < TppController
 508.193 + 
 508.194 +@@ -1396,17 +1396,17 @@
 508.195 +       loop do
 508.196 +         ch = @vis.get_key
 508.197 +         case ch
 508.198 +-          when 'q'[0], 'Q'[0] # 'Q'uit
 508.199 ++          when ?q.ord, ?Q.ord # 'Q'uit
 508.200 +             return
 508.201 +-          when 'r'[0], 'R'[0] # 'R'edraw slide
 508.202 ++          when ?r.ord, ?R.ord # 'R'edraw slide
 508.203 +             changed_page = true # @todo: actually implement redraw
 508.204 +-          when 'e'[0], 'E'[0]
 508.205 ++          when ?e.ord, ?E.ord
 508.206 +             @cur_page = @pages.size - 1
 508.207 +             break
 508.208 +-          when 's'[0], 'S'[0]
 508.209 ++          when ?s.ord, ?S.ord
 508.210 +             @cur_page = 0
 508.211 +             break
 508.212 +-          when 'j'[0], 'J'[0] # 'J'ump to slide
 508.213 ++          when ?j.ord, ?J.ord # 'J'ump to slide
 508.214 +             screen = @vis.store_screen
 508.215 +             p = @vis.read_newpage(@pages,@cur_page)
 508.216 +             if p >= 0 and p < @pages.size
 508.217 +@@ -1417,28 +1417,28 @@
 508.218 +               @vis.restore_screen(screen)
 508.219 +             end
 508.220 +             break
 508.221 +-          when 'l'[0], 'L'[0] # re'l'oad current file
 508.222 ++          when ?l.ord, ?L.ord # re'l'oad current file
 508.223 +             @reload_file = true
 508.224 +             return
 508.225 +-          when 'c'[0], 'C'[0] # command prompt
 508.226 ++          when ?c.ord, ?C.ord # command prompt
 508.227 +             screen = @vis.store_screen
 508.228 +             @vis.do_command_prompt
 508.229 +             @vis.clear
 508.230 +             @vis.restore_screen(screen)
 508.231 +-          when '?'[0], 'h'[0]
 508.232 ++          when ??.ord, ?h.ord
 508.233 +             screen = @vis.store_screen
 508.234 +             @vis.show_help_page
 508.235 +             ch = @vis.get_key
 508.236 +             @vis.clear
 508.237 +             @vis.restore_screen(screen)
 508.238 +-          when :keyright, :keydown, ' '[0]
 508.239 ++          when :keyright, :keydown, ' '.ord
 508.240 +             if @cur_page + 1 < @pages.size and eop then
 508.241 +               @cur_page += 1
 508.242 +               @pages[@cur_page].reset_eop
 508.243 +               @vis.new_page
 508.244 +             end
 508.245 +             break
 508.246 +-          when 'b'[0], 'B'[0], :keyleft, :keyup
 508.247 ++          when ?b.ord, ?B.ord, :keyleft, :keyup
 508.248 +             if @cur_page > 0 then
 508.249 +               @cur_page -= 1
 508.250 +               @pages[@cur_page].reset_eop
 508.251 +@@ -1455,7 +1455,7 @@
 508.252 + end
 508.253 + 
 508.254 + 
 508.255 +-# Implements a visualizer which converts TPP source to a nicely formatted text 
 508.256 ++# Implements a visualizer which converts TPP source to a nicely formatted text
 508.257 + # file which can e.g. be used as handout.
 508.258 + class TextVisualizer < TppVisualizer
 508.259 + 
 508.260 +@@ -1475,7 +1475,7 @@
 508.261 + 
 508.262 +   def do_footer(footer_text)
 508.263 +   end
 508.264 +-  
 508.265 ++
 508.266 +   def do_header(header_text)
 508.267 +   end
 508.268 + 
 508.269 +@@ -1539,7 +1539,7 @@
 508.270 + 
 508.271 +   def do_revon
 508.272 +   end
 508.273 +- 
 508.274 ++
 508.275 +   def do_command_prompt
 508.276 +   end
 508.277 +   def do_revoff
 508.278 +@@ -1556,7 +1556,7 @@
 508.279 + 
 508.280 +   def do_endslide
 508.281 +   end
 508.282 +-  
 508.283 ++
 508.284 +   def do_beginslideright
 508.285 +   end
 508.286 + 
 508.287 +@@ -1650,8 +1650,8 @@
 508.288 + 
 508.289 + end
 508.290 + 
 508.291 +-# Implements a non-interactive controller to control non-interactive 
 508.292 +-# visualizers (i.e. those that are used for converting TPP source code into 
 508.293 ++# Implements a non-interactive controller to control non-interactive
 508.294 ++# visualizers (i.e. those that are used for converting TPP source code into
 508.295 + # another format)
 508.296 + class ConversionController < TppController
 508.297 + 
   509.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   509.2 +++ b/tpp/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   509.3 @@ -0,0 +1,3 @@
   509.4 +# use debian patches and fixes
   509.5 +ruby19.patch
   509.6 +optional-x.patch
   510.1 --- a/tpp/stuff/ruby19.patch	Wed May 09 17:03:28 2018 +0300
   510.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   510.3 @@ -1,294 +0,0 @@
   510.4 -Description: make key events work on ruby 1.9 
   510.5 -Author: Chad Fowler <chad@chadfowler.com>
   510.6 -Debian-Bug: 671530
   510.7 -
   510.8 -Index: tpp/tpp.rb
   510.9 -===================================================================
  510.10 ---- tpp.orig/tpp.rb	2013-06-12 18:13:40.000000000 +0200
  510.11 -+++ tpp/tpp.rb	2013-06-12 21:05:55.000000000 +0200
  510.12 -@@ -44,7 +44,7 @@
  510.13 -                "blue" => 5,
  510.14 -                "cyan" => 6,
  510.15 -                "magenta" => 7,
  510.16 --               "black" => 8, 
  510.17 -+               "black" => 8,
  510.18 -                "default" =>-1}
  510.19 -     colors[color]
  510.20 -   end
  510.21 -@@ -95,7 +95,7 @@
  510.22 - end # class FileParser
  510.23 - 
  510.24 - 
  510.25 --# Represents a page (aka `slide') in TPP. A page consists of a title and one or 
  510.26 -+# Represents a page (aka `slide') in TPP. A page consists of a title and one or
  510.27 - # more lines.
  510.28 - class Page
  510.29 - 
  510.30 -@@ -145,8 +145,8 @@
  510.31 - 
  510.32 - 
  510.33 - 
  510.34 --# Implements a generic visualizer from which all other visualizers need to be 
  510.35 --# derived. If Ruby supported abstract methods, all the do_* methods would be 
  510.36 -+# Implements a generic visualizer from which all other visualizers need to be
  510.37 -+# derived. If Ruby supported abstract methods, all the do_* methods would be
  510.38 - # abstract.
  510.39 - class TppVisualizer
  510.40 - 
  510.41 -@@ -154,8 +154,8 @@
  510.42 -     # nothing
  510.43 -   end
  510.44 - 
  510.45 --  # Splits a line into several lines, where each of the result lines is at most 
  510.46 --  # _width_ characters long, caring about word boundaries, and returns an array 
  510.47 -+  # Splits a line into several lines, where each of the result lines is at most
  510.48 -+  # _width_ characters long, caring about word boundaries, and returns an array
  510.49 -   # of strings.
  510.50 -   def split_lines(text,width)
  510.51 -     lines = []
  510.52 -@@ -190,13 +190,13 @@
  510.53 -     $stderr.puts "Error: TppVisualizer#do_footer has been called directly."
  510.54 -     Kernel.exit(1)
  510.55 -   end
  510.56 --  
  510.57 -+
  510.58 -   def do_header(header_text)
  510.59 -     $stderr.puts "Error: TppVisualizer#do_header has been called directly."
  510.60 -     Kernel.exit(1)
  510.61 -   end
  510.62 - 
  510.63 --    
  510.64 -+
  510.65 -   def do_refresh
  510.66 -     $stderr.puts "Error: TppVisualizer#do_refresh has been called directly."
  510.67 -     Kernel.exit(1)
  510.68 -@@ -316,7 +316,7 @@
  510.69 -     $stderr.puts "Error: TppVisualizer#do_command_prompt has been called directly."
  510.70 -     Kernel.exit(1)
  510.71 -   end
  510.72 --  
  510.73 -+
  510.74 -   def do_beginslideright
  510.75 -     $stderr.puts "Error: TppVisualizer#do_beginslideright has been called directly."
  510.76 -     Kernel.exit(1)
  510.77 -@@ -377,7 +377,7 @@
  510.78 -     Kernel.exit(1)
  510.79 -   end
  510.80 - 
  510.81 --  # Receives a _line_, parses it if necessary, and dispatches it 
  510.82 -+  # Receives a _line_, parses it if necessary, and dispatches it
  510.83 -   # to the correct method which then does the correct processing.
  510.84 -   # It returns whether the controller shall wait for input.
  510.85 -   def visualize(line,eop)
  510.86 -@@ -446,10 +446,10 @@
  510.87 -         do_huge(figlet_text)
  510.88 -       when /^--footer /
  510.89 -         @footer_txt = line.sub(/^--footer /,"")
  510.90 --        do_footer(@footer_txt) 
  510.91 -+        do_footer(@footer_txt)
  510.92 -       when /^--header /
  510.93 -         @header_txt = line.sub(/^--header /,"")
  510.94 --        do_header(@header_txt) 
  510.95 -+        do_header(@header_txt)
  510.96 -       when /^--title /
  510.97 -         title = line.sub(/^--title /,"")
  510.98 -         do_title(title)
  510.99 -@@ -547,7 +547,7 @@
 510.100 -     @withborder = true
 510.101 -     draw_border
 510.102 -   end
 510.103 --  
 510.104 -+
 510.105 -   def do_command_prompt()
 510.106 -     message = "Press any key to continue :)"
 510.107 -     cursor_pos = 0
 510.108 -@@ -614,11 +614,11 @@
 510.109 -     (@termwidth-2).times { @screen.addstr("-") }; @screen.addstr("'")
 510.110 -     1.upto(@termheight-3) do |y|
 510.111 -       @screen.move(y,0)
 510.112 --      @screen.addstr("|") 
 510.113 -+      @screen.addstr("|")
 510.114 -     end
 510.115 -     1.upto(@termheight-3) do |y|
 510.116 -       @screen.move(y,@termwidth-1)
 510.117 --      @screen.addstr("|") 
 510.118 -+      @screen.addstr("|")
 510.119 -     end
 510.120 -   end
 510.121 - 
 510.122 -@@ -700,7 +700,7 @@
 510.123 -   end
 510.124 - 
 510.125 -   def show_help_page
 510.126 --    help_text = [ "tpp help", 
 510.127 -+    help_text = [ "tpp help",
 510.128 -                   "",
 510.129 -                   "space bar ............................... display next entry within page",
 510.130 -                   "space bar, cursor-down, cursor-right .... display next page",
 510.131 -@@ -775,7 +775,7 @@
 510.132 -     @screen.move(@termheight - 3, (@termwidth - footer_txt.length)/2)
 510.133 -     @screen.addstr(footer_txt)
 510.134 -   end
 510.135 -- 
 510.136 -+
 510.137 -  def do_header(header_txt)
 510.138 -     @screen.move(@termheight - @termheight+1, (@termwidth - header_txt.length)/2)
 510.139 -     @screen.addstr(header_txt)
 510.140 -@@ -918,7 +918,7 @@
 510.141 -         time_to_sleep = 1.to_f / 20
 510.142 -         Kernel.sleep(time_to_sleep)
 510.143 -         xcount -= 1
 510.144 --      end  
 510.145 -+      end
 510.146 -     when "right"
 510.147 -       (@termwidth - @indent).times do |pos|
 510.148 -         @screen.move(@cur_line,@termwidth - pos - 1)
 510.149 -@@ -991,7 +991,7 @@
 510.150 -       @screen.move(line,col*15 + 2)
 510.151 -       if current_page == i then
 510.152 -         @screen.printw("%2d %s <=",i+1,pages[i].title[0..80])
 510.153 --      else  
 510.154 -+      else
 510.155 -         @screen.printw("%2d %s",i+1,pages[i].title[0..80])
 510.156 -       end
 510.157 -       line += 1
 510.158 -@@ -1092,7 +1092,7 @@
 510.159 - 
 510.160 -   def do_footer(footer_text)
 510.161 -   end
 510.162 --  
 510.163 -+
 510.164 -   def do_header(header_text)
 510.165 -   end
 510.166 - 
 510.167 -@@ -1166,7 +1166,7 @@
 510.168 - 
 510.169 -   def do_revon
 510.170 -   end
 510.171 -- 
 510.172 -+
 510.173 -   def do_command_prompt
 510.174 -   end
 510.175 -   def do_revoff
 510.176 -@@ -1183,7 +1183,7 @@
 510.177 - 
 510.178 -   def do_endslide
 510.179 -   end
 510.180 --  
 510.181 -+
 510.182 -   def do_beginslideright
 510.183 -   end
 510.184 - 
 510.185 -@@ -1349,7 +1349,7 @@
 510.186 - 
 510.187 - end
 510.188 - 
 510.189 --# Implements an interactive controller which feeds the visualizer until it is 
 510.190 -+# Implements an interactive controller which feeds the visualizer until it is
 510.191 - # told to stop, and then reads a key press and executes the appropiate action.
 510.192 - class InteractiveController < TppController
 510.193 - 
 510.194 -@@ -1396,17 +1396,17 @@
 510.195 -       loop do
 510.196 -         ch = @vis.get_key
 510.197 -         case ch
 510.198 --          when 'q'[0], 'Q'[0] # 'Q'uit
 510.199 -+          when ?q.ord, ?Q.ord # 'Q'uit
 510.200 -             return
 510.201 --          when 'r'[0], 'R'[0] # 'R'edraw slide
 510.202 -+          when ?r.ord, ?R.ord # 'R'edraw slide
 510.203 -             changed_page = true # @todo: actually implement redraw
 510.204 --          when 'e'[0], 'E'[0]
 510.205 -+          when ?e.ord, ?E.ord
 510.206 -             @cur_page = @pages.size - 1
 510.207 -             break
 510.208 --          when 's'[0], 'S'[0]
 510.209 -+          when ?s.ord, ?S.ord
 510.210 -             @cur_page = 0
 510.211 -             break
 510.212 --          when 'j'[0], 'J'[0] # 'J'ump to slide
 510.213 -+          when ?j.ord, ?J.ord # 'J'ump to slide
 510.214 -             screen = @vis.store_screen
 510.215 -             p = @vis.read_newpage(@pages,@cur_page)
 510.216 -             if p >= 0 and p < @pages.size
 510.217 -@@ -1417,28 +1417,28 @@
 510.218 -               @vis.restore_screen(screen)
 510.219 -             end
 510.220 -             break
 510.221 --          when 'l'[0], 'L'[0] # re'l'oad current file
 510.222 -+          when ?l.ord, ?L.ord # re'l'oad current file
 510.223 -             @reload_file = true
 510.224 -             return
 510.225 --          when 'c'[0], 'C'[0] # command prompt
 510.226 -+          when ?c.ord, ?C.ord # command prompt
 510.227 -             screen = @vis.store_screen
 510.228 -             @vis.do_command_prompt
 510.229 -             @vis.clear
 510.230 -             @vis.restore_screen(screen)
 510.231 --          when '?'[0], 'h'[0]
 510.232 -+          when ??.ord, ?h.ord
 510.233 -             screen = @vis.store_screen
 510.234 -             @vis.show_help_page
 510.235 -             ch = @vis.get_key
 510.236 -             @vis.clear
 510.237 -             @vis.restore_screen(screen)
 510.238 --          when :keyright, :keydown, ' '[0]
 510.239 -+          when :keyright, :keydown, ' '.ord
 510.240 -             if @cur_page + 1 < @pages.size and eop then
 510.241 -               @cur_page += 1
 510.242 -               @pages[@cur_page].reset_eop
 510.243 -               @vis.new_page
 510.244 -             end
 510.245 -             break
 510.246 --          when 'b'[0], 'B'[0], :keyleft, :keyup
 510.247 -+          when ?b.ord, ?B.ord, :keyleft, :keyup
 510.248 -             if @cur_page > 0 then
 510.249 -               @cur_page -= 1
 510.250 -               @pages[@cur_page].reset_eop
 510.251 -@@ -1455,7 +1455,7 @@
 510.252 - end
 510.253 - 
 510.254 - 
 510.255 --# Implements a visualizer which converts TPP source to a nicely formatted text 
 510.256 -+# Implements a visualizer which converts TPP source to a nicely formatted text
 510.257 - # file which can e.g. be used as handout.
 510.258 - class TextVisualizer < TppVisualizer
 510.259 - 
 510.260 -@@ -1475,7 +1475,7 @@
 510.261 - 
 510.262 -   def do_footer(footer_text)
 510.263 -   end
 510.264 --  
 510.265 -+
 510.266 -   def do_header(header_text)
 510.267 -   end
 510.268 - 
 510.269 -@@ -1539,7 +1539,7 @@
 510.270 - 
 510.271 -   def do_revon
 510.272 -   end
 510.273 -- 
 510.274 -+
 510.275 -   def do_command_prompt
 510.276 -   end
 510.277 -   def do_revoff
 510.278 -@@ -1556,7 +1556,7 @@
 510.279 - 
 510.280 -   def do_endslide
 510.281 -   end
 510.282 --  
 510.283 -+
 510.284 -   def do_beginslideright
 510.285 -   end
 510.286 - 
 510.287 -@@ -1650,8 +1650,8 @@
 510.288 - 
 510.289 - end
 510.290 - 
 510.291 --# Implements a non-interactive controller to control non-interactive 
 510.292 --# visualizers (i.e. those that are used for converting TPP source code into 
 510.293 -+# Implements a non-interactive controller to control non-interactive
 510.294 -+# visualizers (i.e. those that are used for converting TPP source code into
 510.295 - # another format)
 510.296 - class ConversionController < TppController
 510.297 - 
   511.1 --- a/tuxmath/receipt	Wed May 09 17:03:28 2018 +0300
   511.2 +++ b/tuxmath/receipt	Thu May 10 21:12:00 2018 +0300
   511.3 @@ -20,7 +20,6 @@
   511.4  # Rules to configure and make the package.
   511.5  compile_rules()
   511.6  {
   511.7 -	#patch -p1 -i $stuff/SDL_extras.c.patch	
   511.8  	./configure LIBS="-lt4k_common" \
   511.9  		--prefix=/usr \
  511.10  		$CONFIGURE_ARGS &&
   512.1 --- a/tuxmath/stuff/SDL_extras.c.patch	Wed May 09 17:03:28 2018 +0300
   512.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   512.3 @@ -1,19 +0,0 @@
   512.4 ---- tuxmath_w_fonts-1.7.2/src/SDL_extras.c.old	Mon Mar  9 10:44:42 2009
   512.5 -+++ tuxmath_w_fonts-1.7.2/src/SDL_extras.c	Sat Jun  6 18:55:22 2009
   512.6 -@@ -987,6 +987,7 @@
   512.7 - /* font in memory once loaded until cleanup.                  */
   512.8 - static TTF_Font* get_font(int size)
   512.9 - {
  512.10 -+  static char prev_font_name[FONT_NAME_LENGTH];
  512.11 -   if (size < 0)
  512.12 -   {
  512.13 -     fprintf(stderr, "Error - requested font size %d is negative\n", size);
  512.14 -@@ -1001,7 +1002,7 @@
  512.15 -   }
  512.16 - 
  512.17 -   /* If the font has changed, we need to wipe out the old ones: */
  512.18 --  if (0 != strncmp(prev_font_name, Opts_FontName(),sizeof(prev_font_name)))
  512.19 -+  if (0 != strncmp(prev_font_name, Opts_FontName(), FONT_NAME_LENGTH))
  512.20 -   {
  512.21 -     free_font_list();
  512.22 -     strncpy(prev_font_name, Opts_FontName(), sizeof(prev_font_name));
   513.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   513.2 +++ b/tuxmath/stuff/patches/SDL_extras.c.patch	Thu May 10 21:12:00 2018 +0300
   513.3 @@ -0,0 +1,19 @@
   513.4 +--- tuxmath_w_fonts-1.7.2/src/SDL_extras.c.old	Mon Mar  9 10:44:42 2009
   513.5 ++++ tuxmath_w_fonts-1.7.2/src/SDL_extras.c	Sat Jun  6 18:55:22 2009
   513.6 +@@ -987,6 +987,7 @@
   513.7 + /* font in memory once loaded until cleanup.                  */
   513.8 + static TTF_Font* get_font(int size)
   513.9 + {
  513.10 ++  static char prev_font_name[FONT_NAME_LENGTH];
  513.11 +   if (size < 0)
  513.12 +   {
  513.13 +     fprintf(stderr, "Error - requested font size %d is negative\n", size);
  513.14 +@@ -1001,7 +1002,7 @@
  513.15 +   }
  513.16 + 
  513.17 +   /* If the font has changed, we need to wipe out the old ones: */
  513.18 +-  if (0 != strncmp(prev_font_name, Opts_FontName(),sizeof(prev_font_name)))
  513.19 ++  if (0 != strncmp(prev_font_name, Opts_FontName(), FONT_NAME_LENGTH))
  513.20 +   {
  513.21 +     free_font_list();
  513.22 +     strncpy(prev_font_name, Opts_FontName(), sizeof(prev_font_name));
   514.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   514.2 +++ b/tuxmath/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   514.3 @@ -0,0 +1,1 @@
   514.4 +#-p1|SDL_extras.c.patch
   515.1 --- a/visualboyadvance/receipt	Wed May 09 17:03:28 2018 +0300
   515.2 +++ b/visualboyadvance/receipt	Thu May 10 21:12:00 2018 +0300
   515.3 @@ -20,9 +20,6 @@
   515.4  	sed -i 's/int i = 0; i < 16; i++/int ii = 0; ii < 16; ii++/' \
   515.5  		src/sdl/debugger.cpp
   515.6  	sed -i 's/void \*,void \*/gzFile, void */' src/Util.cpp
   515.7 -	for i in $stuff/$VERSION-*.patch; do
   515.8 -		patch -Np0 < $i
   515.9 -	done
  515.10  
  515.11  	./configure \
  515.12  		--disable-profiling \
   516.1 --- a/visualboyadvance/stuff/1.7.2-deprecatedsigc++.patch	Wed May 09 17:03:28 2018 +0300
   516.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   516.3 @@ -1,692 +0,0 @@
   516.4 ---- src/gtk/sigccompat.h.old	2008-05-02 10:46:45.000000000 +0200
   516.5 -+++ src/gtk/sigccompat.h	2008-05-02 10:47:08.000000000 +0200
   516.6 -@@ -20,7 +20,7 @@
   516.7 - #ifndef __VBA_SIGCCOMPAT_H__
   516.8 - #define __VBA_SIGCCOMPAT_H__
   516.9 - 
  516.10 --#undef LIBSIGC_DISABLE_DEPRECATED
  516.11 -+#define LIBSIGC_DISABLE_DEPRECATED
  516.12 - #include <sigc++/bind.h>
  516.13 - #include <sigc++/connection.h>
  516.14 - 
  516.15 -@@ -28,9 +28,679 @@
  516.16 - #include <sigc++/object.h>
  516.17 - #include <sigc++/functors/mem_fun.h>
  516.18 - 
  516.19 --namespace SigC
  516.20 -+
  516.21 -+// From sigc++/bind.h
  516.22 -+namespace SigC {
  516.23 -+
  516.24 -+template <class T_bound1, class T_functor>
  516.25 -+inline ::sigc::bind_functor<-1, T_functor,
  516.26 -+                            typename ::sigc::unwrap_reference<T_bound1>::type>
  516.27 -+bind(const T_functor& _A_functor, T_bound1 _A_b1)
  516.28 -+{ return ::sigc::bind_functor<-1, T_functor,
  516.29 -+                              typename ::sigc::unwrap_reference<T_bound1>::type>
  516.30 -+                              (_A_functor, _A_b1);
  516.31 -+}
  516.32 -+
  516.33 -+template <class T_bound1, class T_bound2, class T_functor>
  516.34 -+inline ::sigc::bind_functor<-1, T_functor,
  516.35 -+                            typename ::sigc::unwrap_reference<T_bound1>::type,
  516.36 -+                            typename ::sigc::unwrap_reference<T_bound2>::type>
  516.37 -+bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2)
  516.38 -+{ return ::sigc::bind_functor<-1, T_functor,
  516.39 -+                              typename ::sigc::unwrap_reference<T_bound1>::type,
  516.40 -+                              typename ::sigc::unwrap_reference<T_bound2>::type>
  516.41 -+                              (_A_functor, _A_b1, _A_b2); 
  516.42 -+}
  516.43 -+
  516.44 -+template <class T_bound1, class T_bound2, class T_bound3, class T_functor>
  516.45 -+inline ::sigc::bind_functor<-1, T_functor,
  516.46 -+                            typename ::sigc::unwrap_reference<T_bound1>::type,
  516.47 -+                            typename ::sigc::unwrap_reference<T_bound2>::type,
  516.48 -+                            typename ::sigc::unwrap_reference<T_bound3>::type>
  516.49 -+bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2,T_bound3 _A_b3)
  516.50 -+{ return ::sigc::bind_functor<-1, T_functor,
  516.51 -+                              typename ::sigc::unwrap_reference<T_bound1>::type,
  516.52 -+                              typename ::sigc::unwrap_reference<T_bound2>::type,
  516.53 -+                              typename ::sigc::unwrap_reference<T_bound3>::type>
  516.54 -+                              (_A_functor, _A_b1, _A_b2, _A_b3);
  516.55 -+}
  516.56 -+
  516.57 -+}
  516.58 -+
  516.59 -+// From sigc++/connection.h
  516.60 -+namespace SigC {
  516.61 -+
  516.62 -+/** Convinience class for safe disconnection.
  516.63 -+ * Iterators must not be used beyond the lifetime of the list
  516.64 -+ * they work on. A connection object can be created from a
  516.65 -+ * slot list iterator and may safely be used to disconnect
  516.66 -+ * the referred slot at any time (disconnect()). If the slot
  516.67 -+ * has already been destroyed, disconnect() does nothing. empty() or
  516.68 -+ * operator bool() can be used to test whether the connection is
  516.69 -+ * still active. The connection can be blocked (block(), unblock()).
  516.70 -+ *
  516.71 -+ * This is possible because the connection object gets notified
  516.72 -+ * when the referred slot dies (notify()).
  516.73 -+ *
  516.74 -+ * @deprecated Use sigc::connection instead.
  516.75 -+ * @ingroup compat
  516.76 -+ */
  516.77 -+typedef ::sigc::connection Connection;
  516.78 -+
  516.79 -+}
  516.80 -+
  516.81 -+// From sigc++/slot.h
  516.82 -+namespace SigC {
  516.83 -+
  516.84 -+// SlotN
  516.85 -+/** Converts an arbitrary functor to a unified type which is opaque.
  516.86 -+ * Slot0 itself is a functor or to be more precise a closure. It contains
  516.87 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
  516.88 -+ *
  516.89 -+ * The template arguments determine the function signature of operator()():
  516.90 -+ * - @e T_return The return type of operator()().
  516.91 -+ *
  516.92 -+ * To use simply assign the slot to the desired functor. If the functor
  516.93 -+ * is not compatible with the parameter list defined with the template
  516.94 -+ * arguments compiler errors are triggered. When called the slot
  516.95 -+ * will invoke the functor with minimal copies.
  516.96 -+ * block() and unblock() can be used to block the functor's invocation
  516.97 -+ * from operator()() temporarily.
  516.98 -+ *
  516.99 -+ * @par Example:
 516.100 -+ *   @code
 516.101 -+ *   #include <sigc++/slot.h>
 516.102 -+ *   void foo(int) {}
 516.103 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.104 -+ *   s(19);
 516.105 -+ *   @endcode
 516.106 -+ *
 516.107 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.108 -+ * @ingroup compat
 516.109 -+ */
 516.110 -+template <class T_return>
 516.111 -+class Slot0
 516.112 -+  : public ::sigc::slot<T_return>
 516.113 -+{
 516.114 -+public:
 516.115 -+  typedef ::sigc::slot<T_return> parent_type;
 516.116 -+
 516.117 -+  /// Constructs an empty slot.
 516.118 -+  Slot0() {}
 516.119 -+
 516.120 -+  /** Constructs a slot from an arbitrary functor.
 516.121 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.122 -+   */
 516.123 -+  template <class T_functor>
 516.124 -+  Slot0(const T_functor& _A_func)
 516.125 -+    : ::sigc::slot<T_return>(_A_func) {}
 516.126 -+
 516.127 -+  /** Constructs a slot, copying an existing one.
 516.128 -+   * @param src The existing slot to copy.
 516.129 -+   */
 516.130 -+  Slot0(const parent_type& src)
 516.131 -+    : parent_type(src) {}
 516.132 -+
 516.133 -+  /** Overrides this slot making a copy from another slot.
 516.134 -+   * @param src The slot from which to make a copy.
 516.135 -+   * @return @p this.
 516.136 -+   */
 516.137 -+  Slot0& operator=(const parent_type& src)
 516.138 -+    { parent_type::operator=(src); return *this; }
 516.139 -+};
 516.140 -+
 516.141 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.142 -+ * Slot1 itself is a functor or to be more precise a closure. It contains
 516.143 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.144 -+ *
 516.145 -+ * The template arguments determine the function signature of operator()():
 516.146 -+ * - @e T_return The return type of operator()().
 516.147 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.148 -+ *
 516.149 -+ * To use simply assign the slot to the desired functor. If the functor
 516.150 -+ * is not compatible with the parameter list defined with the template
 516.151 -+ * arguments compiler errors are triggered. When called the slot
 516.152 -+ * will invoke the functor with minimal copies.
 516.153 -+ * block() and unblock() can be used to block the functor's invocation
 516.154 -+ * from operator()() temporarily.
 516.155 -+ *
 516.156 -+ * @par Example:
 516.157 -+ *   @code
 516.158 -+ *   #include <sigc++/slot.h>
 516.159 -+ *   void foo(int) {}
 516.160 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.161 -+ *   s(19);
 516.162 -+ *   @endcode
 516.163 -+ *
 516.164 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.165 -+ * @ingroup compat
 516.166 -+ */
 516.167 -+template <class T_return, class T_arg1>
 516.168 -+class Slot1
 516.169 -+  : public ::sigc::slot<T_return, T_arg1>
 516.170 -+{
 516.171 -+public:
 516.172 -+  typedef ::sigc::slot<T_return, T_arg1> parent_type;
 516.173 -+
 516.174 -+  /// Constructs an empty slot.
 516.175 -+  Slot1() {}
 516.176 -+
 516.177 -+  /** Constructs a slot from an arbitrary functor.
 516.178 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.179 -+   */
 516.180 -+  template <class T_functor>
 516.181 -+  Slot1(const T_functor& _A_func)
 516.182 -+    : ::sigc::slot<T_return, T_arg1>(_A_func) {}
 516.183 -+
 516.184 -+  /** Constructs a slot, copying an existing one.
 516.185 -+   * @param src The existing slot to copy.
 516.186 -+   */
 516.187 -+  Slot1(const parent_type& src)
 516.188 -+    : parent_type(src) {}
 516.189 -+
 516.190 -+  /** Overrides this slot making a copy from another slot.
 516.191 -+   * @param src The slot from which to make a copy.
 516.192 -+   * @return @p this.
 516.193 -+   */
 516.194 -+  Slot1& operator=(const parent_type& src)
 516.195 -+    { parent_type::operator=(src); return *this; }
 516.196 -+};
 516.197 -+
 516.198 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.199 -+ * Slot2 itself is a functor or to be more precise a closure. It contains
 516.200 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.201 -+ *
 516.202 -+ * The template arguments determine the function signature of operator()():
 516.203 -+ * - @e T_return The return type of operator()().
 516.204 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.205 -+ * - @e T_arg2 Argument type used in the definition of operator()().
 516.206 -+ *
 516.207 -+ * To use simply assign the slot to the desired functor. If the functor
 516.208 -+ * is not compatible with the parameter list defined with the template
 516.209 -+ * arguments compiler errors are triggered. When called the slot
 516.210 -+ * will invoke the functor with minimal copies.
 516.211 -+ * block() and unblock() can be used to block the functor's invocation
 516.212 -+ * from operator()() temporarily.
 516.213 -+ *
 516.214 -+ * @par Example:
 516.215 -+ *   @code
 516.216 -+ *   #include <sigc++/slot.h>
 516.217 -+ *   void foo(int) {}
 516.218 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.219 -+ *   s(19);
 516.220 -+ *   @endcode
 516.221 -+ *
 516.222 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.223 -+ * @ingroup compat
 516.224 -+ */
 516.225 -+template <class T_return, class T_arg1,class T_arg2>
 516.226 -+class Slot2
 516.227 -+  : public ::sigc::slot<T_return, T_arg1,T_arg2>
 516.228 -+{
 516.229 -+public:
 516.230 -+  typedef ::sigc::slot<T_return, T_arg1,T_arg2> parent_type;
 516.231 -+
 516.232 -+  /// Constructs an empty slot.
 516.233 -+  Slot2() {}
 516.234 -+
 516.235 -+  /** Constructs a slot from an arbitrary functor.
 516.236 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.237 -+   */
 516.238 -+  template <class T_functor>
 516.239 -+  Slot2(const T_functor& _A_func)
 516.240 -+    : ::sigc::slot<T_return, T_arg1,T_arg2>(_A_func) {}
 516.241 -+
 516.242 -+  /** Constructs a slot, copying an existing one.
 516.243 -+   * @param src The existing slot to copy.
 516.244 -+   */
 516.245 -+  Slot2(const parent_type& src)
 516.246 -+    : parent_type(src) {}
 516.247 -+
 516.248 -+  /** Overrides this slot making a copy from another slot.
 516.249 -+   * @param src The slot from which to make a copy.
 516.250 -+   * @return @p this.
 516.251 -+   */
 516.252 -+  Slot2& operator=(const parent_type& src)
 516.253 -+    { parent_type::operator=(src); return *this; }
 516.254 -+};
 516.255 -+
 516.256 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.257 -+ * Slot3 itself is a functor or to be more precise a closure. It contains
 516.258 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.259 -+ *
 516.260 -+ * The template arguments determine the function signature of operator()():
 516.261 -+ * - @e T_return The return type of operator()().
 516.262 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.263 -+ * - @e T_arg2 Argument type used in the definition of operator()().
 516.264 -+ * - @e T_arg3 Argument type used in the definition of operator()().
 516.265 -+ *
 516.266 -+ * To use simply assign the slot to the desired functor. If the functor
 516.267 -+ * is not compatible with the parameter list defined with the template
 516.268 -+ * arguments compiler errors are triggered. When called the slot
 516.269 -+ * will invoke the functor with minimal copies.
 516.270 -+ * block() and unblock() can be used to block the functor's invocation
 516.271 -+ * from operator()() temporarily.
 516.272 -+ *
 516.273 -+ * @par Example:
 516.274 -+ *   @code
 516.275 -+ *   #include <sigc++/slot.h>
 516.276 -+ *   void foo(int) {}
 516.277 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.278 -+ *   s(19);
 516.279 -+ *   @endcode
 516.280 -+ *
 516.281 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.282 -+ * @ingroup compat
 516.283 -+ */
 516.284 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3>
 516.285 -+class Slot3
 516.286 -+  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3>
 516.287 -+{
 516.288 -+public:
 516.289 -+  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3> parent_type;
 516.290 -+
 516.291 -+  /// Constructs an empty slot.
 516.292 -+  Slot3() {}
 516.293 -+
 516.294 -+  /** Constructs a slot from an arbitrary functor.
 516.295 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.296 -+   */
 516.297 -+  template <class T_functor>
 516.298 -+  Slot3(const T_functor& _A_func)
 516.299 -+    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3>(_A_func) {}
 516.300 -+
 516.301 -+  /** Constructs a slot, copying an existing one.
 516.302 -+   * @param src The existing slot to copy.
 516.303 -+   */
 516.304 -+  Slot3(const parent_type& src)
 516.305 -+    : parent_type(src) {}
 516.306 -+
 516.307 -+  /** Overrides this slot making a copy from another slot.
 516.308 -+   * @param src The slot from which to make a copy.
 516.309 -+   * @return @p this.
 516.310 -+   */
 516.311 -+  Slot3& operator=(const parent_type& src)
 516.312 -+    { parent_type::operator=(src); return *this; }
 516.313 -+};
 516.314 -+
 516.315 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.316 -+ * Slot4 itself is a functor or to be more precise a closure. It contains
 516.317 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.318 -+ *
 516.319 -+ * The template arguments determine the function signature of operator()():
 516.320 -+ * - @e T_return The return type of operator()().
 516.321 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.322 -+ * - @e T_arg2 Argument type used in the definition of operator()().
 516.323 -+ * - @e T_arg3 Argument type used in the definition of operator()().
 516.324 -+ * - @e T_arg4 Argument type used in the definition of operator()().
 516.325 -+ *
 516.326 -+ * To use simply assign the slot to the desired functor. If the functor
 516.327 -+ * is not compatible with the parameter list defined with the template
 516.328 -+ * arguments compiler errors are triggered. When called the slot
 516.329 -+ * will invoke the functor with minimal copies.
 516.330 -+ * block() and unblock() can be used to block the functor's invocation
 516.331 -+ * from operator()() temporarily.
 516.332 -+ *
 516.333 -+ * @par Example:
 516.334 -+ *   @code
 516.335 -+ *   #include <sigc++/slot.h>
 516.336 -+ *   void foo(int) {}
 516.337 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.338 -+ *   s(19);
 516.339 -+ *   @endcode
 516.340 -+ *
 516.341 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.342 -+ * @ingroup compat
 516.343 -+ */
 516.344 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
 516.345 -+class Slot4
 516.346 -+  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>
 516.347 -+{
 516.348 -+public:
 516.349 -+  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4> parent_type;
 516.350 -+
 516.351 -+  /// Constructs an empty slot.
 516.352 -+  Slot4() {}
 516.353 -+
 516.354 -+  /** Constructs a slot from an arbitrary functor.
 516.355 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.356 -+   */
 516.357 -+  template <class T_functor>
 516.358 -+  Slot4(const T_functor& _A_func)
 516.359 -+    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>(_A_func) {}
 516.360 -+
 516.361 -+  /** Constructs a slot, copying an existing one.
 516.362 -+   * @param src The existing slot to copy.
 516.363 -+   */
 516.364 -+  Slot4(const parent_type& src)
 516.365 -+    : parent_type(src) {}
 516.366 -+
 516.367 -+  /** Overrides this slot making a copy from another slot.
 516.368 -+   * @param src The slot from which to make a copy.
 516.369 -+   * @return @p this.
 516.370 -+   */
 516.371 -+  Slot4& operator=(const parent_type& src)
 516.372 -+    { parent_type::operator=(src); return *this; }
 516.373 -+};
 516.374 -+
 516.375 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.376 -+ * Slot5 itself is a functor or to be more precise a closure. It contains
 516.377 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.378 -+ *
 516.379 -+ * The template arguments determine the function signature of operator()():
 516.380 -+ * - @e T_return The return type of operator()().
 516.381 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.382 -+ * - @e T_arg2 Argument type used in the definition of operator()().
 516.383 -+ * - @e T_arg3 Argument type used in the definition of operator()().
 516.384 -+ * - @e T_arg4 Argument type used in the definition of operator()().
 516.385 -+ * - @e T_arg5 Argument type used in the definition of operator()().
 516.386 -+ *
 516.387 -+ * To use simply assign the slot to the desired functor. If the functor
 516.388 -+ * is not compatible with the parameter list defined with the template
 516.389 -+ * arguments compiler errors are triggered. When called the slot
 516.390 -+ * will invoke the functor with minimal copies.
 516.391 -+ * block() and unblock() can be used to block the functor's invocation
 516.392 -+ * from operator()() temporarily.
 516.393 -+ *
 516.394 -+ * @par Example:
 516.395 -+ *   @code
 516.396 -+ *   #include <sigc++/slot.h>
 516.397 -+ *   void foo(int) {}
 516.398 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.399 -+ *   s(19);
 516.400 -+ *   @endcode
 516.401 -+ *
 516.402 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.403 -+ * @ingroup compat
 516.404 -+ */
 516.405 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
 516.406 -+class Slot5
 516.407 -+  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>
 516.408 -+{
 516.409 -+public:
 516.410 -+  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> parent_type;
 516.411 -+
 516.412 -+  /// Constructs an empty slot.
 516.413 -+  Slot5() {}
 516.414 -+
 516.415 -+  /** Constructs a slot from an arbitrary functor.
 516.416 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.417 -+   */
 516.418 -+  template <class T_functor>
 516.419 -+  Slot5(const T_functor& _A_func)
 516.420 -+    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>(_A_func) {}
 516.421 -+
 516.422 -+  /** Constructs a slot, copying an existing one.
 516.423 -+   * @param src The existing slot to copy.
 516.424 -+   */
 516.425 -+  Slot5(const parent_type& src)
 516.426 -+    : parent_type(src) {}
 516.427 -+
 516.428 -+  /** Overrides this slot making a copy from another slot.
 516.429 -+   * @param src The slot from which to make a copy.
 516.430 -+   * @return @p this.
 516.431 -+   */
 516.432 -+  Slot5& operator=(const parent_type& src)
 516.433 -+    { parent_type::operator=(src); return *this; }
 516.434 -+};
 516.435 -+
 516.436 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.437 -+ * Slot6 itself is a functor or to be more precise a closure. It contains
 516.438 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.439 -+ *
 516.440 -+ * The template arguments determine the function signature of operator()():
 516.441 -+ * - @e T_return The return type of operator()().
 516.442 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.443 -+ * - @e T_arg2 Argument type used in the definition of operator()().
 516.444 -+ * - @e T_arg3 Argument type used in the definition of operator()().
 516.445 -+ * - @e T_arg4 Argument type used in the definition of operator()().
 516.446 -+ * - @e T_arg5 Argument type used in the definition of operator()().
 516.447 -+ * - @e T_arg6 Argument type used in the definition of operator()().
 516.448 -+ *
 516.449 -+ * To use simply assign the slot to the desired functor. If the functor
 516.450 -+ * is not compatible with the parameter list defined with the template
 516.451 -+ * arguments compiler errors are triggered. When called the slot
 516.452 -+ * will invoke the functor with minimal copies.
 516.453 -+ * block() and unblock() can be used to block the functor's invocation
 516.454 -+ * from operator()() temporarily.
 516.455 -+ *
 516.456 -+ * @par Example:
 516.457 -+ *   @code
 516.458 -+ *   #include <sigc++/slot.h>
 516.459 -+ *   void foo(int) {}
 516.460 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.461 -+ *   s(19);
 516.462 -+ *   @endcode
 516.463 -+ *
 516.464 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.465 -+ * @ingroup compat
 516.466 -+ */
 516.467 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
 516.468 -+class Slot6
 516.469 -+  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>
 516.470 -+{
 516.471 -+public:
 516.472 -+  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> parent_type;
 516.473 -+
 516.474 -+  /// Constructs an empty slot.
 516.475 -+  Slot6() {}
 516.476 -+
 516.477 -+  /** Constructs a slot from an arbitrary functor.
 516.478 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.479 -+   */
 516.480 -+  template <class T_functor>
 516.481 -+  Slot6(const T_functor& _A_func)
 516.482 -+    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>(_A_func) {}
 516.483 -+
 516.484 -+  /** Constructs a slot, copying an existing one.
 516.485 -+   * @param src The existing slot to copy.
 516.486 -+   */
 516.487 -+  Slot6(const parent_type& src)
 516.488 -+    : parent_type(src) {}
 516.489 -+
 516.490 -+  /** Overrides this slot making a copy from another slot.
 516.491 -+   * @param src The slot from which to make a copy.
 516.492 -+   * @return @p this.
 516.493 -+   */
 516.494 -+  Slot6& operator=(const parent_type& src)
 516.495 -+    { parent_type::operator=(src); return *this; }
 516.496 -+};
 516.497 -+
 516.498 -+/** Converts an arbitrary functor to a unified type which is opaque.
 516.499 -+ * Slot7 itself is a functor or to be more precise a closure. It contains
 516.500 -+ * a single, arbitrary functor (or closure) that is executed in operator()().
 516.501 -+ *
 516.502 -+ * The template arguments determine the function signature of operator()():
 516.503 -+ * - @e T_return The return type of operator()().
 516.504 -+ * - @e T_arg1 Argument type used in the definition of operator()().
 516.505 -+ * - @e T_arg2 Argument type used in the definition of operator()().
 516.506 -+ * - @e T_arg3 Argument type used in the definition of operator()().
 516.507 -+ * - @e T_arg4 Argument type used in the definition of operator()().
 516.508 -+ * - @e T_arg5 Argument type used in the definition of operator()().
 516.509 -+ * - @e T_arg6 Argument type used in the definition of operator()().
 516.510 -+ * - @e T_arg7 Argument type used in the definition of operator()().
 516.511 -+ *
 516.512 -+ * To use simply assign the slot to the desired functor. If the functor
 516.513 -+ * is not compatible with the parameter list defined with the template
 516.514 -+ * arguments compiler errors are triggered. When called the slot
 516.515 -+ * will invoke the functor with minimal copies.
 516.516 -+ * block() and unblock() can be used to block the functor's invocation
 516.517 -+ * from operator()() temporarily.
 516.518 -+ *
 516.519 -+ * @par Example:
 516.520 -+ *   @code
 516.521 -+ *   #include <sigc++/slot.h>
 516.522 -+ *   void foo(int) {}
 516.523 -+ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 516.524 -+ *   s(19);
 516.525 -+ *   @endcode
 516.526 -+ *
 516.527 -+ * @deprecated Use the unnumbered template sigc::slot instead.
 516.528 -+ * @ingroup compat
 516.529 -+ */
 516.530 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
 516.531 -+class Slot7
 516.532 -+  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
 516.533 - {
 516.534 -+public:
 516.535 -+  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> parent_type;
 516.536 -+
 516.537 -+  /// Constructs an empty slot.
 516.538 -+  Slot7() {}
 516.539 -+
 516.540 -+  /** Constructs a slot from an arbitrary functor.
 516.541 -+   * @param _A_func The desired functor the new slot should be assigned to.
 516.542 -+   */
 516.543 -+  template <class T_functor>
 516.544 -+  Slot7(const T_functor& _A_func)
 516.545 -+    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>(_A_func) {}
 516.546 -+
 516.547 -+  /** Constructs a slot, copying an existing one.
 516.548 -+   * @param src The existing slot to copy.
 516.549 -+   */
 516.550 -+  Slot7(const parent_type& src)
 516.551 -+    : parent_type(src) {}
 516.552 -+
 516.553 -+  /** Overrides this slot making a copy from another slot.
 516.554 -+   * @param src The slot from which to make a copy.
 516.555 -+   * @return @p this.
 516.556 -+   */
 516.557 -+  Slot7& operator=(const parent_type& src)
 516.558 -+    { parent_type::operator=(src); return *this; }
 516.559 -+};
 516.560 -+
 516.561 -+
 516.562 -+
 516.563 -+#ifndef DOXYGEN_SHOULD_SKIP_THIS
 516.564 -+/* gcc 3.2 reports a strange conflict between SigC::slot() and sigc::slot<>
 516.565 -+ * when "using namespace SigC" and later using a slot(obj,func) overload
 516.566 -+ * without the prefix "SigC::". Probably a compiler bug. I will investigate.
 516.567 -+ *
 516.568 -+ * This ugly hack avoids the error:
 516.569 -+ */
 516.570 -+// #define slot(...) make_slot(__VA_ARGS__) /* only works for gcc */
 516.571 -+#endif
 516.572 - 
 516.573 -+
 516.574 -+// slot()
 516.575 -+/** Creates a functor of type SigC::Slot0 that wraps an existing non-member function.
 516.576 -+ *
 516.577 -+ * @param _A_func Pointer to function that should be wrapped.
 516.578 -+ * @return Functor that executes _A_func on invokation.
 516.579 -+ *
 516.580 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.581 -+ * @ingroup compat
 516.582 -+ */
 516.583 -+template <class T_return>
 516.584 -+inline Slot0<T_return>
 516.585 -+slot(T_return (*_A_func)())
 516.586 -+{ return Slot0<T_return>(_A_func); }
 516.587 -+
 516.588 -+/** Creates a functor of type SigC::Slot1 that wraps an existing non-member function.
 516.589 -+ *
 516.590 -+ * @param _A_func Pointer to function that should be wrapped.
 516.591 -+ * @return Functor that executes _A_func on invokation.
 516.592 -+ *
 516.593 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.594 -+ * @ingroup compat
 516.595 -+ */
 516.596 -+template <class T_return, class T_arg1>
 516.597 -+inline Slot1<T_return, T_arg1>
 516.598 -+slot(T_return (*_A_func)(T_arg1))
 516.599 -+{ return Slot1<T_return, T_arg1>(_A_func); }
 516.600 -+
 516.601 -+/** Creates a functor of type SigC::Slot2 that wraps an existing non-member function.
 516.602 -+ *
 516.603 -+ * @param _A_func Pointer to function that should be wrapped.
 516.604 -+ * @return Functor that executes _A_func on invokation.
 516.605 -+ *
 516.606 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.607 -+ * @ingroup compat
 516.608 -+ */
 516.609 -+template <class T_return, class T_arg1,class T_arg2>
 516.610 -+inline Slot2<T_return, T_arg1,T_arg2>
 516.611 -+slot(T_return (*_A_func)(T_arg1,T_arg2))
 516.612 -+{ return Slot2<T_return, T_arg1,T_arg2>(_A_func); }
 516.613 -+
 516.614 -+/** Creates a functor of type SigC::Slot3 that wraps an existing non-member function.
 516.615 -+ *
 516.616 -+ * @param _A_func Pointer to function that should be wrapped.
 516.617 -+ * @return Functor that executes _A_func on invokation.
 516.618 -+ *
 516.619 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.620 -+ * @ingroup compat
 516.621 -+ */
 516.622 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3>
 516.623 -+inline Slot3<T_return, T_arg1,T_arg2,T_arg3>
 516.624 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3))
 516.625 -+{ return Slot3<T_return, T_arg1,T_arg2,T_arg3>(_A_func); }
 516.626 -+
 516.627 -+/** Creates a functor of type SigC::Slot4 that wraps an existing non-member function.
 516.628 -+ *
 516.629 -+ * @param _A_func Pointer to function that should be wrapped.
 516.630 -+ * @return Functor that executes _A_func on invokation.
 516.631 -+ *
 516.632 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.633 -+ * @ingroup compat
 516.634 -+ */
 516.635 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
 516.636 -+inline Slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4>
 516.637 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4))
 516.638 -+{ return Slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4>(_A_func); }
 516.639 -+
 516.640 -+/** Creates a functor of type SigC::Slot5 that wraps an existing non-member function.
 516.641 -+ *
 516.642 -+ * @param _A_func Pointer to function that should be wrapped.
 516.643 -+ * @return Functor that executes _A_func on invokation.
 516.644 -+ *
 516.645 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.646 -+ * @ingroup compat
 516.647 -+ */
 516.648 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
 516.649 -+inline Slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>
 516.650 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5))
 516.651 -+{ return Slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>(_A_func); }
 516.652 -+
 516.653 -+/** Creates a functor of type SigC::Slot6 that wraps an existing non-member function.
 516.654 -+ *
 516.655 -+ * @param _A_func Pointer to function that should be wrapped.
 516.656 -+ * @return Functor that executes _A_func on invokation.
 516.657 -+ *
 516.658 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.659 -+ * @ingroup compat
 516.660 -+ */
 516.661 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
 516.662 -+inline Slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>
 516.663 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6))
 516.664 -+{ return Slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>(_A_func); }
 516.665 -+
 516.666 -+/** Creates a functor of type SigC::Slot7 that wraps an existing non-member function.
 516.667 -+ *
 516.668 -+ * @param _A_func Pointer to function that should be wrapped.
 516.669 -+ * @return Functor that executes _A_func on invokation.
 516.670 -+ *
 516.671 -+ * @deprecated Use sigc::ptr_fun() instead.
 516.672 -+ * @ingroup compat
 516.673 -+ */
 516.674 -+template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
 516.675 -+inline Slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
 516.676 -+slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7))
 516.677 -+{ return Slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>(_A_func); }
 516.678 -+
 516.679 -+
 516.680 -+
 516.681 -+}
 516.682 -+
 516.683 -+// From sigc++/object.h
 516.684 -+namespace SigC {
 516.685 -+
 516.686 -+// Object
 516.687 -+typedef ::sigc::trackable Object;
 516.688 -+
 516.689 -+}
 516.690 -+
 516.691 -+namespace SigC
 516.692 -+{
 516.693 - template <class T_return, class T_obj1, class T_obj2>
 516.694 - inline Slot0<T_return>
 516.695 - slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() )
   517.1 --- a/visualboyadvance/stuff/1.7.2-gcc34.patch	Wed May 09 17:03:28 2018 +0300
   517.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   517.3 @@ -1,41 +0,0 @@
   517.4 -diff -ur src/gtk/joypadconfig.h src/gtk/joypadconfig.h
   517.5 ---- src/gtk/joypadconfig.h	2004-05-10 16:43:21.000000000 +0200
   517.6 -+++ src/gtk/joypadconfig.h	2004-08-12 22:30:20.838039064 +0200
   517.7 -@@ -22,8 +22,8 @@
   517.8 - 
   517.9 - #include <vector>
  517.10 - 
  517.11 --#include <libglademm.h>
  517.12 - #include <gtkmm.h>
  517.13 -+#include <libglademm.h>
  517.14 - 
  517.15 - #ifndef GTKMM20
  517.16 - # include "sigccompat.h"
  517.17 -diff -ur src/gtk/main.cpp src/gtk/main.cpp
  517.18 ---- src/gtk/main.cpp	2004-05-21 18:02:35.000000000 +0200
  517.19 -+++ src/gtk/main.cpp	2004-08-12 22:39:08.633801912 +0200
  517.20 -@@ -22,10 +22,10 @@
  517.21 - 
  517.22 - #include <list>
  517.23 - 
  517.24 --#include <libglademm.h>
  517.25 - #include <gtkmm/main.h>
  517.26 - #include <gtkmm/window.h>
  517.27 - #include <gtkmm/messagedialog.h>
  517.28 -+#include <libglademm.h>
  517.29 - 
  517.30 - #include "images/vba-wm-pixbufs.h"
  517.31 - 
  517.32 -diff -ur src/gtk/window.h src/gtk/window.h
  517.33 ---- src/gtk/window.h	2004-05-21 15:25:41.000000000 +0200
  517.34 -+++ src/gtk/window.h	2004-08-12 22:30:58.650290728 +0200
  517.35 -@@ -23,8 +23,8 @@
  517.36 - #include <sys/types.h>
  517.37 - #include <stdarg.h>
  517.38 - 
  517.39 --#include <libglademm.h>
  517.40 - #include <gtkmm.h>
  517.41 -+#include <libglademm.h>
  517.42 - 
  517.43 - #ifndef GTKMM20
  517.44 - # include "sigccompat.h"
   518.1 --- a/visualboyadvance/stuff/1.7.2-gcc41.patch	Wed May 09 17:03:28 2018 +0300
   518.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   518.3 @@ -1,27 +0,0 @@
   518.4 -diff -ru src/prof/prof.cpp src/prof/prof.cpp
   518.5 ---- src/prof/prof.cpp	2004-05-14 00:31:58.000000000 +1000
   518.6 -+++ src/prof/prof.cpp	2006-06-03 13:49:41.000000000 +1000
   518.7 -@@ -266,7 +266,7 @@
   518.8 -     for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
   518.9 -       if(profWrite8(fd, GMON_TAG_CG_ARC) ||
  518.10 -          profWrite32(fd, (u32)frompc) ||
  518.11 --         profWrite32(fd, (u32)tos[toindex].selfpc) ||
  518.12 -+         profWrite32(fd, (u32)(intptr_t)tos[toindex].selfpc) ||
  518.13 -          profWrite32(fd, tos[toindex].count)) {
  518.14 -         systemMessage(0, "mcount: arc");
  518.15 -         fclose(fd);
  518.16 -diff -ru src/sdl/debugger.cpp src/sdl/debugger.cpp
  518.17 ---- src/sdl/debugger.cpp	2004-05-14 00:13:14.000000000 +1000
  518.18 -+++ src/sdl/debugger.cpp	2006-06-03 13:49:57.000000000 +1000
  518.19 -@@ -950,9 +950,9 @@
  518.20 - {
  518.21 -   u32 address = 0;
  518.22 -   if(mem >= (u32*)&workRAM[0] && mem <= (u32*)&workRAM[0x3ffff])
  518.23 --    address = 0x2000000 + ((u32)mem - (u32)&workRAM[0]);
  518.24 -+    address = 0x2000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&workRAM[0]);
  518.25 -   else
  518.26 --    address = 0x3000000 + ((u32)mem - (u32)&internalRAM[0]);
  518.27 -+    address = 0x3000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&internalRAM[0]);
  518.28 - 
  518.29 -   if(size == 2)
  518.30 -     printf("Breakpoint (on write) address %08x old:%08x new:%08x\n", 
   519.1 --- a/visualboyadvance/stuff/1.7.2-glibc.patch	Wed May 09 17:03:28 2018 +0300
   519.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   519.3 @@ -1,76 +0,0 @@
   519.4 ---- src/GBA.cpp
   519.5 -+++ src/GBA.cpp
   519.6 -@@ -1130,7 +1130,7 @@
   519.7 - bool CPUIsZipFile(const char * file)
   519.8 - {
   519.9 -   if(strlen(file) > 4) {
  519.10 --    char * p = strrchr(file,'.');
  519.11 -+    const char * p = strrchr(file,'.');
  519.12 - 
  519.13 -     if(p != NULL) {
  519.14 -       if(_stricmp(p, ".zip") == 0)
  519.15 -@@ -1145,7 +1145,7 @@
  519.16 - {
  519.17 -   cpuIsMultiBoot = false;
  519.18 -   if(strlen(file) > 4) {
  519.19 --    char * p = strrchr(file,'.');
  519.20 -+    const char * p = strrchr(file,'.');
  519.21 - 
  519.22 -     if(p != NULL) {
  519.23 -       if(_stricmp(p, ".gba") == 0)
  519.24 -@@ -1169,7 +1169,7 @@
  519.25 - bool CPUIsGBABios(const char * file)
  519.26 - {
  519.27 -   if(strlen(file) > 4) {
  519.28 --    char * p = strrchr(file,'.');
  519.29 -+    const char * p = strrchr(file,'.');
  519.30 - 
  519.31 -     if(p != NULL) {
  519.32 -       if(_stricmp(p, ".gba") == 0)
  519.33 -@@ -1189,7 +1189,7 @@
  519.34 - bool CPUIsELF(const char *file)
  519.35 - {
  519.36 -   if(strlen(file) > 4) {
  519.37 --    char * p = strrchr(file,'.');
  519.38 -+    const char * p = strrchr(file,'.');
  519.39 -     
  519.40 -     if(p != NULL) {
  519.41 -       if(_stricmp(p, ".elf") == 0)
  519.42 ---- src/Util.cpp
  519.43 -+++ src/Util.cpp
  519.44 -@@ -478,7 +478,7 @@
  519.45 - {
  519.46 -   cpuIsMultiBoot = false;
  519.47 -   if(strlen(file) > 4) {
  519.48 --    char * p = strrchr(file,'.');
  519.49 -+    const char * p = strrchr(file,'.');
  519.50 - 
  519.51 -     if(p != NULL) {
  519.52 -       if(_stricmp(p, ".gba") == 0)
  519.53 -@@ -502,7 +502,7 @@
  519.54 - bool utilIsGBImage(const char * file)
  519.55 - {
  519.56 -   if(strlen(file) > 4) {
  519.57 --    char * p = strrchr(file,'.');
  519.58 -+    const char * p = strrchr(file,'.');
  519.59 - 
  519.60 -     if(p != NULL) {
  519.61 -       if(_stricmp(p, ".gb") == 0)
  519.62 -@@ -522,7 +522,7 @@
  519.63 - bool utilIsZipFile(const char *file)
  519.64 - {
  519.65 -   if(strlen(file) > 4) {
  519.66 --    char * p = strrchr(file,'.');
  519.67 -+    const char * p = strrchr(file,'.');
  519.68 - 
  519.69 -     if(p != NULL) {
  519.70 -       if(_stricmp(p, ".zip") == 0)
  519.71 -@@ -552,7 +552,7 @@
  519.72 - bool utilIsGzipFile(const char *file)
  519.73 - {
  519.74 -   if(strlen(file) > 3) {
  519.75 --    char * p = strrchr(file,'.');
  519.76 -+    const char * p = strrchr(file,'.');
  519.77 - 
  519.78 -     if(p != NULL) {
  519.79 -       if(_stricmp(p, ".gz") == 0)
   520.1 --- a/visualboyadvance/stuff/1.7.2-homedir.patch	Wed May 09 17:03:28 2018 +0300
   520.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   520.3 @@ -1,11 +0,0 @@
   520.4 ---- src/sdl/SDL.cpp.orig	2004-08-15 02:43:28.232750688 -0400
   520.5 -+++ src/sdl/SDL.cpp	2004-08-15 02:44:01.557684528 -0400
   520.6 -@@ -887,7 +887,7 @@
   520.7 - 
   520.8 -   if(home != NULL) {
   520.9 -     fprintf(stderr, "Searching home directory: %s\n", home);
  520.10 --    sprintf(path, "%s%c%s", home, FILE_SEP, name);
  520.11 -+    sprintf(path, "%s%c.%s%c%s", home, FILE_SEP, EXE_NAME, FILE_SEP, name);
  520.12 -     f = fopen(path, "r");
  520.13 -     if(f != NULL)
  520.14 -       return f;
   521.1 --- a/visualboyadvance/stuff/1.7.2-uninit.patch	Wed May 09 17:03:28 2018 +0300
   521.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   521.3 @@ -1,13 +0,0 @@
   521.4 -diff -ru src/gtk/window.cpp src/gtk/window.cpp
   521.5 ---- src/gtk/window.cpp	2004-05-14 00:31:58.000000000 +1000
   521.6 -+++ src/gtk/window.cpp	2007-03-17 14:57:22.000000000 -0500
   521.7 -@@ -91,7 +91,8 @@
   521.8 -   m_iFilterIBMin    (FirstFilterIB),
   521.9 -   m_iFilterIBMax    (LastFilterIB),
  521.10 -   m_iJoypadMin      (1),
  521.11 --  m_iJoypadMax      (4)
  521.12 -+  m_iJoypadMax      (4),
  521.13 -+  m_poKeymap        (NULL)
  521.14 - {
  521.15 -   m_poXml            = _poXml;
  521.16 -   m_poFileOpenDialog = NULL;
   522.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   522.2 +++ b/visualboyadvance/stuff/patches/1.7.2-deprecatedsigc++.patch	Thu May 10 21:12:00 2018 +0300
   522.3 @@ -0,0 +1,692 @@
   522.4 +--- src/gtk/sigccompat.h.old	2008-05-02 10:46:45.000000000 +0200
   522.5 ++++ src/gtk/sigccompat.h	2008-05-02 10:47:08.000000000 +0200
   522.6 +@@ -20,7 +20,7 @@
   522.7 + #ifndef __VBA_SIGCCOMPAT_H__
   522.8 + #define __VBA_SIGCCOMPAT_H__
   522.9 + 
  522.10 +-#undef LIBSIGC_DISABLE_DEPRECATED
  522.11 ++#define LIBSIGC_DISABLE_DEPRECATED
  522.12 + #include <sigc++/bind.h>
  522.13 + #include <sigc++/connection.h>
  522.14 + 
  522.15 +@@ -28,9 +28,679 @@
  522.16 + #include <sigc++/object.h>
  522.17 + #include <sigc++/functors/mem_fun.h>
  522.18 + 
  522.19 +-namespace SigC
  522.20 ++
  522.21 ++// From sigc++/bind.h
  522.22 ++namespace SigC {
  522.23 ++
  522.24 ++template <class T_bound1, class T_functor>
  522.25 ++inline ::sigc::bind_functor<-1, T_functor,
  522.26 ++                            typename ::sigc::unwrap_reference<T_bound1>::type>
  522.27 ++bind(const T_functor& _A_functor, T_bound1 _A_b1)
  522.28 ++{ return ::sigc::bind_functor<-1, T_functor,
  522.29 ++                              typename ::sigc::unwrap_reference<T_bound1>::type>
  522.30 ++                              (_A_functor, _A_b1);
  522.31 ++}
  522.32 ++
  522.33 ++template <class T_bound1, class T_bound2, class T_functor>
  522.34 ++inline ::sigc::bind_functor<-1, T_functor,
  522.35 ++                            typename ::sigc::unwrap_reference<T_bound1>::type,
  522.36 ++                            typename ::sigc::unwrap_reference<T_bound2>::type>
  522.37 ++bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2)
  522.38 ++{ return ::sigc::bind_functor<-1, T_functor,
  522.39 ++                              typename ::sigc::unwrap_reference<T_bound1>::type,
  522.40 ++                              typename ::sigc::unwrap_reference<T_bound2>::type>
  522.41 ++                              (_A_functor, _A_b1, _A_b2); 
  522.42 ++}
  522.43 ++
  522.44 ++template <class T_bound1, class T_bound2, class T_bound3, class T_functor>
  522.45 ++inline ::sigc::bind_functor<-1, T_functor,
  522.46 ++                            typename ::sigc::unwrap_reference<T_bound1>::type,
  522.47 ++                            typename ::sigc::unwrap_reference<T_bound2>::type,
  522.48 ++                            typename ::sigc::unwrap_reference<T_bound3>::type>
  522.49 ++bind(const T_functor& _A_functor, T_bound1 _A_b1, T_bound2 _A_b2,T_bound3 _A_b3)
  522.50 ++{ return ::sigc::bind_functor<-1, T_functor,
  522.51 ++                              typename ::sigc::unwrap_reference<T_bound1>::type,
  522.52 ++                              typename ::sigc::unwrap_reference<T_bound2>::type,
  522.53 ++                              typename ::sigc::unwrap_reference<T_bound3>::type>
  522.54 ++                              (_A_functor, _A_b1, _A_b2, _A_b3);
  522.55 ++}
  522.56 ++
  522.57 ++}
  522.58 ++
  522.59 ++// From sigc++/connection.h
  522.60 ++namespace SigC {
  522.61 ++
  522.62 ++/** Convinience class for safe disconnection.
  522.63 ++ * Iterators must not be used beyond the lifetime of the list
  522.64 ++ * they work on. A connection object can be created from a
  522.65 ++ * slot list iterator and may safely be used to disconnect
  522.66 ++ * the referred slot at any time (disconnect()). If the slot
  522.67 ++ * has already been destroyed, disconnect() does nothing. empty() or
  522.68 ++ * operator bool() can be used to test whether the connection is
  522.69 ++ * still active. The connection can be blocked (block(), unblock()).
  522.70 ++ *
  522.71 ++ * This is possible because the connection object gets notified
  522.72 ++ * when the referred slot dies (notify()).
  522.73 ++ *
  522.74 ++ * @deprecated Use sigc::connection instead.
  522.75 ++ * @ingroup compat
  522.76 ++ */
  522.77 ++typedef ::sigc::connection Connection;
  522.78 ++
  522.79 ++}
  522.80 ++
  522.81 ++// From sigc++/slot.h
  522.82 ++namespace SigC {
  522.83 ++
  522.84 ++// SlotN
  522.85 ++/** Converts an arbitrary functor to a unified type which is opaque.
  522.86 ++ * Slot0 itself is a functor or to be more precise a closure. It contains
  522.87 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
  522.88 ++ *
  522.89 ++ * The template arguments determine the function signature of operator()():
  522.90 ++ * - @e T_return The return type of operator()().
  522.91 ++ *
  522.92 ++ * To use simply assign the slot to the desired functor. If the functor
  522.93 ++ * is not compatible with the parameter list defined with the template
  522.94 ++ * arguments compiler errors are triggered. When called the slot
  522.95 ++ * will invoke the functor with minimal copies.
  522.96 ++ * block() and unblock() can be used to block the functor's invocation
  522.97 ++ * from operator()() temporarily.
  522.98 ++ *
  522.99 ++ * @par Example:
 522.100 ++ *   @code
 522.101 ++ *   #include <sigc++/slot.h>
 522.102 ++ *   void foo(int) {}
 522.103 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.104 ++ *   s(19);
 522.105 ++ *   @endcode
 522.106 ++ *
 522.107 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.108 ++ * @ingroup compat
 522.109 ++ */
 522.110 ++template <class T_return>
 522.111 ++class Slot0
 522.112 ++  : public ::sigc::slot<T_return>
 522.113 ++{
 522.114 ++public:
 522.115 ++  typedef ::sigc::slot<T_return> parent_type;
 522.116 ++
 522.117 ++  /// Constructs an empty slot.
 522.118 ++  Slot0() {}
 522.119 ++
 522.120 ++  /** Constructs a slot from an arbitrary functor.
 522.121 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.122 ++   */
 522.123 ++  template <class T_functor>
 522.124 ++  Slot0(const T_functor& _A_func)
 522.125 ++    : ::sigc::slot<T_return>(_A_func) {}
 522.126 ++
 522.127 ++  /** Constructs a slot, copying an existing one.
 522.128 ++   * @param src The existing slot to copy.
 522.129 ++   */
 522.130 ++  Slot0(const parent_type& src)
 522.131 ++    : parent_type(src) {}
 522.132 ++
 522.133 ++  /** Overrides this slot making a copy from another slot.
 522.134 ++   * @param src The slot from which to make a copy.
 522.135 ++   * @return @p this.
 522.136 ++   */
 522.137 ++  Slot0& operator=(const parent_type& src)
 522.138 ++    { parent_type::operator=(src); return *this; }
 522.139 ++};
 522.140 ++
 522.141 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.142 ++ * Slot1 itself is a functor or to be more precise a closure. It contains
 522.143 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.144 ++ *
 522.145 ++ * The template arguments determine the function signature of operator()():
 522.146 ++ * - @e T_return The return type of operator()().
 522.147 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.148 ++ *
 522.149 ++ * To use simply assign the slot to the desired functor. If the functor
 522.150 ++ * is not compatible with the parameter list defined with the template
 522.151 ++ * arguments compiler errors are triggered. When called the slot
 522.152 ++ * will invoke the functor with minimal copies.
 522.153 ++ * block() and unblock() can be used to block the functor's invocation
 522.154 ++ * from operator()() temporarily.
 522.155 ++ *
 522.156 ++ * @par Example:
 522.157 ++ *   @code
 522.158 ++ *   #include <sigc++/slot.h>
 522.159 ++ *   void foo(int) {}
 522.160 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.161 ++ *   s(19);
 522.162 ++ *   @endcode
 522.163 ++ *
 522.164 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.165 ++ * @ingroup compat
 522.166 ++ */
 522.167 ++template <class T_return, class T_arg1>
 522.168 ++class Slot1
 522.169 ++  : public ::sigc::slot<T_return, T_arg1>
 522.170 ++{
 522.171 ++public:
 522.172 ++  typedef ::sigc::slot<T_return, T_arg1> parent_type;
 522.173 ++
 522.174 ++  /// Constructs an empty slot.
 522.175 ++  Slot1() {}
 522.176 ++
 522.177 ++  /** Constructs a slot from an arbitrary functor.
 522.178 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.179 ++   */
 522.180 ++  template <class T_functor>
 522.181 ++  Slot1(const T_functor& _A_func)
 522.182 ++    : ::sigc::slot<T_return, T_arg1>(_A_func) {}
 522.183 ++
 522.184 ++  /** Constructs a slot, copying an existing one.
 522.185 ++   * @param src The existing slot to copy.
 522.186 ++   */
 522.187 ++  Slot1(const parent_type& src)
 522.188 ++    : parent_type(src) {}
 522.189 ++
 522.190 ++  /** Overrides this slot making a copy from another slot.
 522.191 ++   * @param src The slot from which to make a copy.
 522.192 ++   * @return @p this.
 522.193 ++   */
 522.194 ++  Slot1& operator=(const parent_type& src)
 522.195 ++    { parent_type::operator=(src); return *this; }
 522.196 ++};
 522.197 ++
 522.198 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.199 ++ * Slot2 itself is a functor or to be more precise a closure. It contains
 522.200 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.201 ++ *
 522.202 ++ * The template arguments determine the function signature of operator()():
 522.203 ++ * - @e T_return The return type of operator()().
 522.204 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.205 ++ * - @e T_arg2 Argument type used in the definition of operator()().
 522.206 ++ *
 522.207 ++ * To use simply assign the slot to the desired functor. If the functor
 522.208 ++ * is not compatible with the parameter list defined with the template
 522.209 ++ * arguments compiler errors are triggered. When called the slot
 522.210 ++ * will invoke the functor with minimal copies.
 522.211 ++ * block() and unblock() can be used to block the functor's invocation
 522.212 ++ * from operator()() temporarily.
 522.213 ++ *
 522.214 ++ * @par Example:
 522.215 ++ *   @code
 522.216 ++ *   #include <sigc++/slot.h>
 522.217 ++ *   void foo(int) {}
 522.218 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.219 ++ *   s(19);
 522.220 ++ *   @endcode
 522.221 ++ *
 522.222 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.223 ++ * @ingroup compat
 522.224 ++ */
 522.225 ++template <class T_return, class T_arg1,class T_arg2>
 522.226 ++class Slot2
 522.227 ++  : public ::sigc::slot<T_return, T_arg1,T_arg2>
 522.228 ++{
 522.229 ++public:
 522.230 ++  typedef ::sigc::slot<T_return, T_arg1,T_arg2> parent_type;
 522.231 ++
 522.232 ++  /// Constructs an empty slot.
 522.233 ++  Slot2() {}
 522.234 ++
 522.235 ++  /** Constructs a slot from an arbitrary functor.
 522.236 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.237 ++   */
 522.238 ++  template <class T_functor>
 522.239 ++  Slot2(const T_functor& _A_func)
 522.240 ++    : ::sigc::slot<T_return, T_arg1,T_arg2>(_A_func) {}
 522.241 ++
 522.242 ++  /** Constructs a slot, copying an existing one.
 522.243 ++   * @param src The existing slot to copy.
 522.244 ++   */
 522.245 ++  Slot2(const parent_type& src)
 522.246 ++    : parent_type(src) {}
 522.247 ++
 522.248 ++  /** Overrides this slot making a copy from another slot.
 522.249 ++   * @param src The slot from which to make a copy.
 522.250 ++   * @return @p this.
 522.251 ++   */
 522.252 ++  Slot2& operator=(const parent_type& src)
 522.253 ++    { parent_type::operator=(src); return *this; }
 522.254 ++};
 522.255 ++
 522.256 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.257 ++ * Slot3 itself is a functor or to be more precise a closure. It contains
 522.258 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.259 ++ *
 522.260 ++ * The template arguments determine the function signature of operator()():
 522.261 ++ * - @e T_return The return type of operator()().
 522.262 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.263 ++ * - @e T_arg2 Argument type used in the definition of operator()().
 522.264 ++ * - @e T_arg3 Argument type used in the definition of operator()().
 522.265 ++ *
 522.266 ++ * To use simply assign the slot to the desired functor. If the functor
 522.267 ++ * is not compatible with the parameter list defined with the template
 522.268 ++ * arguments compiler errors are triggered. When called the slot
 522.269 ++ * will invoke the functor with minimal copies.
 522.270 ++ * block() and unblock() can be used to block the functor's invocation
 522.271 ++ * from operator()() temporarily.
 522.272 ++ *
 522.273 ++ * @par Example:
 522.274 ++ *   @code
 522.275 ++ *   #include <sigc++/slot.h>
 522.276 ++ *   void foo(int) {}
 522.277 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.278 ++ *   s(19);
 522.279 ++ *   @endcode
 522.280 ++ *
 522.281 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.282 ++ * @ingroup compat
 522.283 ++ */
 522.284 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3>
 522.285 ++class Slot3
 522.286 ++  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3>
 522.287 ++{
 522.288 ++public:
 522.289 ++  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3> parent_type;
 522.290 ++
 522.291 ++  /// Constructs an empty slot.
 522.292 ++  Slot3() {}
 522.293 ++
 522.294 ++  /** Constructs a slot from an arbitrary functor.
 522.295 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.296 ++   */
 522.297 ++  template <class T_functor>
 522.298 ++  Slot3(const T_functor& _A_func)
 522.299 ++    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3>(_A_func) {}
 522.300 ++
 522.301 ++  /** Constructs a slot, copying an existing one.
 522.302 ++   * @param src The existing slot to copy.
 522.303 ++   */
 522.304 ++  Slot3(const parent_type& src)
 522.305 ++    : parent_type(src) {}
 522.306 ++
 522.307 ++  /** Overrides this slot making a copy from another slot.
 522.308 ++   * @param src The slot from which to make a copy.
 522.309 ++   * @return @p this.
 522.310 ++   */
 522.311 ++  Slot3& operator=(const parent_type& src)
 522.312 ++    { parent_type::operator=(src); return *this; }
 522.313 ++};
 522.314 ++
 522.315 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.316 ++ * Slot4 itself is a functor or to be more precise a closure. It contains
 522.317 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.318 ++ *
 522.319 ++ * The template arguments determine the function signature of operator()():
 522.320 ++ * - @e T_return The return type of operator()().
 522.321 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.322 ++ * - @e T_arg2 Argument type used in the definition of operator()().
 522.323 ++ * - @e T_arg3 Argument type used in the definition of operator()().
 522.324 ++ * - @e T_arg4 Argument type used in the definition of operator()().
 522.325 ++ *
 522.326 ++ * To use simply assign the slot to the desired functor. If the functor
 522.327 ++ * is not compatible with the parameter list defined with the template
 522.328 ++ * arguments compiler errors are triggered. When called the slot
 522.329 ++ * will invoke the functor with minimal copies.
 522.330 ++ * block() and unblock() can be used to block the functor's invocation
 522.331 ++ * from operator()() temporarily.
 522.332 ++ *
 522.333 ++ * @par Example:
 522.334 ++ *   @code
 522.335 ++ *   #include <sigc++/slot.h>
 522.336 ++ *   void foo(int) {}
 522.337 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.338 ++ *   s(19);
 522.339 ++ *   @endcode
 522.340 ++ *
 522.341 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.342 ++ * @ingroup compat
 522.343 ++ */
 522.344 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
 522.345 ++class Slot4
 522.346 ++  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>
 522.347 ++{
 522.348 ++public:
 522.349 ++  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4> parent_type;
 522.350 ++
 522.351 ++  /// Constructs an empty slot.
 522.352 ++  Slot4() {}
 522.353 ++
 522.354 ++  /** Constructs a slot from an arbitrary functor.
 522.355 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.356 ++   */
 522.357 ++  template <class T_functor>
 522.358 ++  Slot4(const T_functor& _A_func)
 522.359 ++    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4>(_A_func) {}
 522.360 ++
 522.361 ++  /** Constructs a slot, copying an existing one.
 522.362 ++   * @param src The existing slot to copy.
 522.363 ++   */
 522.364 ++  Slot4(const parent_type& src)
 522.365 ++    : parent_type(src) {}
 522.366 ++
 522.367 ++  /** Overrides this slot making a copy from another slot.
 522.368 ++   * @param src The slot from which to make a copy.
 522.369 ++   * @return @p this.
 522.370 ++   */
 522.371 ++  Slot4& operator=(const parent_type& src)
 522.372 ++    { parent_type::operator=(src); return *this; }
 522.373 ++};
 522.374 ++
 522.375 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.376 ++ * Slot5 itself is a functor or to be more precise a closure. It contains
 522.377 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.378 ++ *
 522.379 ++ * The template arguments determine the function signature of operator()():
 522.380 ++ * - @e T_return The return type of operator()().
 522.381 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.382 ++ * - @e T_arg2 Argument type used in the definition of operator()().
 522.383 ++ * - @e T_arg3 Argument type used in the definition of operator()().
 522.384 ++ * - @e T_arg4 Argument type used in the definition of operator()().
 522.385 ++ * - @e T_arg5 Argument type used in the definition of operator()().
 522.386 ++ *
 522.387 ++ * To use simply assign the slot to the desired functor. If the functor
 522.388 ++ * is not compatible with the parameter list defined with the template
 522.389 ++ * arguments compiler errors are triggered. When called the slot
 522.390 ++ * will invoke the functor with minimal copies.
 522.391 ++ * block() and unblock() can be used to block the functor's invocation
 522.392 ++ * from operator()() temporarily.
 522.393 ++ *
 522.394 ++ * @par Example:
 522.395 ++ *   @code
 522.396 ++ *   #include <sigc++/slot.h>
 522.397 ++ *   void foo(int) {}
 522.398 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.399 ++ *   s(19);
 522.400 ++ *   @endcode
 522.401 ++ *
 522.402 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.403 ++ * @ingroup compat
 522.404 ++ */
 522.405 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
 522.406 ++class Slot5
 522.407 ++  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>
 522.408 ++{
 522.409 ++public:
 522.410 ++  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5> parent_type;
 522.411 ++
 522.412 ++  /// Constructs an empty slot.
 522.413 ++  Slot5() {}
 522.414 ++
 522.415 ++  /** Constructs a slot from an arbitrary functor.
 522.416 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.417 ++   */
 522.418 ++  template <class T_functor>
 522.419 ++  Slot5(const T_functor& _A_func)
 522.420 ++    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>(_A_func) {}
 522.421 ++
 522.422 ++  /** Constructs a slot, copying an existing one.
 522.423 ++   * @param src The existing slot to copy.
 522.424 ++   */
 522.425 ++  Slot5(const parent_type& src)
 522.426 ++    : parent_type(src) {}
 522.427 ++
 522.428 ++  /** Overrides this slot making a copy from another slot.
 522.429 ++   * @param src The slot from which to make a copy.
 522.430 ++   * @return @p this.
 522.431 ++   */
 522.432 ++  Slot5& operator=(const parent_type& src)
 522.433 ++    { parent_type::operator=(src); return *this; }
 522.434 ++};
 522.435 ++
 522.436 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.437 ++ * Slot6 itself is a functor or to be more precise a closure. It contains
 522.438 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.439 ++ *
 522.440 ++ * The template arguments determine the function signature of operator()():
 522.441 ++ * - @e T_return The return type of operator()().
 522.442 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.443 ++ * - @e T_arg2 Argument type used in the definition of operator()().
 522.444 ++ * - @e T_arg3 Argument type used in the definition of operator()().
 522.445 ++ * - @e T_arg4 Argument type used in the definition of operator()().
 522.446 ++ * - @e T_arg5 Argument type used in the definition of operator()().
 522.447 ++ * - @e T_arg6 Argument type used in the definition of operator()().
 522.448 ++ *
 522.449 ++ * To use simply assign the slot to the desired functor. If the functor
 522.450 ++ * is not compatible with the parameter list defined with the template
 522.451 ++ * arguments compiler errors are triggered. When called the slot
 522.452 ++ * will invoke the functor with minimal copies.
 522.453 ++ * block() and unblock() can be used to block the functor's invocation
 522.454 ++ * from operator()() temporarily.
 522.455 ++ *
 522.456 ++ * @par Example:
 522.457 ++ *   @code
 522.458 ++ *   #include <sigc++/slot.h>
 522.459 ++ *   void foo(int) {}
 522.460 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.461 ++ *   s(19);
 522.462 ++ *   @endcode
 522.463 ++ *
 522.464 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.465 ++ * @ingroup compat
 522.466 ++ */
 522.467 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
 522.468 ++class Slot6
 522.469 ++  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>
 522.470 ++{
 522.471 ++public:
 522.472 ++  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6> parent_type;
 522.473 ++
 522.474 ++  /// Constructs an empty slot.
 522.475 ++  Slot6() {}
 522.476 ++
 522.477 ++  /** Constructs a slot from an arbitrary functor.
 522.478 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.479 ++   */
 522.480 ++  template <class T_functor>
 522.481 ++  Slot6(const T_functor& _A_func)
 522.482 ++    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>(_A_func) {}
 522.483 ++
 522.484 ++  /** Constructs a slot, copying an existing one.
 522.485 ++   * @param src The existing slot to copy.
 522.486 ++   */
 522.487 ++  Slot6(const parent_type& src)
 522.488 ++    : parent_type(src) {}
 522.489 ++
 522.490 ++  /** Overrides this slot making a copy from another slot.
 522.491 ++   * @param src The slot from which to make a copy.
 522.492 ++   * @return @p this.
 522.493 ++   */
 522.494 ++  Slot6& operator=(const parent_type& src)
 522.495 ++    { parent_type::operator=(src); return *this; }
 522.496 ++};
 522.497 ++
 522.498 ++/** Converts an arbitrary functor to a unified type which is opaque.
 522.499 ++ * Slot7 itself is a functor or to be more precise a closure. It contains
 522.500 ++ * a single, arbitrary functor (or closure) that is executed in operator()().
 522.501 ++ *
 522.502 ++ * The template arguments determine the function signature of operator()():
 522.503 ++ * - @e T_return The return type of operator()().
 522.504 ++ * - @e T_arg1 Argument type used in the definition of operator()().
 522.505 ++ * - @e T_arg2 Argument type used in the definition of operator()().
 522.506 ++ * - @e T_arg3 Argument type used in the definition of operator()().
 522.507 ++ * - @e T_arg4 Argument type used in the definition of operator()().
 522.508 ++ * - @e T_arg5 Argument type used in the definition of operator()().
 522.509 ++ * - @e T_arg6 Argument type used in the definition of operator()().
 522.510 ++ * - @e T_arg7 Argument type used in the definition of operator()().
 522.511 ++ *
 522.512 ++ * To use simply assign the slot to the desired functor. If the functor
 522.513 ++ * is not compatible with the parameter list defined with the template
 522.514 ++ * arguments compiler errors are triggered. When called the slot
 522.515 ++ * will invoke the functor with minimal copies.
 522.516 ++ * block() and unblock() can be used to block the functor's invocation
 522.517 ++ * from operator()() temporarily.
 522.518 ++ *
 522.519 ++ * @par Example:
 522.520 ++ *   @code
 522.521 ++ *   #include <sigc++/slot.h>
 522.522 ++ *   void foo(int) {}
 522.523 ++ *   SigC::Slot1<void, long> s = SigC::slot(&foo);
 522.524 ++ *   s(19);
 522.525 ++ *   @endcode
 522.526 ++ *
 522.527 ++ * @deprecated Use the unnumbered template sigc::slot instead.
 522.528 ++ * @ingroup compat
 522.529 ++ */
 522.530 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
 522.531 ++class Slot7
 522.532 ++  : public ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
 522.533 + {
 522.534 ++public:
 522.535 ++  typedef ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7> parent_type;
 522.536 ++
 522.537 ++  /// Constructs an empty slot.
 522.538 ++  Slot7() {}
 522.539 ++
 522.540 ++  /** Constructs a slot from an arbitrary functor.
 522.541 ++   * @param _A_func The desired functor the new slot should be assigned to.
 522.542 ++   */
 522.543 ++  template <class T_functor>
 522.544 ++  Slot7(const T_functor& _A_func)
 522.545 ++    : ::sigc::slot<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>(_A_func) {}
 522.546 ++
 522.547 ++  /** Constructs a slot, copying an existing one.
 522.548 ++   * @param src The existing slot to copy.
 522.549 ++   */
 522.550 ++  Slot7(const parent_type& src)
 522.551 ++    : parent_type(src) {}
 522.552 ++
 522.553 ++  /** Overrides this slot making a copy from another slot.
 522.554 ++   * @param src The slot from which to make a copy.
 522.555 ++   * @return @p this.
 522.556 ++   */
 522.557 ++  Slot7& operator=(const parent_type& src)
 522.558 ++    { parent_type::operator=(src); return *this; }
 522.559 ++};
 522.560 ++
 522.561 ++
 522.562 ++
 522.563 ++#ifndef DOXYGEN_SHOULD_SKIP_THIS
 522.564 ++/* gcc 3.2 reports a strange conflict between SigC::slot() and sigc::slot<>
 522.565 ++ * when "using namespace SigC" and later using a slot(obj,func) overload
 522.566 ++ * without the prefix "SigC::". Probably a compiler bug. I will investigate.
 522.567 ++ *
 522.568 ++ * This ugly hack avoids the error:
 522.569 ++ */
 522.570 ++// #define slot(...) make_slot(__VA_ARGS__) /* only works for gcc */
 522.571 ++#endif
 522.572 + 
 522.573 ++
 522.574 ++// slot()
 522.575 ++/** Creates a functor of type SigC::Slot0 that wraps an existing non-member function.
 522.576 ++ *
 522.577 ++ * @param _A_func Pointer to function that should be wrapped.
 522.578 ++ * @return Functor that executes _A_func on invokation.
 522.579 ++ *
 522.580 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.581 ++ * @ingroup compat
 522.582 ++ */
 522.583 ++template <class T_return>
 522.584 ++inline Slot0<T_return>
 522.585 ++slot(T_return (*_A_func)())
 522.586 ++{ return Slot0<T_return>(_A_func); }
 522.587 ++
 522.588 ++/** Creates a functor of type SigC::Slot1 that wraps an existing non-member function.
 522.589 ++ *
 522.590 ++ * @param _A_func Pointer to function that should be wrapped.
 522.591 ++ * @return Functor that executes _A_func on invokation.
 522.592 ++ *
 522.593 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.594 ++ * @ingroup compat
 522.595 ++ */
 522.596 ++template <class T_return, class T_arg1>
 522.597 ++inline Slot1<T_return, T_arg1>
 522.598 ++slot(T_return (*_A_func)(T_arg1))
 522.599 ++{ return Slot1<T_return, T_arg1>(_A_func); }
 522.600 ++
 522.601 ++/** Creates a functor of type SigC::Slot2 that wraps an existing non-member function.
 522.602 ++ *
 522.603 ++ * @param _A_func Pointer to function that should be wrapped.
 522.604 ++ * @return Functor that executes _A_func on invokation.
 522.605 ++ *
 522.606 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.607 ++ * @ingroup compat
 522.608 ++ */
 522.609 ++template <class T_return, class T_arg1,class T_arg2>
 522.610 ++inline Slot2<T_return, T_arg1,T_arg2>
 522.611 ++slot(T_return (*_A_func)(T_arg1,T_arg2))
 522.612 ++{ return Slot2<T_return, T_arg1,T_arg2>(_A_func); }
 522.613 ++
 522.614 ++/** Creates a functor of type SigC::Slot3 that wraps an existing non-member function.
 522.615 ++ *
 522.616 ++ * @param _A_func Pointer to function that should be wrapped.
 522.617 ++ * @return Functor that executes _A_func on invokation.
 522.618 ++ *
 522.619 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.620 ++ * @ingroup compat
 522.621 ++ */
 522.622 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3>
 522.623 ++inline Slot3<T_return, T_arg1,T_arg2,T_arg3>
 522.624 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3))
 522.625 ++{ return Slot3<T_return, T_arg1,T_arg2,T_arg3>(_A_func); }
 522.626 ++
 522.627 ++/** Creates a functor of type SigC::Slot4 that wraps an existing non-member function.
 522.628 ++ *
 522.629 ++ * @param _A_func Pointer to function that should be wrapped.
 522.630 ++ * @return Functor that executes _A_func on invokation.
 522.631 ++ *
 522.632 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.633 ++ * @ingroup compat
 522.634 ++ */
 522.635 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4>
 522.636 ++inline Slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4>
 522.637 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4))
 522.638 ++{ return Slot4<T_return, T_arg1,T_arg2,T_arg3,T_arg4>(_A_func); }
 522.639 ++
 522.640 ++/** Creates a functor of type SigC::Slot5 that wraps an existing non-member function.
 522.641 ++ *
 522.642 ++ * @param _A_func Pointer to function that should be wrapped.
 522.643 ++ * @return Functor that executes _A_func on invokation.
 522.644 ++ *
 522.645 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.646 ++ * @ingroup compat
 522.647 ++ */
 522.648 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5>
 522.649 ++inline Slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>
 522.650 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5))
 522.651 ++{ return Slot5<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5>(_A_func); }
 522.652 ++
 522.653 ++/** Creates a functor of type SigC::Slot6 that wraps an existing non-member function.
 522.654 ++ *
 522.655 ++ * @param _A_func Pointer to function that should be wrapped.
 522.656 ++ * @return Functor that executes _A_func on invokation.
 522.657 ++ *
 522.658 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.659 ++ * @ingroup compat
 522.660 ++ */
 522.661 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6>
 522.662 ++inline Slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>
 522.663 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6))
 522.664 ++{ return Slot6<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6>(_A_func); }
 522.665 ++
 522.666 ++/** Creates a functor of type SigC::Slot7 that wraps an existing non-member function.
 522.667 ++ *
 522.668 ++ * @param _A_func Pointer to function that should be wrapped.
 522.669 ++ * @return Functor that executes _A_func on invokation.
 522.670 ++ *
 522.671 ++ * @deprecated Use sigc::ptr_fun() instead.
 522.672 ++ * @ingroup compat
 522.673 ++ */
 522.674 ++template <class T_return, class T_arg1,class T_arg2,class T_arg3,class T_arg4,class T_arg5,class T_arg6,class T_arg7>
 522.675 ++inline Slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>
 522.676 ++slot(T_return (*_A_func)(T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7))
 522.677 ++{ return Slot7<T_return, T_arg1,T_arg2,T_arg3,T_arg4,T_arg5,T_arg6,T_arg7>(_A_func); }
 522.678 ++
 522.679 ++
 522.680 ++
 522.681 ++}
 522.682 ++
 522.683 ++// From sigc++/object.h
 522.684 ++namespace SigC {
 522.685 ++
 522.686 ++// Object
 522.687 ++typedef ::sigc::trackable Object;
 522.688 ++
 522.689 ++}
 522.690 ++
 522.691 ++namespace SigC
 522.692 ++{
 522.693 + template <class T_return, class T_obj1, class T_obj2>
 522.694 + inline Slot0<T_return>
 522.695 + slot( T_obj1& _A_obj, T_return (T_obj2::*_A_func)() )
   523.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   523.2 +++ b/visualboyadvance/stuff/patches/1.7.2-gcc34.patch	Thu May 10 21:12:00 2018 +0300
   523.3 @@ -0,0 +1,41 @@
   523.4 +diff -ur src/gtk/joypadconfig.h src/gtk/joypadconfig.h
   523.5 +--- src/gtk/joypadconfig.h	2004-05-10 16:43:21.000000000 +0200
   523.6 ++++ src/gtk/joypadconfig.h	2004-08-12 22:30:20.838039064 +0200
   523.7 +@@ -22,8 +22,8 @@
   523.8 + 
   523.9 + #include <vector>
  523.10 + 
  523.11 +-#include <libglademm.h>
  523.12 + #include <gtkmm.h>
  523.13 ++#include <libglademm.h>
  523.14 + 
  523.15 + #ifndef GTKMM20
  523.16 + # include "sigccompat.h"
  523.17 +diff -ur src/gtk/main.cpp src/gtk/main.cpp
  523.18 +--- src/gtk/main.cpp	2004-05-21 18:02:35.000000000 +0200
  523.19 ++++ src/gtk/main.cpp	2004-08-12 22:39:08.633801912 +0200
  523.20 +@@ -22,10 +22,10 @@
  523.21 + 
  523.22 + #include <list>
  523.23 + 
  523.24 +-#include <libglademm.h>
  523.25 + #include <gtkmm/main.h>
  523.26 + #include <gtkmm/window.h>
  523.27 + #include <gtkmm/messagedialog.h>
  523.28 ++#include <libglademm.h>
  523.29 + 
  523.30 + #include "images/vba-wm-pixbufs.h"
  523.31 + 
  523.32 +diff -ur src/gtk/window.h src/gtk/window.h
  523.33 +--- src/gtk/window.h	2004-05-21 15:25:41.000000000 +0200
  523.34 ++++ src/gtk/window.h	2004-08-12 22:30:58.650290728 +0200
  523.35 +@@ -23,8 +23,8 @@
  523.36 + #include <sys/types.h>
  523.37 + #include <stdarg.h>
  523.38 + 
  523.39 +-#include <libglademm.h>
  523.40 + #include <gtkmm.h>
  523.41 ++#include <libglademm.h>
  523.42 + 
  523.43 + #ifndef GTKMM20
  523.44 + # include "sigccompat.h"
   524.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   524.2 +++ b/visualboyadvance/stuff/patches/1.7.2-gcc41.patch	Thu May 10 21:12:00 2018 +0300
   524.3 @@ -0,0 +1,27 @@
   524.4 +diff -ru src/prof/prof.cpp src/prof/prof.cpp
   524.5 +--- src/prof/prof.cpp	2004-05-14 00:31:58.000000000 +1000
   524.6 ++++ src/prof/prof.cpp	2006-06-03 13:49:41.000000000 +1000
   524.7 +@@ -266,7 +266,7 @@
   524.8 +     for (toindex=froms[fromindex]; toindex!=0; toindex=tos[toindex].link) {
   524.9 +       if(profWrite8(fd, GMON_TAG_CG_ARC) ||
  524.10 +          profWrite32(fd, (u32)frompc) ||
  524.11 +-         profWrite32(fd, (u32)tos[toindex].selfpc) ||
  524.12 ++         profWrite32(fd, (u32)(intptr_t)tos[toindex].selfpc) ||
  524.13 +          profWrite32(fd, tos[toindex].count)) {
  524.14 +         systemMessage(0, "mcount: arc");
  524.15 +         fclose(fd);
  524.16 +diff -ru src/sdl/debugger.cpp src/sdl/debugger.cpp
  524.17 +--- src/sdl/debugger.cpp	2004-05-14 00:13:14.000000000 +1000
  524.18 ++++ src/sdl/debugger.cpp	2006-06-03 13:49:57.000000000 +1000
  524.19 +@@ -950,9 +950,9 @@
  524.20 + {
  524.21 +   u32 address = 0;
  524.22 +   if(mem >= (u32*)&workRAM[0] && mem <= (u32*)&workRAM[0x3ffff])
  524.23 +-    address = 0x2000000 + ((u32)mem - (u32)&workRAM[0]);
  524.24 ++    address = 0x2000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&workRAM[0]);
  524.25 +   else
  524.26 +-    address = 0x3000000 + ((u32)mem - (u32)&internalRAM[0]);
  524.27 ++    address = 0x3000000 + ((u32)(intptr_t)mem - (u32)(intptr_t)&internalRAM[0]);
  524.28 + 
  524.29 +   if(size == 2)
  524.30 +     printf("Breakpoint (on write) address %08x old:%08x new:%08x\n", 
   525.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   525.2 +++ b/visualboyadvance/stuff/patches/1.7.2-glibc.patch	Thu May 10 21:12:00 2018 +0300
   525.3 @@ -0,0 +1,76 @@
   525.4 +--- src/GBA.cpp
   525.5 ++++ src/GBA.cpp
   525.6 +@@ -1130,7 +1130,7 @@
   525.7 + bool CPUIsZipFile(const char * file)
   525.8 + {
   525.9 +   if(strlen(file) > 4) {
  525.10 +-    char * p = strrchr(file,'.');
  525.11 ++    const char * p = strrchr(file,'.');
  525.12 + 
  525.13 +     if(p != NULL) {
  525.14 +       if(_stricmp(p, ".zip") == 0)
  525.15 +@@ -1145,7 +1145,7 @@
  525.16 + {
  525.17 +   cpuIsMultiBoot = false;
  525.18 +   if(strlen(file) > 4) {
  525.19 +-    char * p = strrchr(file,'.');
  525.20 ++    const char * p = strrchr(file,'.');
  525.21 + 
  525.22 +     if(p != NULL) {
  525.23 +       if(_stricmp(p, ".gba") == 0)
  525.24 +@@ -1169,7 +1169,7 @@
  525.25 + bool CPUIsGBABios(const char * file)
  525.26 + {
  525.27 +   if(strlen(file) > 4) {
  525.28 +-    char * p = strrchr(file,'.');
  525.29 ++    const char * p = strrchr(file,'.');
  525.30 + 
  525.31 +     if(p != NULL) {
  525.32 +       if(_stricmp(p, ".gba") == 0)
  525.33 +@@ -1189,7 +1189,7 @@
  525.34 + bool CPUIsELF(const char *file)
  525.35 + {
  525.36 +   if(strlen(file) > 4) {
  525.37 +-    char * p = strrchr(file,'.');
  525.38 ++    const char * p = strrchr(file,'.');
  525.39 +     
  525.40 +     if(p != NULL) {
  525.41 +       if(_stricmp(p, ".elf") == 0)
  525.42 +--- src/Util.cpp
  525.43 ++++ src/Util.cpp
  525.44 +@@ -478,7 +478,7 @@
  525.45 + {
  525.46 +   cpuIsMultiBoot = false;
  525.47 +   if(strlen(file) > 4) {
  525.48 +-    char * p = strrchr(file,'.');
  525.49 ++    const char * p = strrchr(file,'.');
  525.50 + 
  525.51 +     if(p != NULL) {
  525.52 +       if(_stricmp(p, ".gba") == 0)
  525.53 +@@ -502,7 +502,7 @@
  525.54 + bool utilIsGBImage(const char * file)
  525.55 + {
  525.56 +   if(strlen(file) > 4) {
  525.57 +-    char * p = strrchr(file,'.');
  525.58 ++    const char * p = strrchr(file,'.');
  525.59 + 
  525.60 +     if(p != NULL) {
  525.61 +       if(_stricmp(p, ".gb") == 0)
  525.62 +@@ -522,7 +522,7 @@
  525.63 + bool utilIsZipFile(const char *file)
  525.64 + {
  525.65 +   if(strlen(file) > 4) {
  525.66 +-    char * p = strrchr(file,'.');
  525.67 ++    const char * p = strrchr(file,'.');
  525.68 + 
  525.69 +     if(p != NULL) {
  525.70 +       if(_stricmp(p, ".zip") == 0)
  525.71 +@@ -552,7 +552,7 @@
  525.72 + bool utilIsGzipFile(const char *file)
  525.73 + {
  525.74 +   if(strlen(file) > 3) {
  525.75 +-    char * p = strrchr(file,'.');
  525.76 ++    const char * p = strrchr(file,'.');
  525.77 + 
  525.78 +     if(p != NULL) {
  525.79 +       if(_stricmp(p, ".gz") == 0)
   526.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   526.2 +++ b/visualboyadvance/stuff/patches/1.7.2-homedir.patch	Thu May 10 21:12:00 2018 +0300
   526.3 @@ -0,0 +1,11 @@
   526.4 +--- src/sdl/SDL.cpp.orig	2004-08-15 02:43:28.232750688 -0400
   526.5 ++++ src/sdl/SDL.cpp	2004-08-15 02:44:01.557684528 -0400
   526.6 +@@ -887,7 +887,7 @@
   526.7 + 
   526.8 +   if(home != NULL) {
   526.9 +     fprintf(stderr, "Searching home directory: %s\n", home);
  526.10 +-    sprintf(path, "%s%c%s", home, FILE_SEP, name);
  526.11 ++    sprintf(path, "%s%c.%s%c%s", home, FILE_SEP, EXE_NAME, FILE_SEP, name);
  526.12 +     f = fopen(path, "r");
  526.13 +     if(f != NULL)
  526.14 +       return f;
   527.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   527.2 +++ b/visualboyadvance/stuff/patches/1.7.2-uninit.patch	Thu May 10 21:12:00 2018 +0300
   527.3 @@ -0,0 +1,13 @@
   527.4 +diff -ru src/gtk/window.cpp src/gtk/window.cpp
   527.5 +--- src/gtk/window.cpp	2004-05-14 00:31:58.000000000 +1000
   527.6 ++++ src/gtk/window.cpp	2007-03-17 14:57:22.000000000 -0500
   527.7 +@@ -91,7 +91,8 @@
   527.8 +   m_iFilterIBMin    (FirstFilterIB),
   527.9 +   m_iFilterIBMax    (LastFilterIB),
  527.10 +   m_iJoypadMin      (1),
  527.11 +-  m_iJoypadMax      (4)
  527.12 ++  m_iJoypadMax      (4),
  527.13 ++  m_poKeymap        (NULL)
  527.14 + {
  527.15 +   m_poXml            = _poXml;
  527.16 +   m_poFileOpenDialog = NULL;
   528.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   528.2 +++ b/visualboyadvance/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   528.3 @@ -0,0 +1,6 @@
   528.4 +-Np0|1.7.2-deprecatedsigc++.patch
   528.5 +-Np0|1.7.2-gcc34.patch
   528.6 +-Np0|1.7.2-gcc41.patch
   528.7 +-Np0|1.7.2-glibc.patch
   528.8 +-Np0|1.7.2-homedir.patch
   528.9 +-Np0|1.7.2-uninit.patch
   529.1 --- a/volumeicon/receipt	Wed May 09 17:03:28 2018 +0300
   529.2 +++ b/volumeicon/receipt	Thu May 10 21:12:00 2018 +0300
   529.3 @@ -16,7 +16,6 @@
   529.4  # Rules to configure and make the package.
   529.5  compile_rules()
   529.6  {
   529.7 -	patch -p0 < $stuff/alsa_backend.patch
   529.8  	./configure --enable-notify $CONFIGURE_ARGS && 
   529.9  	make && make install
  529.10  }
   530.1 --- a/volumeicon/stuff/alsa_backend.patch	Wed May 09 17:03:28 2018 +0300
   530.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   530.3 @@ -1,14 +0,0 @@
   530.4 ---- src/alsa_backend.new.c
   530.5 -+++ src/alsa_backend.c
   530.6 -@@ -22,10 +22,7 @@
   530.7 - //##############################################################################
   530.8 - 
   530.9 - #include <alsa/asoundlib.h>
  530.10 --#include <glib/gstring.h>
  530.11 --#include <glib/gstdio.h>
  530.12 --#include <glib/glist.h>
  530.13 --#include <glib/giochannel.h>
  530.14 -+#include <glib.h>
  530.15 - 
  530.16 - #include "alsa_backend.h"
  530.17 - 
   531.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   531.2 +++ b/volumeicon/stuff/patches/alsa_backend.patch	Thu May 10 21:12:00 2018 +0300
   531.3 @@ -0,0 +1,14 @@
   531.4 +--- src/alsa_backend.new.c
   531.5 ++++ src/alsa_backend.c
   531.6 +@@ -22,10 +22,7 @@
   531.7 + //##############################################################################
   531.8 + 
   531.9 + #include <alsa/asoundlib.h>
  531.10 +-#include <glib/gstring.h>
  531.11 +-#include <glib/gstdio.h>
  531.12 +-#include <glib/glist.h>
  531.13 +-#include <glib/giochannel.h>
  531.14 ++#include <glib.h>
  531.15 + 
  531.16 + #include "alsa_backend.h"
  531.17 + 
   532.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   532.2 +++ b/volumeicon/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   532.3 @@ -0,0 +1,1 @@
   532.4 +-p0|alsa_backend.patch
   533.1 --- a/vzctl/receipt	Wed May 09 17:03:28 2018 +0300
   533.2 +++ b/vzctl/receipt	Thu May 10 21:12:00 2018 +0300
   533.3 @@ -14,19 +14,6 @@
   533.4  BUILD_DEPENDS="sed"
   533.5  
   533.6  compile_rules() {
   533.7 -	# Apply patches
   533.8 -	while read patch_file; do
   533.9 -		if [ -f done.$patch_file ]; then
  533.10 -			echo "Skipping $patch_file"
  533.11 -			continue
  533.12 -		fi
  533.13 -		echo "Apply $patch_file"
  533.14 -		patch -p1 < $stuff/$patch_file || return 1
  533.15 -		touch done.$patch_file
  533.16 -	done <<EOT
  533.17 -vzctl-${VERSION}-Makefile.u
  533.18 -EOT
  533.19 -
  533.20  	./configure \
  533.21  		--enable-bashcomp \
  533.22  		--enable-logrotate \
   534.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   534.2 +++ b/vzctl/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   534.3 @@ -0,0 +1,1 @@
   534.4 +-p1|vzctl-3.0.25.1-Makefile.u
   535.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   535.2 +++ b/vzctl/stuff/patches/vzctl-3.0.25.1-Makefile.u	Thu May 10 21:12:00 2018 +0300
   535.3 @@ -0,0 +1,133 @@
   535.4 +--- vzctl-3.0.25.1-ori/Makefile.am	Fri Dec 24 12:45:32 2010
   535.5 ++++ vzctl-3.0.25.1/Makefile.am	Fri Dec 31 09:27:42 2010
   535.6 +@@ -49,7 +49,8 @@
   535.7 + 	install-redhat \
   535.8 + 	install-gentoo \
   535.9 + 	install-suse \
  535.10 +-	install-debian
  535.11 ++	install-debian\
  535.12 ++	install-slitaz
  535.13 + 
  535.14 + DISTRO_TARGETS_ALL = \
  535.15 + 	$(DISTRO_TARGETS) \
  535.16 +--- vzctl-3.0.25.1-ori/Makefile.in	Fri Dec 24 12:45:44 2010
  535.17 ++++ vzctl-3.0.25.1/Makefile.in	Fri Dec 31 09:27:42 2010
  535.18 +@@ -266,7 +266,8 @@
  535.19 + 	install-redhat \
  535.20 + 	install-gentoo \
  535.21 + 	install-suse \
  535.22 +-	install-debian
  535.23 ++	install-debian \
  535.24 ++	install-slitaz
  535.25 + 
  535.26 + DISTRO_TARGETS_ALL = \
  535.27 + 	$(DISTRO_TARGETS) \
  535.28 +--- vzctl-3.0.25.1-ori/bin/Makefile.am	Fri Dec 24 12:45:38 2010
  535.29 ++++ vzctl-3.0.25.1/bin/Makefile.am	Fri Dec 31 09:35:38 2010
  535.30 +@@ -57,6 +57,8 @@
  535.31 + 
  535.32 + install-debian:
  535.33 + 
  535.34 ++install-slitaz: 
  535.35 ++
  535.36 + install-gentoo:
  535.37 + 	@echo
  535.38 + 	@echo "***************************************************"
  535.39 +--- vzctl-3.0.25.1-ori/bin/Makefile.in	Fri Dec 24 12:45:43 2010
  535.40 ++++ vzctl-3.0.25.1/bin/Makefile.in	Fri Dec 31 09:35:39 2010
  535.41 +@@ -530,6 +530,8 @@
  535.42 + 
  535.43 + install-debian:
  535.44 + 
  535.45 ++install-slitaz: 
  535.46 ++
  535.47 + install-gentoo:
  535.48 + 	@echo
  535.49 + 	@echo "***************************************************"
  535.50 +--- vzctl-3.0.25.1-ori/etc/Makefile.am	Fri Dec 24 12:45:34 2010
  535.51 ++++ vzctl-3.0.25.1/etc/Makefile.am	Fri Dec 31 09:27:42 2010
  535.52 +@@ -50,3 +50,6 @@
  535.53 + 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  535.54 + 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/conf.d
  535.55 + 	$(LN_S) $(pkgconfdir)/vz.conf $(DESTDIR)$(sysconfdir)/conf.d/vz
  535.56 ++	
  535.57 ++install-slitaz:
  535.58 ++	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  535.59 +--- vzctl-3.0.25.1-ori/etc/Makefile.in	Fri Dec 24 12:45:43 2010
  535.60 ++++ vzctl-3.0.25.1/etc/Makefile.in	Fri Dec 31 09:27:42 2010
  535.61 +@@ -683,6 +683,10 @@
  535.62 + 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/conf.d
  535.63 + 	$(LN_S) $(pkgconfdir)/vz.conf $(DESTDIR)$(sysconfdir)/conf.d/vz
  535.64 + 
  535.65 ++install-slitaz:
  535.66 ++	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  535.67 ++
  535.68 ++
  535.69 + # Tell versions [3.59,3.63) of GNU make to not export all variables.
  535.70 + # Otherwise a system limit (for SysV at least) may be exceeded.
  535.71 + .NOEXPORT:
  535.72 +--- vzctl-3.0.25.1-ori/etc/init.d/Makefile.am	Fri Dec 24 12:45:34 2010
  535.73 ++++ vzctl-3.0.25.1/etc/init.d/Makefile.am	Fri Dec 31 09:27:42 2010
  535.74 +@@ -33,6 +33,8 @@
  535.75 + 
  535.76 + install-debian: install-redhat
  535.77 + 
  535.78 ++install-slitaz: install-redhat
  535.79 ++
  535.80 + install-gentoo: vz-gentoo vzeventd-gentoo
  535.81 + 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  535.82 + 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  535.83 +--- vzctl-3.0.25.1-ori/etc/init.d/Makefile.in	Fri Dec 24 12:45:43 2010
  535.84 ++++ vzctl-3.0.25.1/etc/init.d/Makefile.in	Fri Dec 31 09:27:40 2010
  535.85 +@@ -492,6 +492,8 @@
  535.86 + 
  535.87 + install-debian: install-redhat
  535.88 + 
  535.89 ++install-slitaz: install-redhat
  535.90 ++
  535.91 + install-gentoo: vz-gentoo vzeventd-gentoo
  535.92 + 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  535.93 + 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  535.94 +--- vzctl-3.0.25.1-ori/etc/init.d/initd-functions.in	Fri Dec 24 12:45:35 2010
  535.95 ++++ vzctl-3.0.25.1/etc/init.d/initd-functions.in	Sun Jan  2 14:29:21 2011
  535.96 +@@ -28,6 +28,9 @@
  535.97 + elif [ -r /etc/debian_version ]; then
  535.98 + 	DISTR=debian
  535.99 + 	VARLOCK=/var/lock
 535.100 ++elif [ -r /etc/slitaz-release ]; then
 535.101 ++	DISTR=slitaz
 535.102 ++	VARLOCK=/var/lock
 535.103 + fi
 535.104 + 
 535.105 + print_success()
 535.106 +--- vzctl-3.0.25.1-ori/etc/init.d/vz-redhat.in	Fri Dec 24 12:45:35 2010
 535.107 ++++ vzctl-3.0.25.1/etc/init.d/vz-redhat.in	Fri Dec 31 14:50:22 2010
 535.108 +@@ -189,7 +189,7 @@
 535.109 + 	if [ "${IPV6}" = "yes" ]; then
 535.110 + 		ip -6 addr add fe80::1/128 dev $VZDEV
 535.111 + 	fi
 535.112 +-	sysctl -q -w net.ipv4.conf.$VZDEV.send_redirects=0
 535.113 ++	sysctl -w net.ipv4.conf.$VZDEV.send_redirects=0
 535.114 + 	if [ "$(sysctl -n -e net.ipv4.ip_forward)" != "1" ]; then
 535.115 + 		print_warning "IP forwarding is not enabled"
 535.116 + 	fi
 535.117 +@@ -242,7 +242,7 @@
 535.118 + 	need_restart=""
 535.119 + 	velist=$(vzlist -aH -octid,onboot -s-bootorder |
 535.120 + 		awk '$2 == "yes" {print $1}')
 535.121 +-	sysctl -q -w net.ipv4.route.src_check=0
 535.122 ++	sysctl -w net.ipv4.route.src_check=0
 535.123 + 	for veid in $velist; do
 535.124 + 		[ "${veid}" = "0" ] && continue
 535.125 + 		__echo "Starting CT ${veid}: "
 535.126 +--- vzctl-3.0.25.1-ori/scripts/vps-create.in	Fri Dec 24 12:45:37 2010
 535.127 ++++ vzctl-3.0.25.1/scripts/vps-create.in	Fri Dec 31 14:53:35 2010
 535.128 +@@ -38,7 +38,7 @@
 535.129 + 		vzerror "Tarball does not exist: $PRIVATE_TEMPLATE" ${VZ_FS_NEW_VE_PRVT}
 535.130 + 	HEADER="$(od -A n -N 2 -t x1 -- "$PRIVATE_TEMPLATE")" ||
 535.131 + 		vzerror "Invalid tarball: $PRIVATE_TEMPLATE" ${VZ_FS_NEW_VE_PRVT}
 535.132 +-	TMP="$(df -P "$VE_PRVT")" ||
 535.133 ++	TMP="$(df "$VE_PRVT")" ||
 535.134 + 		vzerror "Failed to calculate available disk space on $VE_PRVT" ${VZ_FS_NEW_VE_PRVT}
 535.135 + 	AVAIL="$(echo "$TMP" | awk 'END{print $4}')"
 535.136 + 	if [ "$HEADER" = ' 1f 8b' ]; then
   536.1 --- a/vzctl/stuff/vzctl-3.0.23-Makefile.u	Wed May 09 17:03:28 2018 +0300
   536.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   536.3 @@ -1,70 +0,0 @@
   536.4 ---- vzctl-3.0.23-ori/Makefile.am	Thu Oct 30 14:24:43 2008
   536.5 -+++ vzctl-3.0.23/Makefile.am	Mon Nov 16 16:32:40 2009
   536.6 -@@ -49,7 +49,8 @@
   536.7 - 	install-redhat \
   536.8 - 	install-gentoo \
   536.9 - 	install-suse \
  536.10 --	install-debian
  536.11 -+	install-debian \
  536.12 -+	install-slitaz
  536.13 - 
  536.14 - $(DISTRO_TARGETS):
  536.15 - 	$(MAKE) $(AM_MAKEFLAGS) -C etc $@
  536.16 ---- vzctl-3.0.23-ori/Makefile.in	Thu Oct 30 14:24:52 2008
  536.17 -+++ vzctl-3.0.23/Makefile.in	Mon Nov 16 16:33:11 2009
  536.18 -@@ -217,7 +217,8 @@
  536.19 - 	install-redhat \
  536.20 - 	install-gentoo \
  536.21 - 	install-suse \
  536.22 --	install-debian
  536.23 -+	install-debian \
  536.24 -+	install-slitaz
  536.25 - 
  536.26 - all: all-recursive
  536.27 - 
  536.28 ---- vzctl-3.0.23-ori/etc/Makefile.am	Thu Oct 30 14:24:43 2008
  536.29 -+++ vzctl-3.0.23/etc/Makefile.am	Mon Nov 16 16:33:39 2009
  536.30 -@@ -43,6 +43,9 @@
  536.31 - 
  536.32 - install-debian:
  536.33 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  536.34 -+	
  536.35 -+install-slitaz:
  536.36 -+	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  536.37 - 
  536.38 - install-gentoo:
  536.39 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  536.40 ---- vzctl-3.0.23-ori/etc/Makefile.in	Thu Oct 30 14:24:49 2008
  536.41 -+++ vzctl-3.0.23/etc/Makefile.in	Mon Nov 16 16:34:00 2009
  536.42 -@@ -563,6 +563,9 @@
  536.43 - install-debian:
  536.44 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  536.45 - 
  536.46 -+install-slitaz:
  536.47 -+	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  536.48 -+	
  536.49 - install-gentoo:
  536.50 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  536.51 - 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/conf.d
  536.52 ---- vzctl-3.0.23-ori/etc/init.d/Makefile.am	Thu Oct 30 14:24:43 2008
  536.53 -+++ vzctl-3.0.23/etc/init.d/Makefile.am	Mon Nov 16 16:34:25 2009
  536.54 -@@ -31,6 +31,8 @@
  536.55 - 
  536.56 - install-debian: install-redhat
  536.57 - 
  536.58 -+install-slitaz: install-redhat
  536.59 -+
  536.60 - install-gentoo: vz-gentoo
  536.61 - 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  536.62 - 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  536.63 ---- vzctl-3.0.23-ori/etc/init.d/Makefile.in	Thu Oct 30 14:24:50 2008
  536.64 -+++ vzctl-3.0.23/etc/init.d/Makefile.in	Mon Nov 16 16:34:40 2009
  536.65 -@@ -404,6 +404,8 @@
  536.66 - 
  536.67 - install-debian: install-redhat
  536.68 - 
  536.69 -+install-slitaz: install-redhat
  536.70 -+
  536.71 - install-gentoo: vz-gentoo
  536.72 - 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  536.73 - 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
   537.1 --- a/vzctl/stuff/vzctl-3.0.23.u	Wed May 09 17:03:28 2018 +0300
   537.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   537.3 @@ -1,102 +0,0 @@
   537.4 ---- vzctl-3.0.23-ori/Makefile.am	Thu Oct 30 14:24:43 2008
   537.5 -+++ vzctl-3.0.23/Makefile.am	Mon Nov 16 21:43:03 2009
   537.6 -@@ -49,7 +49,8 @@
   537.7 - 	install-redhat \
   537.8 - 	install-gentoo \
   537.9 - 	install-suse \
  537.10 --	install-debian
  537.11 -+	install-debian \
  537.12 -+	install-slitaz
  537.13 - 
  537.14 - $(DISTRO_TARGETS):
  537.15 - 	$(MAKE) $(AM_MAKEFLAGS) -C etc $@
  537.16 ---- vzctl-3.0.23-ori/Makefile.in	Thu Oct 30 14:24:52 2008
  537.17 -+++ vzctl-3.0.23/Makefile.in	Mon Nov 16 21:43:03 2009
  537.18 -@@ -217,7 +217,8 @@
  537.19 - 	install-redhat \
  537.20 - 	install-gentoo \
  537.21 - 	install-suse \
  537.22 --	install-debian
  537.23 -+	install-debian \
  537.24 -+	install-slitaz
  537.25 - 
  537.26 - all: all-recursive
  537.27 - 
  537.28 ---- vzctl-3.0.23-ori/etc/Makefile.am	Thu Oct 30 14:24:43 2008
  537.29 -+++ vzctl-3.0.23/etc/Makefile.am	Mon Nov 16 21:43:03 2009
  537.30 -@@ -43,6 +43,9 @@
  537.31 - 
  537.32 - install-debian:
  537.33 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  537.34 -+	
  537.35 -+install-slitaz:
  537.36 -+	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  537.37 - 
  537.38 - install-gentoo:
  537.39 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  537.40 ---- vzctl-3.0.23-ori/etc/Makefile.in	Thu Oct 30 14:24:49 2008
  537.41 -+++ vzctl-3.0.23/etc/Makefile.in	Mon Nov 16 21:43:03 2009
  537.42 -@@ -563,6 +563,9 @@
  537.43 - install-debian:
  537.44 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  537.45 - 
  537.46 -+install-slitaz:
  537.47 -+	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  537.48 -+	
  537.49 - install-gentoo:
  537.50 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  537.51 - 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/conf.d
  537.52 ---- vzctl-3.0.23-ori/etc/init.d/Makefile.am	Thu Oct 30 14:24:43 2008
  537.53 -+++ vzctl-3.0.23/etc/init.d/Makefile.am	Mon Nov 16 21:46:42 2009
  537.54 -@@ -31,6 +31,11 @@
  537.55 - 
  537.56 - install-debian: install-redhat
  537.57 - 
  537.58 -+install-slitaz: 
  537.59 -+	$(mkinstalldirs) $(DESTDIR)$(initddir)
  537.60 -+	$(INSTALL_SCRIPT) vz-redhat $(DESTDIR)$(initddir)/vz
  537.61 -+	sed -e 's!/subsys!!'
  537.62 -+
  537.63 - install-gentoo: vz-gentoo
  537.64 - 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  537.65 - 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  537.66 ---- vzctl-3.0.23-ori/etc/init.d/Makefile.in	Thu Oct 30 14:24:50 2008
  537.67 -+++ vzctl-3.0.23/etc/init.d/Makefile.in	Mon Nov 16 22:12:15 2009
  537.68 -@@ -404,6 +404,11 @@
  537.69 - 
  537.70 - install-debian: install-redhat
  537.71 - 
  537.72 -+install-slitaz: install-redhat
  537.73 -+	sed -i -e 's!/subsys!!' $(DESTDIR)$(initddir)/vz
  537.74 -+	sed -i -e 's/sysctl -q/sysctl -n/' $(DESTDIR)$(initddir)/vz
  537.75 -+	
  537.76 -+
  537.77 - install-gentoo: vz-gentoo
  537.78 - 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  537.79 - 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  537.80 ---- vzctl-3.0.23-ori/scripts/vps-create.in	Thu Oct 30 14:24:43 2008
  537.81 -+++ vzctl-3.0.23/scripts/vps-create.in	Mon Nov 16 22:26:20 2009
  537.82 -@@ -37,7 +37,7 @@
  537.83 - 		vzerror "Tarball does not exist: $PRIVATE_TEMPLATE" ${VZ_FS_NEW_VE_PRVT}
  537.84 - 	HEADER="$(od -A n -N 2 -t x1 -- "$PRIVATE_TEMPLATE")" ||
  537.85 - 		vzerror "Invalid tarball: $PRIVATE_TEMPLATE" ${VZ_FS_NEW_VE_PRVT}
  537.86 --	TMP="$(df -P "$VE_PRVT")" ||
  537.87 -+	TMP="$(df "$VE_PRVT")" ||
  537.88 - 		vzerror "Failed to calculate available disk space on $VE_PRVT" ${VZ_FS_NEW_VE_PRVT}
  537.89 - 	AVAIL="$(echo "$TMP" | awk 'END{print $4}')"
  537.90 - 	if [ "$HEADER" = ' 1f 8b' ]; then
  537.91 ---- vzctl-3.0.23-ori/scripts/vps-functions.in	Thu Oct 30 14:24:43 2008
  537.92 -+++ vzctl-3.0.23/scripts/vps-functions.in	Mon Nov 16 22:25:52 2009
  537.93 -@@ -126,10 +126,10 @@
  537.94 - 
  537.95 - 	route="$(${IP_CMD} route get "$1" |grep ' dev .* src ')"
  537.96 - 	# match: $1 ... dev $dev ...
  537.97 --	dev="$(echo "$route" |sed -ne '/ via /! s/^.* dev \+\([^ ]\+\) .*$/\1/p;Q')"
  537.98 -+	dev="$(echo "$route" |sed -ne '/ via /! s/^.* dev \+\([^ ]\+\) .*$/\1/p;q')"
  537.99 - 	[ -n "$dev" ] ||
 537.100 - 	# match: $1 ... via $1 ... dev $dev ...
 537.101 --	dev="$(echo "$route" |sed -ne 's/^\([^ ]\+\) \(.* \)\?via \+\1 \(.* \)\?dev \+\([^ ]\+\) .*$/\4/p;Q')"
 537.102 -+	dev="$(echo "$route" |sed -ne 's/^\([^ ]\+\) \(.* \)\?via \+\1 \(.* \)\?dev \+\([^ ]\+\) .*$/\4/p;q')"
 537.103 - 	[ -n "$dev" ] || return 0
 537.104 - 
 537.105 - 	for netdev in $NETDEVICES; do
   538.1 --- a/vzctl/stuff/vzctl-3.0.25.1-Makefile.u	Wed May 09 17:03:28 2018 +0300
   538.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   538.3 @@ -1,133 +0,0 @@
   538.4 ---- vzctl-3.0.25.1-ori/Makefile.am	Fri Dec 24 12:45:32 2010
   538.5 -+++ vzctl-3.0.25.1/Makefile.am	Fri Dec 31 09:27:42 2010
   538.6 -@@ -49,7 +49,8 @@
   538.7 - 	install-redhat \
   538.8 - 	install-gentoo \
   538.9 - 	install-suse \
  538.10 --	install-debian
  538.11 -+	install-debian\
  538.12 -+	install-slitaz
  538.13 - 
  538.14 - DISTRO_TARGETS_ALL = \
  538.15 - 	$(DISTRO_TARGETS) \
  538.16 ---- vzctl-3.0.25.1-ori/Makefile.in	Fri Dec 24 12:45:44 2010
  538.17 -+++ vzctl-3.0.25.1/Makefile.in	Fri Dec 31 09:27:42 2010
  538.18 -@@ -266,7 +266,8 @@
  538.19 - 	install-redhat \
  538.20 - 	install-gentoo \
  538.21 - 	install-suse \
  538.22 --	install-debian
  538.23 -+	install-debian \
  538.24 -+	install-slitaz
  538.25 - 
  538.26 - DISTRO_TARGETS_ALL = \
  538.27 - 	$(DISTRO_TARGETS) \
  538.28 ---- vzctl-3.0.25.1-ori/bin/Makefile.am	Fri Dec 24 12:45:38 2010
  538.29 -+++ vzctl-3.0.25.1/bin/Makefile.am	Fri Dec 31 09:35:38 2010
  538.30 -@@ -57,6 +57,8 @@
  538.31 - 
  538.32 - install-debian:
  538.33 - 
  538.34 -+install-slitaz: 
  538.35 -+
  538.36 - install-gentoo:
  538.37 - 	@echo
  538.38 - 	@echo "***************************************************"
  538.39 ---- vzctl-3.0.25.1-ori/bin/Makefile.in	Fri Dec 24 12:45:43 2010
  538.40 -+++ vzctl-3.0.25.1/bin/Makefile.in	Fri Dec 31 09:35:39 2010
  538.41 -@@ -530,6 +530,8 @@
  538.42 - 
  538.43 - install-debian:
  538.44 - 
  538.45 -+install-slitaz: 
  538.46 -+
  538.47 - install-gentoo:
  538.48 - 	@echo
  538.49 - 	@echo "***************************************************"
  538.50 ---- vzctl-3.0.25.1-ori/etc/Makefile.am	Fri Dec 24 12:45:34 2010
  538.51 -+++ vzctl-3.0.25.1/etc/Makefile.am	Fri Dec 31 09:27:42 2010
  538.52 -@@ -50,3 +50,6 @@
  538.53 - 	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  538.54 - 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/conf.d
  538.55 - 	$(LN_S) $(pkgconfdir)/vz.conf $(DESTDIR)$(sysconfdir)/conf.d/vz
  538.56 -+	
  538.57 -+install-slitaz:
  538.58 -+	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  538.59 ---- vzctl-3.0.25.1-ori/etc/Makefile.in	Fri Dec 24 12:45:43 2010
  538.60 -+++ vzctl-3.0.25.1/etc/Makefile.in	Fri Dec 31 09:27:42 2010
  538.61 -@@ -683,6 +683,10 @@
  538.62 - 	$(mkinstalldirs) $(DESTDIR)$(sysconfdir)/conf.d
  538.63 - 	$(LN_S) $(pkgconfdir)/vz.conf $(DESTDIR)$(sysconfdir)/conf.d/vz
  538.64 - 
  538.65 -+install-slitaz:
  538.66 -+	$(MAKE) $(AM_MAKEFLAGS) -C init.d $@
  538.67 -+
  538.68 -+
  538.69 - # Tell versions [3.59,3.63) of GNU make to not export all variables.
  538.70 - # Otherwise a system limit (for SysV at least) may be exceeded.
  538.71 - .NOEXPORT:
  538.72 ---- vzctl-3.0.25.1-ori/etc/init.d/Makefile.am	Fri Dec 24 12:45:34 2010
  538.73 -+++ vzctl-3.0.25.1/etc/init.d/Makefile.am	Fri Dec 31 09:27:42 2010
  538.74 -@@ -33,6 +33,8 @@
  538.75 - 
  538.76 - install-debian: install-redhat
  538.77 - 
  538.78 -+install-slitaz: install-redhat
  538.79 -+
  538.80 - install-gentoo: vz-gentoo vzeventd-gentoo
  538.81 - 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  538.82 - 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  538.83 ---- vzctl-3.0.25.1-ori/etc/init.d/Makefile.in	Fri Dec 24 12:45:43 2010
  538.84 -+++ vzctl-3.0.25.1/etc/init.d/Makefile.in	Fri Dec 31 09:27:40 2010
  538.85 -@@ -492,6 +492,8 @@
  538.86 - 
  538.87 - install-debian: install-redhat
  538.88 - 
  538.89 -+install-slitaz: install-redhat
  538.90 -+
  538.91 - install-gentoo: vz-gentoo vzeventd-gentoo
  538.92 - 	$(mkinstalldirs) $(DESTDIR)$(initddir)
  538.93 - 	$(INSTALL_SCRIPT) vz-gentoo $(DESTDIR)$(initddir)/vz
  538.94 ---- vzctl-3.0.25.1-ori/etc/init.d/initd-functions.in	Fri Dec 24 12:45:35 2010
  538.95 -+++ vzctl-3.0.25.1/etc/init.d/initd-functions.in	Sun Jan  2 14:29:21 2011
  538.96 -@@ -28,6 +28,9 @@
  538.97 - elif [ -r /etc/debian_version ]; then
  538.98 - 	DISTR=debian
  538.99 - 	VARLOCK=/var/lock
 538.100 -+elif [ -r /etc/slitaz-release ]; then
 538.101 -+	DISTR=slitaz
 538.102 -+	VARLOCK=/var/lock
 538.103 - fi
 538.104 - 
 538.105 - print_success()
 538.106 ---- vzctl-3.0.25.1-ori/etc/init.d/vz-redhat.in	Fri Dec 24 12:45:35 2010
 538.107 -+++ vzctl-3.0.25.1/etc/init.d/vz-redhat.in	Fri Dec 31 14:50:22 2010
 538.108 -@@ -189,7 +189,7 @@
 538.109 - 	if [ "${IPV6}" = "yes" ]; then
 538.110 - 		ip -6 addr add fe80::1/128 dev $VZDEV
 538.111 - 	fi
 538.112 --	sysctl -q -w net.ipv4.conf.$VZDEV.send_redirects=0
 538.113 -+	sysctl -w net.ipv4.conf.$VZDEV.send_redirects=0
 538.114 - 	if [ "$(sysctl -n -e net.ipv4.ip_forward)" != "1" ]; then
 538.115 - 		print_warning "IP forwarding is not enabled"
 538.116 - 	fi
 538.117 -@@ -242,7 +242,7 @@
 538.118 - 	need_restart=""
 538.119 - 	velist=$(vzlist -aH -octid,onboot -s-bootorder |
 538.120 - 		awk '$2 == "yes" {print $1}')
 538.121 --	sysctl -q -w net.ipv4.route.src_check=0
 538.122 -+	sysctl -w net.ipv4.route.src_check=0
 538.123 - 	for veid in $velist; do
 538.124 - 		[ "${veid}" = "0" ] && continue
 538.125 - 		__echo "Starting CT ${veid}: "
 538.126 ---- vzctl-3.0.25.1-ori/scripts/vps-create.in	Fri Dec 24 12:45:37 2010
 538.127 -+++ vzctl-3.0.25.1/scripts/vps-create.in	Fri Dec 31 14:53:35 2010
 538.128 -@@ -38,7 +38,7 @@
 538.129 - 		vzerror "Tarball does not exist: $PRIVATE_TEMPLATE" ${VZ_FS_NEW_VE_PRVT}
 538.130 - 	HEADER="$(od -A n -N 2 -t x1 -- "$PRIVATE_TEMPLATE")" ||
 538.131 - 		vzerror "Invalid tarball: $PRIVATE_TEMPLATE" ${VZ_FS_NEW_VE_PRVT}
 538.132 --	TMP="$(df -P "$VE_PRVT")" ||
 538.133 -+	TMP="$(df "$VE_PRVT")" ||
 538.134 - 		vzerror "Failed to calculate available disk space on $VE_PRVT" ${VZ_FS_NEW_VE_PRVT}
 538.135 - 	AVAIL="$(echo "$TMP" | awk 'END{print $4}')"
 538.136 - 	if [ "$HEADER" = ' 1f 8b' ]; then
   539.1 --- a/vzquota/receipt	Wed May 09 17:03:28 2018 +0300
   539.2 +++ b/vzquota/receipt	Thu May 10 21:12:00 2018 +0300
   539.3 @@ -15,20 +15,6 @@
   539.4  # Rules to configure and make the package.
   539.5  compile_rules()
   539.6  {
   539.7 -	cd $src
   539.8 -	# Apply patches
   539.9 -	while read patch_file; do
  539.10 -		if [ -f done.$patch_file ]; then
  539.11 -			echo "Skipping $patch_file"
  539.12 -			continue
  539.13 -		fi
  539.14 -		echo "Apply $patch_file"
  539.15 -		patch -p1 < $stuff/$patch_file || return 1
  539.16 -		touch done.$patch_file
  539.17 -	done <<EOT
  539.18 -vzquota-${VERSION}.u
  539.19 -EOT
  539.20 -
  539.21  	make && make DESTDIR=$DESTDIR install
  539.22  }
  539.23  
   540.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   540.2 +++ b/vzquota/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   540.3 @@ -0,0 +1,1 @@
   540.4 +-p1|vzquota-3.0.12.u
   541.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   541.2 +++ b/vzquota/stuff/patches/vzquota-3.0.12.u	Thu May 10 21:12:00 2018 +0300
   541.3 @@ -0,0 +1,25 @@
   541.4 +--- vzquota-3.0.12-ori/src/Makefile	Thu Mar  6 20:28:38 2008
   541.5 ++++ vzquota-3.0.12/src/Makefile	Fri Dec 31 10:33:49 2010
   541.6 +@@ -18,7 +18,7 @@
   541.7 + INSTALL = install
   541.8 + PREFIX = /usr
   541.9 + SBINDIR = ${PREFIX}/sbin
  541.10 +-VARDIR = /var
  541.11 ++VARDIR = /var/lib
  541.12 + MANDIR = ${PREFIX}/share/man
  541.13 + 
  541.14 + #DEBUG = -D_DEBUG -g3 -ggdb3 -p -pg
  541.15 +--- vzquota-3.0.12-ori/src/vzdqload.c	Thu Mar  6 20:28:38 2008
  541.16 ++++ vzquota-3.0.12/src/vzdqload.c	Fri Dec 31 10:33:39 2010
  541.17 +@@ -20,7 +20,10 @@
  541.18 + #include <sys/types.h>
  541.19 + 
  541.20 + /* to include vsscanf() */
  541.21 +-#define __USE_ISOC99
  541.22 ++#ifndef __USE_ISOC99
  541.23 ++ #define __USE_ISOC99
  541.24 ++#endif
  541.25 ++
  541.26 + #include <stdio.h>
  541.27 + 
  541.28 + #include <stdlib.h>
   542.1 --- a/vzquota/stuff/vzquota-3.0.12.u	Wed May 09 17:03:28 2018 +0300
   542.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   542.3 @@ -1,25 +0,0 @@
   542.4 ---- vzquota-3.0.12-ori/src/Makefile	Thu Mar  6 20:28:38 2008
   542.5 -+++ vzquota-3.0.12/src/Makefile	Fri Dec 31 10:33:49 2010
   542.6 -@@ -18,7 +18,7 @@
   542.7 - INSTALL = install
   542.8 - PREFIX = /usr
   542.9 - SBINDIR = ${PREFIX}/sbin
  542.10 --VARDIR = /var
  542.11 -+VARDIR = /var/lib
  542.12 - MANDIR = ${PREFIX}/share/man
  542.13 - 
  542.14 - #DEBUG = -D_DEBUG -g3 -ggdb3 -p -pg
  542.15 ---- vzquota-3.0.12-ori/src/vzdqload.c	Thu Mar  6 20:28:38 2008
  542.16 -+++ vzquota-3.0.12/src/vzdqload.c	Fri Dec 31 10:33:39 2010
  542.17 -@@ -20,7 +20,10 @@
  542.18 - #include <sys/types.h>
  542.19 - 
  542.20 - /* to include vsscanf() */
  542.21 --#define __USE_ISOC99
  542.22 -+#ifndef __USE_ISOC99
  542.23 -+ #define __USE_ISOC99
  542.24 -+#endif
  542.25 -+
  542.26 - #include <stdio.h>
  542.27 - 
  542.28 - #include <stdlib.h>
   543.1 --- a/w3m/receipt	Wed May 09 17:03:28 2018 +0300
   543.2 +++ b/w3m/receipt	Thu May 10 21:12:00 2018 +0300
   543.3 @@ -18,14 +18,6 @@
   543.4  compile_rules()
   543.5  {
   543.6  	export LDFLAGS="$LDFLAGS -Wl,--copy-dt-needed-entries"
   543.7 -	for i in  $stuff/*.patch
   543.8 -	do
   543.9 -	        if [ -f done.$(basename $i) ]; then
  543.10 -		       continue
  543.11 -	        else
  543.12 -		       patch -p0 < $i && touch done.$(basename $i) || return 1
  543.13 -	        fi
  543.14 -	done
  543.15         ./configure $CONFIGURE_ARGS && make && make install
  543.16  }
  543.17  
   544.1 --- a/w3m/stuff/file_handle.patch	Wed May 09 17:03:28 2018 +0300
   544.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   544.3 @@ -1,60 +0,0 @@
   544.4 -diff -Naur old/istream.c new/istream.c
   544.5 ---- istream.c	2011-01-04 20:22:22.000000000 +1100
   544.6 -+++ istream.c	2012-07-04 21:50:51.529661517 +1000
   544.7 -@@ -22,8 +22,8 @@
   544.8 - static void basic_close(int *handle);
   544.9 - static int basic_read(int *handle, char *buf, int len);
  544.10 - 
  544.11 --static void file_close(struct file_handle *handle);
  544.12 --static int file_read(struct file_handle *handle, char *buf, int len);
  544.13 -+static void file_close(struct file_handle_rofl *handle);
  544.14 -+static int file_read(struct file_handle_rofl *handle, char *buf, int len);
  544.15 - 
  544.16 - static int str_read(Str handle, char *buf, int len);
  544.17 - 
  544.18 -@@ -114,7 +114,7 @@
  544.19 -     stream = New(union input_stream);
  544.20 -     init_base_stream(&stream->base, STREAM_BUF_SIZE);
  544.21 -     stream->file.type = IST_FILE;
  544.22 --    stream->file.handle = New(struct file_handle);
  544.23 -+    stream->file.handle = New(struct file_handle_rofl);
  544.24 -     stream->file.handle->f = f;
  544.25 -     if (closep)
  544.26 - 	stream->file.handle->close = closep;
  544.27 -@@ -658,13 +658,13 @@
  544.28 - }
  544.29 - 
  544.30 - static void
  544.31 --file_close(struct file_handle *handle)
  544.32 -+file_close(struct file_handle_rofl *handle)
  544.33 - {
  544.34 -     handle->close(handle->f);
  544.35 - }
  544.36 - 
  544.37 - static int
  544.38 --file_read(struct file_handle *handle, char *buf, int len)
  544.39 -+file_read(struct file_handle_rofl *handle, char *buf, int len)
  544.40 - {
  544.41 -     return fread(buf, 1, len, handle->f);
  544.42 - }
  544.43 -diff -Naur old/istream.h new/istream.h
  544.44 ---- istream.h	2003-10-21 02:41:56.000000000 +1000
  544.45 -+++ istream.h	2012-07-04 21:50:51.529661517 +1000
  544.46 -@@ -20,7 +20,7 @@
  544.47 - 
  544.48 - typedef struct stream_buffer *StreamBuffer;
  544.49 - 
  544.50 --struct file_handle {
  544.51 -+struct file_handle_rofl {
  544.52 -     FILE *f;
  544.53 -     void (*close) ();
  544.54 - };
  544.55 -@@ -53,7 +53,7 @@
  544.56 - 
  544.57 - struct file_stream {
  544.58 -     struct stream_buffer stream;
  544.59 --    struct file_handle *handle;
  544.60 -+    struct file_handle_rofl *handle;
  544.61 -     char type;
  544.62 -     char iseos;
  544.63 -     int (*read) ();
   545.1 --- a/w3m/stuff/https.patch	Wed May 09 17:03:28 2018 +0300
   545.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   545.3 @@ -1,19 +0,0 @@
   545.4 -Fedora patch; see https://bugzilla.redhat.com/show_bug.cgi?id=707994
   545.5 -
   545.6 ---- url.c	2011-01-04 14:52:24.000000000 +0530
   545.7 -+++ url.c	2011-09-02 18:25:43.305652690 +0530
   545.8 -@@ -82,11 +82,11 @@
   545.9 -     {"ftp", SCM_FTP},
  545.10 -     {"local", SCM_LOCAL},
  545.11 -     {"file", SCM_LOCAL},
  545.12 --    /*  {"exec", SCM_EXEC}, */
  545.13 -+    {"exec", SCM_EXEC}, 
  545.14 -     {"nntp", SCM_NNTP},
  545.15 --    /*  {"nntp", SCM_NNTP_GROUP}, */
  545.16 -+    {"nntp", SCM_NNTP_GROUP}, 
  545.17 -     {"news", SCM_NEWS},
  545.18 --    /*  {"news", SCM_NEWS_GROUP}, */
  545.19 -+    {"news", SCM_NEWS_GROUP}, 
  545.20 -     {"data", SCM_DATA},
  545.21 - #ifndef USE_W3MMAILER
  545.22 -     {"mailto", SCM_MAILTO},
   546.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   546.2 +++ b/w3m/stuff/patches/file_handle.patch	Thu May 10 21:12:00 2018 +0300
   546.3 @@ -0,0 +1,60 @@
   546.4 +diff -Naur old/istream.c new/istream.c
   546.5 +--- istream.c	2011-01-04 20:22:22.000000000 +1100
   546.6 ++++ istream.c	2012-07-04 21:50:51.529661517 +1000
   546.7 +@@ -22,8 +22,8 @@
   546.8 + static void basic_close(int *handle);
   546.9 + static int basic_read(int *handle, char *buf, int len);
  546.10 + 
  546.11 +-static void file_close(struct file_handle *handle);
  546.12 +-static int file_read(struct file_handle *handle, char *buf, int len);
  546.13 ++static void file_close(struct file_handle_rofl *handle);
  546.14 ++static int file_read(struct file_handle_rofl *handle, char *buf, int len);
  546.15 + 
  546.16 + static int str_read(Str handle, char *buf, int len);
  546.17 + 
  546.18 +@@ -114,7 +114,7 @@
  546.19 +     stream = New(union input_stream);
  546.20 +     init_base_stream(&stream->base, STREAM_BUF_SIZE);
  546.21 +     stream->file.type = IST_FILE;
  546.22 +-    stream->file.handle = New(struct file_handle);
  546.23 ++    stream->file.handle = New(struct file_handle_rofl);
  546.24 +     stream->file.handle->f = f;
  546.25 +     if (closep)
  546.26 + 	stream->file.handle->close = closep;
  546.27 +@@ -658,13 +658,13 @@
  546.28 + }
  546.29 + 
  546.30 + static void
  546.31 +-file_close(struct file_handle *handle)
  546.32 ++file_close(struct file_handle_rofl *handle)
  546.33 + {
  546.34 +     handle->close(handle->f);
  546.35 + }
  546.36 + 
  546.37 + static int
  546.38 +-file_read(struct file_handle *handle, char *buf, int len)
  546.39 ++file_read(struct file_handle_rofl *handle, char *buf, int len)
  546.40 + {
  546.41 +     return fread(buf, 1, len, handle->f);
  546.42 + }
  546.43 +diff -Naur old/istream.h new/istream.h
  546.44 +--- istream.h	2003-10-21 02:41:56.000000000 +1000
  546.45 ++++ istream.h	2012-07-04 21:50:51.529661517 +1000
  546.46 +@@ -20,7 +20,7 @@
  546.47 + 
  546.48 + typedef struct stream_buffer *StreamBuffer;
  546.49 + 
  546.50 +-struct file_handle {
  546.51 ++struct file_handle_rofl {
  546.52 +     FILE *f;
  546.53 +     void (*close) ();
  546.54 + };
  546.55 +@@ -53,7 +53,7 @@
  546.56 + 
  546.57 + struct file_stream {
  546.58 +     struct stream_buffer stream;
  546.59 +-    struct file_handle *handle;
  546.60 ++    struct file_handle_rofl *handle;
  546.61 +     char type;
  546.62 +     char iseos;
  546.63 +     int (*read) ();
   547.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   547.2 +++ b/w3m/stuff/patches/https.patch	Thu May 10 21:12:00 2018 +0300
   547.3 @@ -0,0 +1,19 @@
   547.4 +Fedora patch; see https://bugzilla.redhat.com/show_bug.cgi?id=707994
   547.5 +
   547.6 +--- url.c	2011-01-04 14:52:24.000000000 +0530
   547.7 ++++ url.c	2011-09-02 18:25:43.305652690 +0530
   547.8 +@@ -82,11 +82,11 @@
   547.9 +     {"ftp", SCM_FTP},
  547.10 +     {"local", SCM_LOCAL},
  547.11 +     {"file", SCM_LOCAL},
  547.12 +-    /*  {"exec", SCM_EXEC}, */
  547.13 ++    {"exec", SCM_EXEC}, 
  547.14 +     {"nntp", SCM_NNTP},
  547.15 +-    /*  {"nntp", SCM_NNTP_GROUP}, */
  547.16 ++    {"nntp", SCM_NNTP_GROUP}, 
  547.17 +     {"news", SCM_NEWS},
  547.18 +-    /*  {"news", SCM_NEWS_GROUP}, */
  547.19 ++    {"news", SCM_NEWS_GROUP}, 
  547.20 +     {"data", SCM_DATA},
  547.21 + #ifndef USE_W3MMAILER
  547.22 +     {"mailto", SCM_MAILTO},
   548.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   548.2 +++ b/w3m/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   548.3 @@ -0,0 +1,3 @@
   548.4 +-p0|file_handle.patch
   548.5 +-p0|https.patch
   548.6 +-p0|w3m-0.5.2-gc72.patch
   549.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   549.2 +++ b/w3m/stuff/patches/w3m-0.5.2-gc72.patch	Thu May 10 21:12:00 2018 +0300
   549.3 @@ -0,0 +1,27 @@
   549.4 +diff -Naurb w3m-0.5.2.orig/main.c w3m-0.5.2/main.c
   549.5 +--- main.c	2007-05-31 10:19:50.000000000 +0900
   549.6 ++++ main.c	2009-11-09 08:20:02.184953443 +0900
   549.7 +@@ -312,7 +312,11 @@
   549.8 + 	    lock = 0;
   549.9 + 	}
  549.10 +     }
  549.11 ++#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
  549.12 ++    else if (orig_GC_warn_proc = GC_get_warn_proc())
  549.13 ++#else
  549.14 +     else if (orig_GC_warn_proc)
  549.15 ++#endif
  549.16 + 	orig_GC_warn_proc(msg, arg);
  549.17 +     else
  549.18 + 	fprintf(stderr, msg, (unsigned long)arg);
  549.19 +@@ -842,7 +846,11 @@
  549.20 +     mySignal(SIGPIPE, SigPipe);
  549.21 + #endif
  549.22 + 
  549.23 ++#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
  549.24 ++    GC_set_warn_proc(wrap_GC_warn_proc);
  549.25 ++#else
  549.26 +     orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
  549.27 ++#endif
  549.28 +     err_msg = Strnew();
  549.29 +     if (load_argc == 0) {
  549.30 + 	/* no URL specified */
   550.1 --- a/w3m/stuff/w3m-0.5.2-gc72.patch	Wed May 09 17:03:28 2018 +0300
   550.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   550.3 @@ -1,27 +0,0 @@
   550.4 -diff -Naurb w3m-0.5.2.orig/main.c w3m-0.5.2/main.c
   550.5 ---- main.c	2007-05-31 10:19:50.000000000 +0900
   550.6 -+++ main.c	2009-11-09 08:20:02.184953443 +0900
   550.7 -@@ -312,7 +312,11 @@
   550.8 - 	    lock = 0;
   550.9 - 	}
  550.10 -     }
  550.11 -+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
  550.12 -+    else if (orig_GC_warn_proc = GC_get_warn_proc())
  550.13 -+#else
  550.14 -     else if (orig_GC_warn_proc)
  550.15 -+#endif
  550.16 - 	orig_GC_warn_proc(msg, arg);
  550.17 -     else
  550.18 - 	fprintf(stderr, msg, (unsigned long)arg);
  550.19 -@@ -842,7 +846,11 @@
  550.20 -     mySignal(SIGPIPE, SigPipe);
  550.21 - #endif
  550.22 - 
  550.23 -+#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2
  550.24 -+    GC_set_warn_proc(wrap_GC_warn_proc);
  550.25 -+#else
  550.26 -     orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc);
  550.27 -+#endif
  550.28 -     err_msg = Strnew();
  550.29 -     if (load_argc == 0) {
  550.30 - 	/* no URL specified */
   551.1 --- a/wbar/receipt	Wed May 09 17:03:28 2018 +0300
   551.2 +++ b/wbar/receipt	Thu May 10 21:12:00 2018 +0300
   551.3 @@ -14,7 +14,6 @@
   551.4  BUILD_DEPENDS="imlib2-dev xorg-libX11-dev"
   551.5  
   551.6  compile_rules() {
   551.7 -	patch -p0 < $stuff/gcc43_fixes.diff || return 1
   551.8  	sed -i 's|^LDFLAGS.*|& -lX11|' Makefile
   551.9  	make || return 1
  551.10  
   552.1 --- a/wbar/stuff/gcc43_fixes.diff	Wed May 09 17:03:28 2018 +0300
   552.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   552.3 @@ -1,33 +0,0 @@
   552.4 -diff -Naur wbar-1.3.3.orig/IconLoader.cc wbar-1.3.3/IconLoader.cc
   552.5 ---- IconLoader.cc	2006-12-29 01:54:29.000000000 +0000
   552.6 -+++ IconLoader.cc	2008-08-06 15:35:58.000000000 +0000
   552.7 -@@ -2,6 +2,7 @@
   552.8 - #include <unistd.h>
   552.9 - #include <sys/stat.h>
  552.10 - #include <sys/types.h>
  552.11 -+#include <cstdlib>
  552.12 - };
  552.13 - 
  552.14 - #include "IconLoader.h"
  552.15 -diff -Naur wbar-1.3.3.orig/Main.cc wbar-1.3.3/Main.cc
  552.16 ---- Main.cc	2007-08-06 12:28:11.000000000 +0000
  552.17 -+++ Main.cc	2008-08-06 15:35:00.000000000 +0000
  552.18 -@@ -4,6 +4,8 @@
  552.19 - #include <unistd.h>
  552.20 - #include <stdlib.h>
  552.21 - #include <iostream>
  552.22 -+#include <cstdlib>
  552.23 -+#include <memory>
  552.24 - 
  552.25 - #include "XWin.h"
  552.26 - #include "ImgWrap.h"
  552.27 -diff -Naur wbar-1.3.3.orig/SuperBar.cc wbar-1.3.3/SuperBar.cc
  552.28 ---- SuperBar.cc	2007-08-04 00:24:34.000000000 +0000
  552.29 -+++ SuperBar.cc	2008-08-06 15:51:14.000000000 +0000
  552.30 -@@ -1,5 +1,6 @@
  552.31 - #include "SuperBar.h"
  552.32 - #include "SuperIcon.h"
  552.33 -+#include <cstdlib>
  552.34 - 
  552.35 - using namespace std;
  552.36 - 
   553.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   553.2 +++ b/wbar/stuff/patches/gcc43_fixes.diff	Thu May 10 21:12:00 2018 +0300
   553.3 @@ -0,0 +1,33 @@
   553.4 +diff -Naur wbar-1.3.3.orig/IconLoader.cc wbar-1.3.3/IconLoader.cc
   553.5 +--- IconLoader.cc	2006-12-29 01:54:29.000000000 +0000
   553.6 ++++ IconLoader.cc	2008-08-06 15:35:58.000000000 +0000
   553.7 +@@ -2,6 +2,7 @@
   553.8 + #include <unistd.h>
   553.9 + #include <sys/stat.h>
  553.10 + #include <sys/types.h>
  553.11 ++#include <cstdlib>
  553.12 + };
  553.13 + 
  553.14 + #include "IconLoader.h"
  553.15 +diff -Naur wbar-1.3.3.orig/Main.cc wbar-1.3.3/Main.cc
  553.16 +--- Main.cc	2007-08-06 12:28:11.000000000 +0000
  553.17 ++++ Main.cc	2008-08-06 15:35:00.000000000 +0000
  553.18 +@@ -4,6 +4,8 @@
  553.19 + #include <unistd.h>
  553.20 + #include <stdlib.h>
  553.21 + #include <iostream>
  553.22 ++#include <cstdlib>
  553.23 ++#include <memory>
  553.24 + 
  553.25 + #include "XWin.h"
  553.26 + #include "ImgWrap.h"
  553.27 +diff -Naur wbar-1.3.3.orig/SuperBar.cc wbar-1.3.3/SuperBar.cc
  553.28 +--- SuperBar.cc	2007-08-04 00:24:34.000000000 +0000
  553.29 ++++ SuperBar.cc	2008-08-06 15:51:14.000000000 +0000
  553.30 +@@ -1,5 +1,6 @@
  553.31 + #include "SuperBar.h"
  553.32 + #include "SuperIcon.h"
  553.33 ++#include <cstdlib>
  553.34 + 
  553.35 + using namespace std;
  553.36 + 
   554.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   554.2 +++ b/wbar/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   554.3 @@ -0,0 +1,1 @@
   554.4 +-p0|gcc43_fixes.diff
   555.1 --- a/wicd/receipt	Wed May 09 17:03:28 2018 +0300
   555.2 +++ b/wicd/receipt	Thu May 10 21:12:00 2018 +0300
   555.3 @@ -17,10 +17,6 @@
   555.4  # Rules to configure and make the package.
   555.5  compile_rules()
   555.6  {
   555.7 -	# Fix problem with new urwid FS#33378 LP#1075399
   555.8 -	patch -Np0 -i $stuff/831_830.patch
   555.9 -	patch -Np0 -i $stuff/835_834.patch
  555.10 -	patch -Np0 -i $stuff/dbus_string_fix.patch
  555.11  	python setup.py configure
  555.12  	#HACK for https://bugs.launchpad.net/wicd/+bug/928589
  555.13  	mkdir -p translations/ast/LC_MESSAGES
   556.1 --- a/wicd/stuff/831_830.patch	Wed May 09 17:03:28 2018 +0300
   556.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   556.3 @@ -1,66 +0,0 @@
   556.4 -=== modified file 'curses/curses_misc.py'
   556.5 ---- curses/curses_misc.py	2012-05-06 15:16:15 +0000
   556.6 -+++ curses/curses_misc.py	2012-11-15 09:26:21 +0000
   556.7 -@@ -349,7 +349,10 @@
   556.8 -         # We need this to pick our keypresses
   556.9 -         self.use_enter = use_enter
  556.10 - 
  556.11 --        self.focus = focus
  556.12 -+        if urwid.VERSION < (1, 1, 0):
  556.13 -+            self.focus = focus
  556.14 -+        else:
  556.15 -+            self.focus_position = focus
  556.16 - 
  556.17 -         self.callback = callback
  556.18 -         self.user_args = user_args
  556.19 -@@ -362,7 +365,11 @@
  556.20 -         self.list = list
  556.21 - 
  556.22 -     def set_focus(self,index):
  556.23 --        self.focus = index
  556.24 -+        if urwid.VERSION < (1, 1, 0):
  556.25 -+            self.focus = index
  556.26 -+        else:
  556.27 -+            self.focus_position = index
  556.28 -+
  556.29 -         # API changed between urwid 0.9.8.4 and 0.9.9
  556.30 -         try:
  556.31 -             self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW))
  556.32 -@@ -376,16 +383,21 @@
  556.33 -     def build_combobox(self,parent,ui,row):
  556.34 -         str,trash =  self.label.get_text()
  556.35 - 
  556.36 --        self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]),
  556.37 -+        if urwid.VERSION < (1, 1, 0):
  556.38 -+            index = self.focus
  556.39 -+        else:
  556.40 -+            index = self.focus_position
  556.41 -+
  556.42 -+        self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
  556.43 -                 attrs=self.attrs,focus_attr=self.focus_attr)
  556.44 -         if str != '':
  556.45 -             w = urwid.Columns([('fixed',len(str),self.label),self.cbox],
  556.46 -                     dividechars=1)
  556.47 --            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
  556.48 -+            self.overlay = self.ComboSpace(self.list,parent,ui,index,
  556.49 -                     pos=(len(str)+1,row))
  556.50 -         else:
  556.51 -             w = urwid.Columns([self.cbox])
  556.52 --            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
  556.53 -+            self.overlay = self.ComboSpace(self.list,parent,ui,index,
  556.54 -                     pos=(0,row))
  556.55 - 
  556.56 -         self._w = w
  556.57 -@@ -419,7 +431,10 @@
  556.58 -         if self.overlay:
  556.59 -             return self.overlay._listbox.get_focus()
  556.60 -         else:
  556.61 --            return None,self.focus
  556.62 -+            if urwid.VERSION < (1, 1, 0):
  556.63 -+                return None, self.focus
  556.64 -+            else:
  556.65 -+                return None, self.focus_position
  556.66 - 
  556.67 -     def get_sensitive(self):
  556.68 -         return self.cbox.get_sensitive()
  556.69 -
   557.1 --- a/wicd/stuff/835_834.patch	Wed May 09 17:03:28 2018 +0300
   557.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   557.3 @@ -1,43 +0,0 @@
   557.4 -=== modified file 'curses/curses_misc.py'
   557.5 ---- curses/curses_misc.py	2012-11-15 09:26:21 +0000
   557.6 -+++ curses/curses_misc.py	2012-11-16 09:22:47 +0000
   557.7 -@@ -352,7 +352,7 @@
   557.8 -         if urwid.VERSION < (1, 1, 0):
   557.9 -             self.focus = focus
  557.10 -         else:
  557.11 --            self.focus_position = focus
  557.12 -+            self._w.focus_position = focus
  557.13 - 
  557.14 -         self.callback = callback
  557.15 -         self.user_args = user_args
  557.16 -@@ -368,7 +368,10 @@
  557.17 -         if urwid.VERSION < (1, 1, 0):
  557.18 -             self.focus = index
  557.19 -         else:
  557.20 --            self.focus_position = index
  557.21 -+            try:
  557.22 -+                self._w.focus_position = index
  557.23 -+            except IndexError:
  557.24 -+                pass
  557.25 - 
  557.26 -         # API changed between urwid 0.9.8.4 and 0.9.9
  557.27 -         try:
  557.28 -@@ -386,7 +389,7 @@
  557.29 -         if urwid.VERSION < (1, 1, 0):
  557.30 -             index = self.focus
  557.31 -         else:
  557.32 --            index = self.focus_position
  557.33 -+            index = self._w.focus_position
  557.34 - 
  557.35 -         self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
  557.36 -                 attrs=self.attrs,focus_attr=self.focus_attr)
  557.37 -@@ -434,7 +437,7 @@
  557.38 -             if urwid.VERSION < (1, 1, 0):
  557.39 -                 return None, self.focus
  557.40 -             else:
  557.41 --                return None, self.focus_position
  557.42 -+                return None, self._w.focus_position
  557.43 - 
  557.44 -     def get_sensitive(self):
  557.45 -         return self.cbox.get_sensitive()
  557.46 -
   558.1 --- a/wicd/stuff/dbus_string_fix.patch	Wed May 09 17:03:28 2018 +0300
   558.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   558.3 @@ -1,15 +0,0 @@
   558.4 -=== modified file 'wicd/misc.py'
   558.5 ---- wicd/misc.py	2012-04-30 19:20:47 +0000
   558.6 -+++ wicd/misc.py	2012-05-03 16:01:49 +0000
   558.7 -@@ -430,7 +430,10 @@
   558.8 -     """ Sanitize property names to be used in config-files. """
   558.9 -     allowed = string.ascii_letters + '_' + string.digits
  558.10 -     table = string.maketrans(allowed, ' ' * len(allowed))
  558.11 --    return s.translate(None, table)
  558.12 -+
  558.13 -+    # s is a dbus.String -- since we don't allow unicode property keys,
  558.14 -+    # make it simple.
  558.15 -+    return str(s).translate(None, table)
  558.16 -
  558.17 - def sanitize_escaped(s):
  558.18 -     """ Sanitize double-escaped unicode strings. """
   559.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   559.2 +++ b/wicd/stuff/patches/831_830.patch	Thu May 10 21:12:00 2018 +0300
   559.3 @@ -0,0 +1,66 @@
   559.4 +=== modified file 'curses/curses_misc.py'
   559.5 +--- curses/curses_misc.py	2012-05-06 15:16:15 +0000
   559.6 ++++ curses/curses_misc.py	2012-11-15 09:26:21 +0000
   559.7 +@@ -349,7 +349,10 @@
   559.8 +         # We need this to pick our keypresses
   559.9 +         self.use_enter = use_enter
  559.10 + 
  559.11 +-        self.focus = focus
  559.12 ++        if urwid.VERSION < (1, 1, 0):
  559.13 ++            self.focus = focus
  559.14 ++        else:
  559.15 ++            self.focus_position = focus
  559.16 + 
  559.17 +         self.callback = callback
  559.18 +         self.user_args = user_args
  559.19 +@@ -362,7 +365,11 @@
  559.20 +         self.list = list
  559.21 + 
  559.22 +     def set_focus(self,index):
  559.23 +-        self.focus = index
  559.24 ++        if urwid.VERSION < (1, 1, 0):
  559.25 ++            self.focus = index
  559.26 ++        else:
  559.27 ++            self.focus_position = index
  559.28 ++
  559.29 +         # API changed between urwid 0.9.8.4 and 0.9.9
  559.30 +         try:
  559.31 +             self.cbox.set_w(SelText(self.list[index]+self.DOWN_ARROW))
  559.32 +@@ -376,16 +383,21 @@
  559.33 +     def build_combobox(self,parent,ui,row):
  559.34 +         str,trash =  self.label.get_text()
  559.35 + 
  559.36 +-        self.cbox = DynWrap(SelText([self.list[self.focus]+self.DOWN_ARROW]),
  559.37 ++        if urwid.VERSION < (1, 1, 0):
  559.38 ++            index = self.focus
  559.39 ++        else:
  559.40 ++            index = self.focus_position
  559.41 ++
  559.42 ++        self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
  559.43 +                 attrs=self.attrs,focus_attr=self.focus_attr)
  559.44 +         if str != '':
  559.45 +             w = urwid.Columns([('fixed',len(str),self.label),self.cbox],
  559.46 +                     dividechars=1)
  559.47 +-            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
  559.48 ++            self.overlay = self.ComboSpace(self.list,parent,ui,index,
  559.49 +                     pos=(len(str)+1,row))
  559.50 +         else:
  559.51 +             w = urwid.Columns([self.cbox])
  559.52 +-            self.overlay = self.ComboSpace(self.list,parent,ui,self.focus,
  559.53 ++            self.overlay = self.ComboSpace(self.list,parent,ui,index,
  559.54 +                     pos=(0,row))
  559.55 + 
  559.56 +         self._w = w
  559.57 +@@ -419,7 +431,10 @@
  559.58 +         if self.overlay:
  559.59 +             return self.overlay._listbox.get_focus()
  559.60 +         else:
  559.61 +-            return None,self.focus
  559.62 ++            if urwid.VERSION < (1, 1, 0):
  559.63 ++                return None, self.focus
  559.64 ++            else:
  559.65 ++                return None, self.focus_position
  559.66 + 
  559.67 +     def get_sensitive(self):
  559.68 +         return self.cbox.get_sensitive()
  559.69 +
   560.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   560.2 +++ b/wicd/stuff/patches/835_834.patch	Thu May 10 21:12:00 2018 +0300
   560.3 @@ -0,0 +1,43 @@
   560.4 +=== modified file 'curses/curses_misc.py'
   560.5 +--- curses/curses_misc.py	2012-11-15 09:26:21 +0000
   560.6 ++++ curses/curses_misc.py	2012-11-16 09:22:47 +0000
   560.7 +@@ -352,7 +352,7 @@
   560.8 +         if urwid.VERSION < (1, 1, 0):
   560.9 +             self.focus = focus
  560.10 +         else:
  560.11 +-            self.focus_position = focus
  560.12 ++            self._w.focus_position = focus
  560.13 + 
  560.14 +         self.callback = callback
  560.15 +         self.user_args = user_args
  560.16 +@@ -368,7 +368,10 @@
  560.17 +         if urwid.VERSION < (1, 1, 0):
  560.18 +             self.focus = index
  560.19 +         else:
  560.20 +-            self.focus_position = index
  560.21 ++            try:
  560.22 ++                self._w.focus_position = index
  560.23 ++            except IndexError:
  560.24 ++                pass
  560.25 + 
  560.26 +         # API changed between urwid 0.9.8.4 and 0.9.9
  560.27 +         try:
  560.28 +@@ -386,7 +389,7 @@
  560.29 +         if urwid.VERSION < (1, 1, 0):
  560.30 +             index = self.focus
  560.31 +         else:
  560.32 +-            index = self.focus_position
  560.33 ++            index = self._w.focus_position
  560.34 + 
  560.35 +         self.cbox = DynWrap(SelText([self.list[index]+self.DOWN_ARROW]),
  560.36 +                 attrs=self.attrs,focus_attr=self.focus_attr)
  560.37 +@@ -434,7 +437,7 @@
  560.38 +             if urwid.VERSION < (1, 1, 0):
  560.39 +                 return None, self.focus
  560.40 +             else:
  560.41 +-                return None, self.focus_position
  560.42 ++                return None, self._w.focus_position
  560.43 + 
  560.44 +     def get_sensitive(self):
  560.45 +         return self.cbox.get_sensitive()
  560.46 +
   561.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   561.2 +++ b/wicd/stuff/patches/dbus_string_fix.patch	Thu May 10 21:12:00 2018 +0300
   561.3 @@ -0,0 +1,15 @@
   561.4 +=== modified file 'wicd/misc.py'
   561.5 +--- wicd/misc.py	2012-04-30 19:20:47 +0000
   561.6 ++++ wicd/misc.py	2012-05-03 16:01:49 +0000
   561.7 +@@ -430,7 +430,10 @@
   561.8 +     """ Sanitize property names to be used in config-files. """
   561.9 +     allowed = string.ascii_letters + '_' + string.digits
  561.10 +     table = string.maketrans(allowed, ' ' * len(allowed))
  561.11 +-    return s.translate(None, table)
  561.12 ++
  561.13 ++    # s is a dbus.String -- since we don't allow unicode property keys,
  561.14 ++    # make it simple.
  561.15 ++    return str(s).translate(None, table)
  561.16 +
  561.17 + def sanitize_escaped(s):
  561.18 +     """ Sanitize double-escaped unicode strings. """
   562.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   562.2 +++ b/wicd/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   562.3 @@ -0,0 +1,4 @@
   562.4 +# Fix problem with new urwid FS#33378 LP#1075399
   562.5 +-Np0|831_830.patch
   562.6 +-Np0|835_834.patch
   562.7 +-Np0|dbus_string_fix.patch
   563.1 --- a/wxWidgets/stuff/gsockgtk.patch	Wed May 09 17:03:28 2018 +0300
   563.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   563.3 @@ -1,16 +0,0 @@
   563.4 ---- src/gtk/gsockgtk.cpp	Fri Mar  6 13:11:40 2009
   563.5 -+++ src/gtk/gsockgtk.cpp	Thu Sep 17 12:10:10 2009
   563.6 -@@ -15,8 +15,13 @@
   563.7 - #include <stdlib.h>
   563.8 - #include <stdio.h>
   563.9 -
  563.10 -+// newer versions of glib define its own GSocket but we unfortunately use this
  563.11 -+// name in our own (semi-)public header and so can't change it -- rename glib
  563.12 -+// one instead
  563.13 -+#define GSocket GlibGSocket
  563.14 - #include <gdk/gdk.h>
  563.15 - #include <glib.h>
  563.16 -+#undef GSocket
  563.17 -
  563.18 - #include "wx/gsocket.h"
  563.19 - #include "wx/unix/gsockunx.h"
   564.1 --- a/wxpython/receipt	Wed May 09 17:03:28 2018 +0300
   564.2 +++ b/wxpython/receipt	Thu May 10 21:12:00 2018 +0300
   564.3 @@ -31,7 +31,6 @@
   564.4  		$CONFIGURE_ARGS &&
   564.5  	make $MAKEFLAGS
   564.6  	cd $src/wxPython
   564.7 -	patch -Np2 -i $stuff/wxpython-cairo.patch
   564.8  	python setup.py WXPORT=gtk2 UNICODE=1 build
   564.9  	python setup.py WXPORT=gtk2 UNICODE=1 install --root=$DESTDIR
  564.10  }
   565.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   565.2 +++ b/wxpython/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   565.3 @@ -0,0 +1,1 @@
   565.4 +wxpython-cairo.patch
   566.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   566.2 +++ b/wxpython/stuff/patches/wxpython-cairo.patch	Thu May 10 21:12:00 2018 +0300
   566.3 @@ -0,0 +1,51 @@
   566.4 +--- a/wxPython/wx/lib/wxcairo.py	2011/08/25 18:50:02	68894
   566.5 ++++ b/wxPython/wx/lib/wxcairo.py	2011/09/22 00:30:25	69181
   566.6 +@@ -401,6 +401,48 @@
   566.7 +                                                       ctypes.py_object)),
   566.8 +             ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))]
   566.9 +
  566.10 ++    # This structure is known good with pycairo 1.10.0. The keep adding stuff
  566.11 ++    # to the middle of the structure instead of only adding to the end!
  566.12 ++    elif cairo.version_info < (1,11):
  566.13 ++        _fields_ = [
  566.14 ++            ('Context_Type', ctypes.py_object),
  566.15 ++            ('Context_FromContext', ctypes.PYFUNCTYPE(ctypes.py_object,
  566.16 ++                                                      ctypes.c_void_p,
  566.17 ++                                                      ctypes.py_object,
  566.18 ++                                                      ctypes.py_object)),
  566.19 ++            ('FontFace_Type', ctypes.py_object),
  566.20 ++            ('ToyFontFace_Type', ctypes.py_object),  #** new in 1.8.4
  566.21 ++            ('FontFace_FromFontFace', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  566.22 ++            ('FontOptions_Type', ctypes.py_object),
  566.23 ++            ('FontOptions_FromFontOptions', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  566.24 ++            ('Matrix_Type', ctypes.py_object),
  566.25 ++            ('Matrix_FromMatrix', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  566.26 ++            ('Path_Type', ctypes.py_object),
  566.27 ++            ('Path_FromPath', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  566.28 ++            ('Pattern_Type', ctypes.py_object),
  566.29 ++            ('SolidPattern_Type', ctypes.py_object),
  566.30 ++            ('SurfacePattern_Type', ctypes.py_object),
  566.31 ++            ('Gradient_Type', ctypes.py_object),
  566.32 ++            ('LinearGradient_Type', ctypes.py_object),
  566.33 ++            ('RadialGradient_Type', ctypes.py_object),
  566.34 ++            ('Pattern_FromPattern', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p,
  566.35 ++                                                      ctypes.py_object)), #** changed in 1.8.4
  566.36 ++            ('ScaledFont_Type', ctypes.py_object),
  566.37 ++            ('ScaledFont_FromScaledFont', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  566.38 ++            ('Surface_Type', ctypes.py_object),
  566.39 ++            ('ImageSurface_Type', ctypes.py_object),
  566.40 ++            ('PDFSurface_Type', ctypes.py_object),
  566.41 ++            ('PSSurface_Type', ctypes.py_object),
  566.42 ++            ('SVGSurface_Type', ctypes.py_object),
  566.43 ++            ('Win32Surface_Type', ctypes.py_object),
  566.44 ++            ('Win32PrintingSurface_Type', ctypes.py_object),
  566.45 ++            ('XCBSurface_Type', ctypes.py_object),
  566.46 ++            ('XlibSurface_Type', ctypes.py_object),
  566.47 ++            ('Surface_FromSurface', ctypes.PYFUNCTYPE(ctypes.py_object,
  566.48 ++                                                      ctypes.c_void_p,
  566.49 ++                                                      ctypes.py_object)),
  566.50 ++            ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))]
  566.51 ++
  566.52 +
  566.53 + def _loadPycairoAPI():
  566.54 +     global pycairoAPI
   567.1 --- a/wxpython/stuff/wxpython-cairo.patch	Wed May 09 17:03:28 2018 +0300
   567.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   567.3 @@ -1,51 +0,0 @@
   567.4 ---- wxPython/trunk/wx/lib/wxcairo.py	2011/08/25 18:50:02	68894
   567.5 -+++ wxPython/trunk/wx/lib/wxcairo.py	2011/09/22 00:30:25	69181
   567.6 -@@ -401,6 +401,48 @@
   567.7 -                                                       ctypes.py_object)),
   567.8 -             ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))]
   567.9 -
  567.10 -+    # This structure is known good with pycairo 1.10.0. The keep adding stuff
  567.11 -+    # to the middle of the structure instead of only adding to the end!
  567.12 -+    elif cairo.version_info < (1,11):
  567.13 -+        _fields_ = [
  567.14 -+            ('Context_Type', ctypes.py_object),
  567.15 -+            ('Context_FromContext', ctypes.PYFUNCTYPE(ctypes.py_object,
  567.16 -+                                                      ctypes.c_void_p,
  567.17 -+                                                      ctypes.py_object,
  567.18 -+                                                      ctypes.py_object)),
  567.19 -+            ('FontFace_Type', ctypes.py_object),
  567.20 -+            ('ToyFontFace_Type', ctypes.py_object),  #** new in 1.8.4
  567.21 -+            ('FontFace_FromFontFace', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  567.22 -+            ('FontOptions_Type', ctypes.py_object),
  567.23 -+            ('FontOptions_FromFontOptions', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  567.24 -+            ('Matrix_Type', ctypes.py_object),
  567.25 -+            ('Matrix_FromMatrix', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  567.26 -+            ('Path_Type', ctypes.py_object),
  567.27 -+            ('Path_FromPath', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  567.28 -+            ('Pattern_Type', ctypes.py_object),
  567.29 -+            ('SolidPattern_Type', ctypes.py_object),
  567.30 -+            ('SurfacePattern_Type', ctypes.py_object),
  567.31 -+            ('Gradient_Type', ctypes.py_object),
  567.32 -+            ('LinearGradient_Type', ctypes.py_object),
  567.33 -+            ('RadialGradient_Type', ctypes.py_object),
  567.34 -+            ('Pattern_FromPattern', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p,
  567.35 -+                                                      ctypes.py_object)), #** changed in 1.8.4
  567.36 -+            ('ScaledFont_Type', ctypes.py_object),
  567.37 -+            ('ScaledFont_FromScaledFont', ctypes.PYFUNCTYPE(ctypes.py_object, ctypes.c_void_p)),
  567.38 -+            ('Surface_Type', ctypes.py_object),
  567.39 -+            ('ImageSurface_Type', ctypes.py_object),
  567.40 -+            ('PDFSurface_Type', ctypes.py_object),
  567.41 -+            ('PSSurface_Type', ctypes.py_object),
  567.42 -+            ('SVGSurface_Type', ctypes.py_object),
  567.43 -+            ('Win32Surface_Type', ctypes.py_object),
  567.44 -+            ('Win32PrintingSurface_Type', ctypes.py_object),
  567.45 -+            ('XCBSurface_Type', ctypes.py_object),
  567.46 -+            ('XlibSurface_Type', ctypes.py_object),
  567.47 -+            ('Surface_FromSurface', ctypes.PYFUNCTYPE(ctypes.py_object,
  567.48 -+                                                      ctypes.c_void_p,
  567.49 -+                                                      ctypes.py_object)),
  567.50 -+            ('Check_Status', ctypes.PYFUNCTYPE(ctypes.c_int, ctypes.c_int))]
  567.51 -+
  567.52 -
  567.53 - def _loadPycairoAPI():
  567.54 -     global pycairoAPI
   568.1 --- a/xarchive/receipt	Wed May 09 17:03:28 2018 +0300
   568.2 +++ b/xarchive/receipt	Thu May 10 21:12:00 2018 +0300
   568.3 @@ -18,12 +18,6 @@
   568.4  # Rules to configure and make the package.ls sr	
   568.5  compile_rules()
   568.6  {
   568.7 -	cd $src
   568.8 -	# patch tar-wrap for busybox tar option
   568.9 -	[ -f done.slitaz-xarchive-wrappers-0.2.8-6.patch ] || \
  568.10 -	patch -p1 -i $stuff/slitaz-xarchive-wrappers-0.2.8-6.patch
  568.11 -	touch done.slitaz-xarchive-wrappers-0.2.8-6.patch
  568.12 -
  568.13  	./configure --prefix=/usr --infodir=/usr/share/info \
  568.14  	--mandir=/usr/share/man $CONFIGURE_ARGS &&
  568.15  
   569.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   569.2 +++ b/xarchive/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   569.3 @@ -0,0 +1,2 @@
   569.4 +# patch tar-wrap for busybox tar option
   569.5 +-p1|slitaz-xarchive-wrappers-0.2.8-6.patch
   570.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   570.2 +++ b/xarchive/stuff/patches/slitaz-xarchive-wrappers-0.2.8-6.patch	Thu May 10 21:12:00 2018 +0300
   570.3 @@ -0,0 +1,693 @@
   570.4 +--- xarchive-0.2.8-6.old/config.log	Thu Jan  1 01:00:00 1970
   570.5 ++++ xarchive-0.2.8-6/config.log	Sat Mar 22 12:58:40 2008
   570.6 +@@ -0,0 +1,479 @@
   570.7 ++This file contains any messages produced by compilers while
   570.8 ++running configure, to aid debugging if configure makes a mistake.
   570.9 ++
  570.10 ++It was created by XArchive configure 0.2.8-6, which was
  570.11 ++generated by GNU Autoconf 2.59.  Invocation command line was
  570.12 ++
  570.13 ++  $ ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
  570.14 ++
  570.15 ++## --------- ##
  570.16 ++## Platform. ##
  570.17 ++## --------- ##
  570.18 ++
  570.19 ++hostname = beastie
  570.20 ++uname -m = i686
  570.21 ++uname -r = 2.6.24.2-slitaz
  570.22 ++uname -s = Linux
  570.23 ++uname -v = #1 SMP Mon Mar 10 16:36:10 CET 2008
  570.24 ++
  570.25 ++/usr/bin/uname -p = unknown
  570.26 ++/bin/uname -X     = unknown
  570.27 ++
  570.28 ++/bin/arch              = unknown
  570.29 ++/usr/bin/arch -k       = unknown
  570.30 ++/usr/convex/getsysinfo = unknown
  570.31 ++hostinfo               = unknown
  570.32 ++/bin/machine           = unknown
  570.33 ++/usr/bin/oslevel       = unknown
  570.34 ++/bin/universe          = unknown
  570.35 ++
  570.36 ++PATH: /usr/sbin
  570.37 ++PATH: /usr/bin
  570.38 ++PATH: /sbin
  570.39 ++PATH: /bin
  570.40 ++PATH: /usr/games
  570.41 ++
  570.42 ++
  570.43 ++## ----------- ##
  570.44 ++## Core tests. ##
  570.45 ++## ----------- ##
  570.46 ++
  570.47 ++configure:1378: checking for a BSD-compatible install
  570.48 ++configure:1433: result: /usr/bin/install -c
  570.49 ++configure:1444: checking whether build environment is sane
  570.50 ++configure:1487: result: yes
  570.51 ++configure:1520: checking for gawk
  570.52 ++configure:1549: result: no
  570.53 ++configure:1520: checking for mawk
  570.54 ++configure:1549: result: no
  570.55 ++configure:1520: checking for nawk
  570.56 ++configure:1549: result: no
  570.57 ++configure:1520: checking for awk
  570.58 ++configure:1536: found /usr/bin/awk
  570.59 ++configure:1546: result: awk
  570.60 ++configure:1556: checking whether make sets $(MAKE)
  570.61 ++configure:1576: result: yes
  570.62 ++configure:1734: checking build system type
  570.63 ++configure:1752: result: i486-pc-linux-gnu
  570.64 ++configure:1770: checking for i486-pc-linux-gnu-gcc
  570.65 ++configure:1786: found /usr/bin/i486-pc-linux-gnu-gcc
  570.66 ++configure:1796: result: i486-pc-linux-gnu-gcc
  570.67 ++configure:2078: checking for C compiler version
  570.68 ++configure:2081: i486-pc-linux-gnu-gcc --version </dev/null >&5
  570.69 ++i486-pc-linux-gnu-gcc (GCC) 4.2.2
  570.70 ++Copyright (C) 2007 Free Software Foundation, Inc.
  570.71 ++This is free software; see the source for copying conditions.  There is NO
  570.72 ++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  570.73 ++
  570.74 ++configure:2084: $? = 0
  570.75 ++configure:2086: i486-pc-linux-gnu-gcc -v </dev/null >&5
  570.76 ++Using built-in specs.
  570.77 ++Target: i486-pc-linux-gnu
  570.78 ++Configured with: ../gcc-4.2.2/configure --prefix=/usr --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls --enable-languages=c,c++ --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-threads=posix --with-tune=i486 i486-pc-linux-gnu
  570.79 ++Thread model: posix
  570.80 ++gcc version 4.2.2
  570.81 ++configure:2089: $? = 0
  570.82 ++configure:2091: i486-pc-linux-gnu-gcc -V </dev/null >&5
  570.83 ++i486-pc-linux-gnu-gcc: '-V' option must have argument
  570.84 ++configure:2094: $? = 1
  570.85 ++configure:2117: checking for C compiler default output file name
  570.86 ++configure:2120: i486-pc-linux-gnu-gcc    conftest.c  >&5
  570.87 ++configure:2123: $? = 0
  570.88 ++configure:2169: result: a.out
  570.89 ++configure:2174: checking whether the C compiler works
  570.90 ++configure:2180: ./a.out
  570.91 ++configure:2183: $? = 0
  570.92 ++configure:2200: result: yes
  570.93 ++configure:2207: checking whether we are cross compiling
  570.94 ++configure:2209: result: no
  570.95 ++configure:2212: checking for suffix of executables
  570.96 ++configure:2214: i486-pc-linux-gnu-gcc -o conftest    conftest.c  >&5
  570.97 ++configure:2217: $? = 0
  570.98 ++configure:2242: result: 
  570.99 ++configure:2248: checking for suffix of object files
 570.100 ++configure:2269: i486-pc-linux-gnu-gcc -c   conftest.c >&5
 570.101 ++configure:2272: $? = 0
 570.102 ++configure:2294: result: o
 570.103 ++configure:2298: checking whether we are using the GNU C compiler
 570.104 ++configure:2322: i486-pc-linux-gnu-gcc -c   conftest.c >&5
 570.105 ++configure:2328: $? = 0
 570.106 ++configure:2331: test -z 			 || test ! -s conftest.err
 570.107 ++configure:2334: $? = 0
 570.108 ++configure:2337: test -s conftest.o
 570.109 ++configure:2340: $? = 0
 570.110 ++configure:2353: result: yes
 570.111 ++configure:2359: checking whether i486-pc-linux-gnu-gcc accepts -g
 570.112 ++configure:2380: i486-pc-linux-gnu-gcc -c -g  conftest.c >&5
 570.113 ++configure:2386: $? = 0
 570.114 ++configure:2389: test -z 			 || test ! -s conftest.err
 570.115 ++configure:2392: $? = 0
 570.116 ++configure:2395: test -s conftest.o
 570.117 ++configure:2398: $? = 0
 570.118 ++configure:2409: result: yes
 570.119 ++configure:2426: checking for i486-pc-linux-gnu-gcc option to accept ANSI C
 570.120 ++configure:2496: i486-pc-linux-gnu-gcc  -c -g -O2  conftest.c >&5
 570.121 ++configure:2502: $? = 0
 570.122 ++configure:2505: test -z 			 || test ! -s conftest.err
 570.123 ++configure:2508: $? = 0
 570.124 ++configure:2511: test -s conftest.o
 570.125 ++configure:2514: $? = 0
 570.126 ++configure:2532: result: none needed
 570.127 ++configure:2550: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.128 ++conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
 570.129 ++configure:2556: $? = 1
 570.130 ++configure: failed program was:
 570.131 ++| #ifndef __cplusplus
 570.132 ++|   choke me
 570.133 ++| #endif
 570.134 ++configure:2705: checking for style of include used by make
 570.135 ++configure:2733: result: GNU
 570.136 ++configure:2761: checking dependency style of i486-pc-linux-gnu-gcc
 570.137 ++configure:2823: result: gcc3
 570.138 ++configure:2830: checking for bash
 570.139 ++configure:2848: found /bin/bash
 570.140 ++configure:2860: result: /bin/bash
 570.141 ++configure:2875: checking for i486-pc-linux-gnu-pkg-config
 570.142 ++configure:2908: result: no
 570.143 ++configure:2917: checking for pkg-config
 570.144 ++configure:2935: found /usr/bin/pkg-config
 570.145 ++configure:2947: result: /usr/bin/pkg-config
 570.146 ++configure:2962: checking pkg-config is at least version 0.9.0
 570.147 ++configure:2965: result: yes
 570.148 ++configure:2976: checking for GTK_CFLAGS
 570.149 ++configure:2993: result: -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  
 570.150 ++configure:2995: checking for GTK_LIBS
 570.151 ++configure:3012: result: -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  
 570.152 ++configure:3043: checking for dirent.h that defines DIR
 570.153 ++configure:3067: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.154 ++configure:3073: $? = 0
 570.155 ++configure:3076: test -z 			 || test ! -s conftest.err
 570.156 ++configure:3079: $? = 0
 570.157 ++configure:3082: test -s conftest.o
 570.158 ++configure:3085: $? = 0
 570.159 ++configure:3096: result: yes
 570.160 ++configure:3109: checking for library containing opendir
 570.161 ++configure:3139: i486-pc-linux-gnu-gcc -o conftest -g -O2   conftest.c  >&5
 570.162 ++configure:3145: $? = 0
 570.163 ++configure:3148: test -z 			 || test ! -s conftest.err
 570.164 ++configure:3151: $? = 0
 570.165 ++configure:3154: test -s conftest
 570.166 ++configure:3157: $? = 0
 570.167 ++configure:3226: result: none required
 570.168 ++configure:3365: checking how to run the C preprocessor
 570.169 ++configure:3400: i486-pc-linux-gnu-gcc -E  conftest.c
 570.170 ++configure:3406: $? = 0
 570.171 ++configure:3438: i486-pc-linux-gnu-gcc -E  conftest.c
 570.172 ++conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
 570.173 ++configure:3444: $? = 1
 570.174 ++configure: failed program was:
 570.175 ++| /* confdefs.h.  */
 570.176 ++| 
 570.177 ++| #define PACKAGE_NAME "XArchive"
 570.178 ++| #define PACKAGE_TARNAME "xarchive"
 570.179 ++| #define PACKAGE_VERSION "0.2.8-6"
 570.180 ++| #define PACKAGE_STRING "XArchive 0.2.8-6"
 570.181 ++| #define PACKAGE_BUGREPORT "Lee Bigelow <ligelowbee@yahoo.com>"
 570.182 ++| #define PACKAGE "xarchive"
 570.183 ++| #define VERSION "0.2.8-6"
 570.184 ++| #define _GNU_SOURCE 1
 570.185 ++| #define HAVE_DIRENT_H 1
 570.186 ++| /* end confdefs.h.  */
 570.187 ++| #include <ac_nonexistent.h>
 570.188 ++configure:3483: result: i486-pc-linux-gnu-gcc -E
 570.189 ++configure:3507: i486-pc-linux-gnu-gcc -E  conftest.c
 570.190 ++configure:3513: $? = 0
 570.191 ++configure:3545: i486-pc-linux-gnu-gcc -E  conftest.c
 570.192 ++conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
 570.193 ++configure:3551: $? = 1
 570.194 ++configure: failed program was:
 570.195 ++| /* confdefs.h.  */
 570.196 ++| 
 570.197 ++| #define PACKAGE_NAME "XArchive"
 570.198 ++| #define PACKAGE_TARNAME "xarchive"
 570.199 ++| #define PACKAGE_VERSION "0.2.8-6"
 570.200 ++| #define PACKAGE_STRING "XArchive 0.2.8-6"
 570.201 ++| #define PACKAGE_BUGREPORT "Lee Bigelow <ligelowbee@yahoo.com>"
 570.202 ++| #define PACKAGE "xarchive"
 570.203 ++| #define VERSION "0.2.8-6"
 570.204 ++| #define _GNU_SOURCE 1
 570.205 ++| #define HAVE_DIRENT_H 1
 570.206 ++| /* end confdefs.h.  */
 570.207 ++| #include <ac_nonexistent.h>
 570.208 ++configure:3595: checking for egrep
 570.209 ++configure:3605: result: grep -E
 570.210 ++configure:3610: checking for ANSI C header files
 570.211 ++configure:3635: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.212 ++configure:3641: $? = 0
 570.213 ++configure:3644: test -z 			 || test ! -s conftest.err
 570.214 ++configure:3647: $? = 0
 570.215 ++configure:3650: test -s conftest.o
 570.216 ++configure:3653: $? = 0
 570.217 ++configure:3742: i486-pc-linux-gnu-gcc -o conftest -g -O2   conftest.c  >&5
 570.218 ++conftest.c: In function 'main':
 570.219 ++conftest.c:30: warning: incompatible implicit declaration of built-in function 'exit'
 570.220 ++configure:3745: $? = 0
 570.221 ++configure:3747: ./conftest
 570.222 ++configure:3750: $? = 0
 570.223 ++configure:3765: result: yes
 570.224 ++configure:3789: checking for sys/types.h
 570.225 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.226 ++configure:3811: $? = 0
 570.227 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.228 ++configure:3817: $? = 0
 570.229 ++configure:3820: test -s conftest.o
 570.230 ++configure:3823: $? = 0
 570.231 ++configure:3834: result: yes
 570.232 ++configure:3789: checking for sys/stat.h
 570.233 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.234 ++configure:3811: $? = 0
 570.235 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.236 ++configure:3817: $? = 0
 570.237 ++configure:3820: test -s conftest.o
 570.238 ++configure:3823: $? = 0
 570.239 ++configure:3834: result: yes
 570.240 ++configure:3789: checking for stdlib.h
 570.241 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.242 ++configure:3811: $? = 0
 570.243 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.244 ++configure:3817: $? = 0
 570.245 ++configure:3820: test -s conftest.o
 570.246 ++configure:3823: $? = 0
 570.247 ++configure:3834: result: yes
 570.248 ++configure:3789: checking for string.h
 570.249 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.250 ++configure:3811: $? = 0
 570.251 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.252 ++configure:3817: $? = 0
 570.253 ++configure:3820: test -s conftest.o
 570.254 ++configure:3823: $? = 0
 570.255 ++configure:3834: result: yes
 570.256 ++configure:3789: checking for memory.h
 570.257 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.258 ++configure:3811: $? = 0
 570.259 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.260 ++configure:3817: $? = 0
 570.261 ++configure:3820: test -s conftest.o
 570.262 ++configure:3823: $? = 0
 570.263 ++configure:3834: result: yes
 570.264 ++configure:3789: checking for strings.h
 570.265 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.266 ++configure:3811: $? = 0
 570.267 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.268 ++configure:3817: $? = 0
 570.269 ++configure:3820: test -s conftest.o
 570.270 ++configure:3823: $? = 0
 570.271 ++configure:3834: result: yes
 570.272 ++configure:3789: checking for inttypes.h
 570.273 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.274 ++configure:3811: $? = 0
 570.275 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.276 ++configure:3817: $? = 0
 570.277 ++configure:3820: test -s conftest.o
 570.278 ++configure:3823: $? = 0
 570.279 ++configure:3834: result: yes
 570.280 ++configure:3789: checking for stdint.h
 570.281 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.282 ++configure:3811: $? = 0
 570.283 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.284 ++configure:3817: $? = 0
 570.285 ++configure:3820: test -s conftest.o
 570.286 ++configure:3823: $? = 0
 570.287 ++configure:3834: result: yes
 570.288 ++configure:3789: checking for unistd.h
 570.289 ++configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.290 ++configure:3811: $? = 0
 570.291 ++configure:3814: test -z 			 || test ! -s conftest.err
 570.292 ++configure:3817: $? = 0
 570.293 ++configure:3820: test -s conftest.o
 570.294 ++configure:3823: $? = 0
 570.295 ++configure:3834: result: yes
 570.296 ++configure:3853: checking for stdlib.h
 570.297 ++configure:3858: result: yes
 570.298 ++configure:3853: checking for string.h
 570.299 ++configure:3858: result: yes
 570.300 ++configure:3853: checking for unistd.h
 570.301 ++configure:3858: result: yes
 570.302 ++configure:3999: checking for an ANSI C-conforming const
 570.303 ++configure:4066: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 570.304 ++configure:4072: $? = 0
 570.305 ++configure:4075: test -z 			 || test ! -s conftest.err
 570.306 ++configure:4078: $? = 0
 570.307 ++configure:4081: test -s conftest.o
 570.308 ++configure:4084: $? = 0
 570.309 ++configure:4095: result: yes
 570.310 ++configure:4109: checking for working alloca.h
 570.311 ++configure:4130: i486-pc-linux-gnu-gcc -o conftest -g -O2   conftest.c  >&5
 570.312 ++
 570.313 ++## ---------------- ##
 570.314 ++## Cache variables. ##
 570.315 ++## ---------------- ##
 570.316 ++
 570.317 ++ac_cv_build=i486-pc-linux-gnu
 570.318 ++ac_cv_build_alias=i486-pc-linux-gnu
 570.319 ++ac_cv_c_compiler_gnu=yes
 570.320 ++ac_cv_c_const=yes
 570.321 ++ac_cv_env_CC_set=
 570.322 ++ac_cv_env_CC_value=
 570.323 ++ac_cv_env_CFLAGS_set=
 570.324 ++ac_cv_env_CFLAGS_value=
 570.325 ++ac_cv_env_CPPFLAGS_set=
 570.326 ++ac_cv_env_CPPFLAGS_value=
 570.327 ++ac_cv_env_CPP_set=
 570.328 ++ac_cv_env_CPP_value=
 570.329 ++ac_cv_env_GTK_CFLAGS_set=
 570.330 ++ac_cv_env_GTK_CFLAGS_value=
 570.331 ++ac_cv_env_GTK_LIBS_set=
 570.332 ++ac_cv_env_GTK_LIBS_value=
 570.333 ++ac_cv_env_LDFLAGS_set=
 570.334 ++ac_cv_env_LDFLAGS_value=
 570.335 ++ac_cv_env_PKG_CONFIG_set=
 570.336 ++ac_cv_env_PKG_CONFIG_value=
 570.337 ++ac_cv_env_build_alias_set=set
 570.338 ++ac_cv_env_build_alias_value=i486-pc-linux-gnu
 570.339 ++ac_cv_env_host_alias_set=set
 570.340 ++ac_cv_env_host_alias_value=i486-pc-linux-gnu
 570.341 ++ac_cv_env_target_alias_set=
 570.342 ++ac_cv_env_target_alias_value=
 570.343 ++ac_cv_exeext=
 570.344 ++ac_cv_header_dirent_dirent_h=yes
 570.345 ++ac_cv_header_inttypes_h=yes
 570.346 ++ac_cv_header_memory_h=yes
 570.347 ++ac_cv_header_stdc=yes
 570.348 ++ac_cv_header_stdint_h=yes
 570.349 ++ac_cv_header_stdlib_h=yes
 570.350 ++ac_cv_header_string_h=yes
 570.351 ++ac_cv_header_strings_h=yes
 570.352 ++ac_cv_header_sys_stat_h=yes
 570.353 ++ac_cv_header_sys_types_h=yes
 570.354 ++ac_cv_header_unistd_h=yes
 570.355 ++ac_cv_objext=o
 570.356 ++ac_cv_path_BASH_PROG=/bin/bash
 570.357 ++ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
 570.358 ++ac_cv_path_install='/usr/bin/install -c'
 570.359 ++ac_cv_prog_AWK=awk
 570.360 ++ac_cv_prog_CC=i486-pc-linux-gnu-gcc
 570.361 ++ac_cv_prog_CPP='i486-pc-linux-gnu-gcc -E'
 570.362 ++ac_cv_prog_cc_g=yes
 570.363 ++ac_cv_prog_cc_stdc=
 570.364 ++ac_cv_prog_egrep='grep -E'
 570.365 ++ac_cv_prog_make_make_set=yes
 570.366 ++ac_cv_search_opendir='none required'
 570.367 ++am_cv_CC_dependencies_compiler_type=gcc3
 570.368 ++pkg_cv_GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  '
 570.369 ++pkg_cv_GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  '
 570.370 ++
 570.371 ++## ----------------- ##
 570.372 ++## Output variables. ##
 570.373 ++## ----------------- ##
 570.374 ++
 570.375 ++ACLOCAL='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run aclocal-1.6'
 570.376 ++ALLOCA=''
 570.377 ++AMDEPBACKSLASH='\'
 570.378 ++AMDEP_FALSE='#'
 570.379 ++AMDEP_TRUE=''
 570.380 ++AMTAR='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run tar'
 570.381 ++AUTOCONF='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoconf'
 570.382 ++AUTOHEADER='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoheader'
 570.383 ++AUTOMAKE='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run automake-1.6'
 570.384 ++AWK='awk'
 570.385 ++BASH_PROG='/bin/bash'
 570.386 ++BASH_PROG='/bin/bash'
 570.387 ++CC='i486-pc-linux-gnu-gcc'
 570.388 ++CCDEPMODE='depmode=gcc3'
 570.389 ++CFLAGS='-g -O2'
 570.390 ++CONFIGURE_CFLAGS=''
 570.391 ++CONFIGURE_LDFLAGS=''
 570.392 ++CPP='i486-pc-linux-gnu-gcc -E'
 570.393 ++CPPFLAGS=''
 570.394 ++DEFS=''
 570.395 ++DEPDIR='.deps'
 570.396 ++ECHO_C=''
 570.397 ++ECHO_N='-n'
 570.398 ++ECHO_T=''
 570.399 ++EGREP='grep -E'
 570.400 ++EXEEXT=''
 570.401 ++GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  '
 570.402 ++GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  '
 570.403 ++GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  '
 570.404 ++GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  '
 570.405 ++INSTALL_DATA='${INSTALL} -m 644'
 570.406 ++INSTALL_PROGRAM='${INSTALL}'
 570.407 ++INSTALL_SCRIPT='${INSTALL}'
 570.408 ++INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
 570.409 ++LDFLAGS=''
 570.410 ++LIBOBJS=''
 570.411 ++LIBS=''
 570.412 ++LTLIBOBJS=''
 570.413 ++MAKEINFO='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run makeinfo'
 570.414 ++OBJEXT='o'
 570.415 ++PACKAGE='xarchive'
 570.416 ++PACKAGE_BUGREPORT='Lee Bigelow <ligelowbee@yahoo.com>'
 570.417 ++PACKAGE_NAME='XArchive'
 570.418 ++PACKAGE_STRING='XArchive 0.2.8-6'
 570.419 ++PACKAGE_TARNAME='xarchive'
 570.420 ++PACKAGE_VERSION='0.2.8-6'
 570.421 ++PATH_SEPARATOR=':'
 570.422 ++PKG_CONFIG='/usr/bin/pkg-config'
 570.423 ++SET_MAKE=''
 570.424 ++SHELL='/bin/bash'
 570.425 ++STRIP=''
 570.426 ++VERSION='0.2.8-6'
 570.427 ++ac_ct_CC=''
 570.428 ++ac_ct_STRIP=''
 570.429 ++ac_pt_PKG_CONFIG='/usr/bin/pkg-config'
 570.430 ++am__include='include'
 570.431 ++am__quote=''
 570.432 ++bindir='${exec_prefix}/bin'
 570.433 ++build='i486-pc-linux-gnu'
 570.434 ++build_alias='i486-pc-linux-gnu'
 570.435 ++build_cpu='i486'
 570.436 ++build_os='linux-gnu'
 570.437 ++build_os='linux-gnu'
 570.438 ++build_vendor='pc'
 570.439 ++datadir='${prefix}/share'
 570.440 ++exec_prefix='NONE'
 570.441 ++host_alias='i486-pc-linux-gnu'
 570.442 ++includedir='${prefix}/include'
 570.443 ++infodir='/usr/share/info'
 570.444 ++install_sh='/home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/install-sh'
 570.445 ++libdir='${exec_prefix}/lib'
 570.446 ++libexecdir='${exec_prefix}/libexec'
 570.447 ++localstatedir='${prefix}/var'
 570.448 ++mandir='/usr/share/man'
 570.449 ++oldincludedir='/usr/include'
 570.450 ++prefix='/usr'
 570.451 ++program_transform_name='s,x,x,'
 570.452 ++sbindir='${exec_prefix}/sbin'
 570.453 ++sharedstatedir='${prefix}/com'
 570.454 ++sysconfdir='${prefix}/etc'
 570.455 ++target_alias=''
 570.456 ++
 570.457 ++## ----------- ##
 570.458 ++## confdefs.h. ##
 570.459 ++## ----------- ##
 570.460 ++
 570.461 ++#define HAVE_DIRENT_H 1
 570.462 ++#define HAVE_INTTYPES_H 1
 570.463 ++#define HAVE_MEMORY_H 1
 570.464 ++#define HAVE_STDINT_H 1
 570.465 ++#define HAVE_STDLIB_H 1
 570.466 ++#define HAVE_STDLIB_H 1
 570.467 ++#define HAVE_STRINGS_H 1
 570.468 ++#define HAVE_STRING_H 1
 570.469 ++#define HAVE_STRING_H 1
 570.470 ++#define HAVE_SYS_STAT_H 1
 570.471 ++#define HAVE_SYS_TYPES_H 1
 570.472 ++#define HAVE_UNISTD_H 1
 570.473 ++#define HAVE_UNISTD_H 1
 570.474 ++#define PACKAGE "xarchive"
 570.475 ++#define PACKAGE_BUGREPORT "Lee Bigelow <ligelowbee@yahoo.com>"
 570.476 ++#define PACKAGE_NAME "XArchive"
 570.477 ++#define PACKAGE_STRING "XArchive 0.2.8-6"
 570.478 ++#define PACKAGE_TARNAME "xarchive"
 570.479 ++#define PACKAGE_VERSION "0.2.8-6"
 570.480 ++#define STDC_HEADERS 1
 570.481 ++#define VERSION "0.2.8-6"
 570.482 ++#define _GNU_SOURCE 1
 570.483 ++
 570.484 ++configure: caught signal 2
 570.485 ++configure: exit 1
 570.486 +--- xarchive-0.2.8-6.old/wrappers/7za.src	Tue Nov 15 12:59:51 2005
 570.487 ++++ xarchive-0.2.8-6/wrappers/7za.src	Sat Mar 22 13:01:15 2008
 570.488 +@@ -51,9 +51,9 @@
 570.489 + # the shifting will leave the files passed as
 570.490 + # all the remaining args: "$@"
 570.491 + opt="$1"
 570.492 +-shift 1
 570.493 ++test -z $1 || shift 1
 570.494 + archive="$1"
 570.495 +-shift 1
 570.496 ++test -z $1 || shift 1
 570.497 + 
 570.498 + # Command line options for prog functions
 570.499 + NEW_OPTS="a -ms=off"
 570.500 +--- xarchive-0.2.8-6.old/wrappers/ace.src	Sat Jan 14 04:49:36 2006
 570.501 ++++ xarchive-0.2.8-6/wrappers/ace.src	Sat Mar 22 13:01:15 2008
 570.502 +@@ -48,9 +48,9 @@
 570.503 + # the shifting will leave the files passed as
 570.504 + # all the remaining args "$@"
 570.505 + opt="$1"
 570.506 +-shift 1
 570.507 ++test -z $1 || shift 1
 570.508 + archive="$1"
 570.509 +-shift 1
 570.510 ++test -z $1 || shift 1
 570.511 + 
 570.512 + # Command line options for prog functions
 570.513 + # disable comments when opening
 570.514 +--- xarchive-0.2.8-6.old/wrappers/arj.src	Tue Nov 15 12:59:56 2005
 570.515 ++++ xarchive-0.2.8-6/wrappers/arj.src	Sat Mar 22 13:01:15 2008
 570.516 +@@ -52,9 +52,9 @@
 570.517 + # the shifting will leave the files passed as
 570.518 + # all the remaining args: "$@"
 570.519 + opt="$1"
 570.520 +-shift 1
 570.521 ++test -z $1 || shift 1
 570.522 + archive="$1"
 570.523 +-shift 1
 570.524 ++test -z $1 || shift 1
 570.525 + 
 570.526 + # Command line options for prog functions
 570.527 + NEW_OPTS="a"
 570.528 +--- xarchive-0.2.8-6.old/wrappers/deb.src	Tue Nov  8 17:49:13 2005
 570.529 ++++ xarchive-0.2.8-6/wrappers/deb.src	Sat Mar 22 13:01:15 2008
 570.530 +@@ -40,9 +40,9 @@
 570.531 + # the shifting will leave the files passed as
 570.532 + # all the remaining args "$@"
 570.533 + opt="$1"
 570.534 +-shift 1
 570.535 ++test -z $1 || shift 1
 570.536 + archive="$1"
 570.537 +-shift 1
 570.538 ++test -z $1 || shift 1
 570.539 + 
 570.540 + 
 570.541 + # Command line options for prog functions
 570.542 +--- xarchive-0.2.8-6.old/wrappers/rar.src	Mon Nov 14 21:41:21 2005
 570.543 ++++ xarchive-0.2.8-6/wrappers/rar.src	Sat Mar 22 13:01:15 2008
 570.544 +@@ -53,9 +53,9 @@
 570.545 + # the shifting will leave the files passed as
 570.546 + # all the remaining args "$@"
 570.547 + opt="$1"
 570.548 +-shift 1
 570.549 ++test -z $1 || shift 1
 570.550 + archive="$1"
 570.551 +-shift 1
 570.552 ++test -z $1 || shift 1
 570.553 + 
 570.554 + # Command line options for prog functions
 570.555 + # disable comments when opening
 570.556 +--- xarchive-0.2.8-6.old/wrappers/rpm-bsd.src	Tue Nov  8 17:49:13 2005
 570.557 ++++ xarchive-0.2.8-6/wrappers/rpm-bsd.src	Sat Mar 22 13:01:16 2008
 570.558 +@@ -42,9 +42,9 @@
 570.559 + # the shifting will leave the files passed as
 570.560 + # all the remaining args "$@"
 570.561 + opt="$1"
 570.562 +-shift 1
 570.563 ++test -z $1 || shift 1
 570.564 + archive="$1"
 570.565 +-shift 1
 570.566 ++test -z $1 || shift 1
 570.567 + 
 570.568 + # the option switches
 570.569 + case "$opt" in
 570.570 +--- xarchive-0.2.8-6.old/wrappers/rpm-gnu.src	Tue Nov  8 17:49:13 2005
 570.571 ++++ xarchive-0.2.8-6/wrappers/rpm-gnu.src	Sat Mar 22 13:01:16 2008
 570.572 +@@ -41,9 +41,9 @@
 570.573 + # the shifting will leave the files passed as
 570.574 + # all the remaining args "$@"
 570.575 + opt="$1"
 570.576 +-shift 1
 570.577 ++test -z $1 || shift 1
 570.578 + archive="$1"
 570.579 +-shift 1
 570.580 ++test -z $1 || shift 1
 570.581 + 
 570.582 + # the option switches
 570.583 + case "$opt" in
 570.584 +--- xarchive-0.2.8-6.old/wrappers/tar-bsd.src	Tue Nov  8 20:51:54 2005
 570.585 ++++ xarchive-0.2.8-6/wrappers/tar-bsd.src	Sat Mar 22 13:01:16 2008
 570.586 +@@ -43,9 +43,9 @@
 570.587 + # the shifting will leave the files passed as
 570.588 + # all the remaining args "$@"
 570.589 + opt="$1"
 570.590 +-shift 1
 570.591 ++test -z $1 || shift 1
 570.592 + archive="$1"
 570.593 +-shift 1
 570.594 ++test -z $1 || shift 1
 570.595 + 
 570.596 + # set up compression variables for our compression functions. 
 570.597 + # translate archive name to lower case for pattern matching.
 570.598 +--- xarchive-0.2.8-6.old/wrappers/tar-gnu.src	Tue Nov  8 20:50:59 2005
 570.599 ++++ xarchive-0.2.8-6/wrappers/tar-gnu.src	Sat Mar 22 13:16:15 2008
 570.600 +@@ -42,9 +42,9 @@
 570.601 + # the shifting will leave the files passed as
 570.602 + # all the remaining args "$@"
 570.603 + opt="$1"
 570.604 +-shift 1
 570.605 ++test -z $1 || shift 1
 570.606 + archive="$1"
 570.607 +-shift 1
 570.608 ++test -z $1 || shift 1
 570.609 + 
 570.610 + # set up compression variables for our compression functions. 
 570.611 + # translate archive name to lower case for pattern matching.
 570.612 +@@ -54,14 +54,14 @@
 570.613 +     if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
 570.614 +         DECOMPRESS="gzip -dc"
 570.615 +         COMPRESS="gzip -c"
 570.616 +-        TAR_COMPRESS_OPT="--use-compress-prog=gzip"
 570.617 ++        TAR_COMPRESS_OPT="z"
 570.618 +     fi
 570.619 + done
 570.620 + for ext in $BZIP2_EXTS; do
 570.621 +     if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
 570.622 +         DECOMPRESS="bzip2 -dc" 
 570.623 +         COMPRESS="bzip2 -c"
 570.624 +-        TAR_COMPRESS_OPT="--use-compress-prog=bzip2"
 570.625 ++        TAR_COMPRESS_OPT="j"
 570.626 +     fi
 570.627 + done
 570.628 + for ext in $COMPRESS_EXTS; do
 570.629 +@@ -76,8 +76,8 @@
 570.630 + # open and extract can use tar's cmd line option
 570.631 + # add, new, and remove need to decompress the tar first
 570.632 + # do their thing, than recompress the tar.
 570.633 +-OPEN_OPTS="$TAR_COMPRESS_OPT -tvf"
 570.634 +-EXTRACT_OPTS="$TAR_COMPRESS_OPT -xf"
 570.635 ++OPEN_OPTS="-tv${TAR_COMPRESS_OPT}f"
 570.636 ++EXTRACT_OPTS="-x${TAR_COMPRESS_OPT}f"
 570.637 + ADD_OPTS="-rf"
 570.638 + NEW_OPTS="-cf"
 570.639 + REMOVE_OPTS="--delete -f"
 570.640 +@@ -206,11 +206,12 @@
 570.641 +         ;;
 570.642 + 
 570.643 +     -r) # remove: from archive passed files 
 570.644 +-        decompress_func
 570.645 +-        $TAR_PROG $REMOVE_OPTS "$archive" "$@"
 570.646 +-        wrapper_status=$?
 570.647 +-        compress_func
 570.648 +-        exit $wrapper_status
 570.649 ++        #decompress_func
 570.650 ++        #$TAR_PROG $REMOVE_OPTS "$archive" "$@"
 570.651 ++        #wrapper_status=$?
 570.652 ++        #compress_func
 570.653 ++        #exit $wrapper_status
 570.654 ++        exit $E_UNSUPPORTED
 570.655 +         ;;
 570.656 + 
 570.657 +     -e) # extract: from archive passed files 
 570.658 +--- xarchive-0.2.8-6.old/wrappers/zip.src	Tue Nov 15 13:02:08 2005
 570.659 ++++ xarchive-0.2.8-6/wrappers/zip.src	Sat Mar 22 13:01:16 2008
 570.660 +@@ -51,9 +51,9 @@
 570.661 + # the shifting will leave the files passed as
 570.662 + # all the remaining args: "$@"
 570.663 + opt="$1"
 570.664 +-shift 1
 570.665 ++test -z $1 || shift 1
 570.666 + archive="$1"
 570.667 +-shift 1
 570.668 ++test -z $1 || shift 1
 570.669 + 
 570.670 + # Command line options for prog functions
 570.671 + 
 570.672 +--- xarchive-0.2.8-6/xarchive.desktop.src	
 570.673 ++++ xarchive-0.2.8-6/xarchive.desktop.src	
 570.674 +@@ -12,7 +12,7 @@
 570.675 + Comment[en_GB]=Create, modify and browse an archive
 570.676 + GenericName=Archive Manager
 570.677 + 
 570.678 +-Categories=Gtk;Application;System;Utility;
 570.679 ++Categories=Gtk;Utility;
 570.680 + Exec=xarchive %F
 570.681 + Icon=/path/to/icons/xarchive.xpm
 570.682 + StartupNotify=true
 570.683 +
 570.684 +--- xarchive-0.2.8-6/src/main.c
 570.685 ++++ xarchive-0.2.8-6/src/main.c
 570.686 +@@ -178,6 +178,10 @@
 570.687 +     {
 570.688 +       ext = (gchar *) g_ptr_array_index(wrapent->ext_array, e);
 570.689 +       g_string_append_printf(info_text,"%s ", ext);
 570.690 ++      if (e % 10 == 9)
 570.691 ++      {
 570.692 ++        g_string_append_printf(info_text,"\n                 ");
 570.693 ++      }
 570.694 +     }
 570.695 +     g_string_append_c(info_text, '\n');
 570.696 +   }
   571.1 --- a/xarchive/stuff/slitaz-xarchive-wrappers-0.2.8-6.patch	Wed May 09 17:03:28 2018 +0300
   571.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   571.3 @@ -1,693 +0,0 @@
   571.4 ---- xarchive-0.2.8-6.old/config.log	Thu Jan  1 01:00:00 1970
   571.5 -+++ xarchive-0.2.8-6/config.log	Sat Mar 22 12:58:40 2008
   571.6 -@@ -0,0 +1,479 @@
   571.7 -+This file contains any messages produced by compilers while
   571.8 -+running configure, to aid debugging if configure makes a mistake.
   571.9 -+
  571.10 -+It was created by XArchive configure 0.2.8-6, which was
  571.11 -+generated by GNU Autoconf 2.59.  Invocation command line was
  571.12 -+
  571.13 -+  $ ./configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --build=i486-pc-linux-gnu --host=i486-pc-linux-gnu
  571.14 -+
  571.15 -+## --------- ##
  571.16 -+## Platform. ##
  571.17 -+## --------- ##
  571.18 -+
  571.19 -+hostname = beastie
  571.20 -+uname -m = i686
  571.21 -+uname -r = 2.6.24.2-slitaz
  571.22 -+uname -s = Linux
  571.23 -+uname -v = #1 SMP Mon Mar 10 16:36:10 CET 2008
  571.24 -+
  571.25 -+/usr/bin/uname -p = unknown
  571.26 -+/bin/uname -X     = unknown
  571.27 -+
  571.28 -+/bin/arch              = unknown
  571.29 -+/usr/bin/arch -k       = unknown
  571.30 -+/usr/convex/getsysinfo = unknown
  571.31 -+hostinfo               = unknown
  571.32 -+/bin/machine           = unknown
  571.33 -+/usr/bin/oslevel       = unknown
  571.34 -+/bin/universe          = unknown
  571.35 -+
  571.36 -+PATH: /usr/sbin
  571.37 -+PATH: /usr/bin
  571.38 -+PATH: /sbin
  571.39 -+PATH: /bin
  571.40 -+PATH: /usr/games
  571.41 -+
  571.42 -+
  571.43 -+## ----------- ##
  571.44 -+## Core tests. ##
  571.45 -+## ----------- ##
  571.46 -+
  571.47 -+configure:1378: checking for a BSD-compatible install
  571.48 -+configure:1433: result: /usr/bin/install -c
  571.49 -+configure:1444: checking whether build environment is sane
  571.50 -+configure:1487: result: yes
  571.51 -+configure:1520: checking for gawk
  571.52 -+configure:1549: result: no
  571.53 -+configure:1520: checking for mawk
  571.54 -+configure:1549: result: no
  571.55 -+configure:1520: checking for nawk
  571.56 -+configure:1549: result: no
  571.57 -+configure:1520: checking for awk
  571.58 -+configure:1536: found /usr/bin/awk
  571.59 -+configure:1546: result: awk
  571.60 -+configure:1556: checking whether make sets $(MAKE)
  571.61 -+configure:1576: result: yes
  571.62 -+configure:1734: checking build system type
  571.63 -+configure:1752: result: i486-pc-linux-gnu
  571.64 -+configure:1770: checking for i486-pc-linux-gnu-gcc
  571.65 -+configure:1786: found /usr/bin/i486-pc-linux-gnu-gcc
  571.66 -+configure:1796: result: i486-pc-linux-gnu-gcc
  571.67 -+configure:2078: checking for C compiler version
  571.68 -+configure:2081: i486-pc-linux-gnu-gcc --version </dev/null >&5
  571.69 -+i486-pc-linux-gnu-gcc (GCC) 4.2.2
  571.70 -+Copyright (C) 2007 Free Software Foundation, Inc.
  571.71 -+This is free software; see the source for copying conditions.  There is NO
  571.72 -+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  571.73 -+
  571.74 -+configure:2084: $? = 0
  571.75 -+configure:2086: i486-pc-linux-gnu-gcc -v </dev/null >&5
  571.76 -+Using built-in specs.
  571.77 -+Target: i486-pc-linux-gnu
  571.78 -+Configured with: ../gcc-4.2.2/configure --prefix=/usr --libexecdir=/usr/lib --infodir=/usr/share/info --mandir=/usr/share/man --enable-nls --enable-languages=c,c++ --enable-shared --with-system-zlib --enable-clocale=gnu --enable-objc-gc --enable-__cxa_atexit --enable-threads=posix --with-tune=i486 i486-pc-linux-gnu
  571.79 -+Thread model: posix
  571.80 -+gcc version 4.2.2
  571.81 -+configure:2089: $? = 0
  571.82 -+configure:2091: i486-pc-linux-gnu-gcc -V </dev/null >&5
  571.83 -+i486-pc-linux-gnu-gcc: '-V' option must have argument
  571.84 -+configure:2094: $? = 1
  571.85 -+configure:2117: checking for C compiler default output file name
  571.86 -+configure:2120: i486-pc-linux-gnu-gcc    conftest.c  >&5
  571.87 -+configure:2123: $? = 0
  571.88 -+configure:2169: result: a.out
  571.89 -+configure:2174: checking whether the C compiler works
  571.90 -+configure:2180: ./a.out
  571.91 -+configure:2183: $? = 0
  571.92 -+configure:2200: result: yes
  571.93 -+configure:2207: checking whether we are cross compiling
  571.94 -+configure:2209: result: no
  571.95 -+configure:2212: checking for suffix of executables
  571.96 -+configure:2214: i486-pc-linux-gnu-gcc -o conftest    conftest.c  >&5
  571.97 -+configure:2217: $? = 0
  571.98 -+configure:2242: result: 
  571.99 -+configure:2248: checking for suffix of object files
 571.100 -+configure:2269: i486-pc-linux-gnu-gcc -c   conftest.c >&5
 571.101 -+configure:2272: $? = 0
 571.102 -+configure:2294: result: o
 571.103 -+configure:2298: checking whether we are using the GNU C compiler
 571.104 -+configure:2322: i486-pc-linux-gnu-gcc -c   conftest.c >&5
 571.105 -+configure:2328: $? = 0
 571.106 -+configure:2331: test -z 			 || test ! -s conftest.err
 571.107 -+configure:2334: $? = 0
 571.108 -+configure:2337: test -s conftest.o
 571.109 -+configure:2340: $? = 0
 571.110 -+configure:2353: result: yes
 571.111 -+configure:2359: checking whether i486-pc-linux-gnu-gcc accepts -g
 571.112 -+configure:2380: i486-pc-linux-gnu-gcc -c -g  conftest.c >&5
 571.113 -+configure:2386: $? = 0
 571.114 -+configure:2389: test -z 			 || test ! -s conftest.err
 571.115 -+configure:2392: $? = 0
 571.116 -+configure:2395: test -s conftest.o
 571.117 -+configure:2398: $? = 0
 571.118 -+configure:2409: result: yes
 571.119 -+configure:2426: checking for i486-pc-linux-gnu-gcc option to accept ANSI C
 571.120 -+configure:2496: i486-pc-linux-gnu-gcc  -c -g -O2  conftest.c >&5
 571.121 -+configure:2502: $? = 0
 571.122 -+configure:2505: test -z 			 || test ! -s conftest.err
 571.123 -+configure:2508: $? = 0
 571.124 -+configure:2511: test -s conftest.o
 571.125 -+configure:2514: $? = 0
 571.126 -+configure:2532: result: none needed
 571.127 -+configure:2550: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.128 -+conftest.c:2: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'me'
 571.129 -+configure:2556: $? = 1
 571.130 -+configure: failed program was:
 571.131 -+| #ifndef __cplusplus
 571.132 -+|   choke me
 571.133 -+| #endif
 571.134 -+configure:2705: checking for style of include used by make
 571.135 -+configure:2733: result: GNU
 571.136 -+configure:2761: checking dependency style of i486-pc-linux-gnu-gcc
 571.137 -+configure:2823: result: gcc3
 571.138 -+configure:2830: checking for bash
 571.139 -+configure:2848: found /bin/bash
 571.140 -+configure:2860: result: /bin/bash
 571.141 -+configure:2875: checking for i486-pc-linux-gnu-pkg-config
 571.142 -+configure:2908: result: no
 571.143 -+configure:2917: checking for pkg-config
 571.144 -+configure:2935: found /usr/bin/pkg-config
 571.145 -+configure:2947: result: /usr/bin/pkg-config
 571.146 -+configure:2962: checking pkg-config is at least version 0.9.0
 571.147 -+configure:2965: result: yes
 571.148 -+configure:2976: checking for GTK_CFLAGS
 571.149 -+configure:2993: result: -I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  
 571.150 -+configure:2995: checking for GTK_LIBS
 571.151 -+configure:3012: result: -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  
 571.152 -+configure:3043: checking for dirent.h that defines DIR
 571.153 -+configure:3067: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.154 -+configure:3073: $? = 0
 571.155 -+configure:3076: test -z 			 || test ! -s conftest.err
 571.156 -+configure:3079: $? = 0
 571.157 -+configure:3082: test -s conftest.o
 571.158 -+configure:3085: $? = 0
 571.159 -+configure:3096: result: yes
 571.160 -+configure:3109: checking for library containing opendir
 571.161 -+configure:3139: i486-pc-linux-gnu-gcc -o conftest -g -O2   conftest.c  >&5
 571.162 -+configure:3145: $? = 0
 571.163 -+configure:3148: test -z 			 || test ! -s conftest.err
 571.164 -+configure:3151: $? = 0
 571.165 -+configure:3154: test -s conftest
 571.166 -+configure:3157: $? = 0
 571.167 -+configure:3226: result: none required
 571.168 -+configure:3365: checking how to run the C preprocessor
 571.169 -+configure:3400: i486-pc-linux-gnu-gcc -E  conftest.c
 571.170 -+configure:3406: $? = 0
 571.171 -+configure:3438: i486-pc-linux-gnu-gcc -E  conftest.c
 571.172 -+conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
 571.173 -+configure:3444: $? = 1
 571.174 -+configure: failed program was:
 571.175 -+| /* confdefs.h.  */
 571.176 -+| 
 571.177 -+| #define PACKAGE_NAME "XArchive"
 571.178 -+| #define PACKAGE_TARNAME "xarchive"
 571.179 -+| #define PACKAGE_VERSION "0.2.8-6"
 571.180 -+| #define PACKAGE_STRING "XArchive 0.2.8-6"
 571.181 -+| #define PACKAGE_BUGREPORT "Lee Bigelow <ligelowbee@yahoo.com>"
 571.182 -+| #define PACKAGE "xarchive"
 571.183 -+| #define VERSION "0.2.8-6"
 571.184 -+| #define _GNU_SOURCE 1
 571.185 -+| #define HAVE_DIRENT_H 1
 571.186 -+| /* end confdefs.h.  */
 571.187 -+| #include <ac_nonexistent.h>
 571.188 -+configure:3483: result: i486-pc-linux-gnu-gcc -E
 571.189 -+configure:3507: i486-pc-linux-gnu-gcc -E  conftest.c
 571.190 -+configure:3513: $? = 0
 571.191 -+configure:3545: i486-pc-linux-gnu-gcc -E  conftest.c
 571.192 -+conftest.c:13:28: error: ac_nonexistent.h: No such file or directory
 571.193 -+configure:3551: $? = 1
 571.194 -+configure: failed program was:
 571.195 -+| /* confdefs.h.  */
 571.196 -+| 
 571.197 -+| #define PACKAGE_NAME "XArchive"
 571.198 -+| #define PACKAGE_TARNAME "xarchive"
 571.199 -+| #define PACKAGE_VERSION "0.2.8-6"
 571.200 -+| #define PACKAGE_STRING "XArchive 0.2.8-6"
 571.201 -+| #define PACKAGE_BUGREPORT "Lee Bigelow <ligelowbee@yahoo.com>"
 571.202 -+| #define PACKAGE "xarchive"
 571.203 -+| #define VERSION "0.2.8-6"
 571.204 -+| #define _GNU_SOURCE 1
 571.205 -+| #define HAVE_DIRENT_H 1
 571.206 -+| /* end confdefs.h.  */
 571.207 -+| #include <ac_nonexistent.h>
 571.208 -+configure:3595: checking for egrep
 571.209 -+configure:3605: result: grep -E
 571.210 -+configure:3610: checking for ANSI C header files
 571.211 -+configure:3635: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.212 -+configure:3641: $? = 0
 571.213 -+configure:3644: test -z 			 || test ! -s conftest.err
 571.214 -+configure:3647: $? = 0
 571.215 -+configure:3650: test -s conftest.o
 571.216 -+configure:3653: $? = 0
 571.217 -+configure:3742: i486-pc-linux-gnu-gcc -o conftest -g -O2   conftest.c  >&5
 571.218 -+conftest.c: In function 'main':
 571.219 -+conftest.c:30: warning: incompatible implicit declaration of built-in function 'exit'
 571.220 -+configure:3745: $? = 0
 571.221 -+configure:3747: ./conftest
 571.222 -+configure:3750: $? = 0
 571.223 -+configure:3765: result: yes
 571.224 -+configure:3789: checking for sys/types.h
 571.225 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.226 -+configure:3811: $? = 0
 571.227 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.228 -+configure:3817: $? = 0
 571.229 -+configure:3820: test -s conftest.o
 571.230 -+configure:3823: $? = 0
 571.231 -+configure:3834: result: yes
 571.232 -+configure:3789: checking for sys/stat.h
 571.233 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.234 -+configure:3811: $? = 0
 571.235 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.236 -+configure:3817: $? = 0
 571.237 -+configure:3820: test -s conftest.o
 571.238 -+configure:3823: $? = 0
 571.239 -+configure:3834: result: yes
 571.240 -+configure:3789: checking for stdlib.h
 571.241 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.242 -+configure:3811: $? = 0
 571.243 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.244 -+configure:3817: $? = 0
 571.245 -+configure:3820: test -s conftest.o
 571.246 -+configure:3823: $? = 0
 571.247 -+configure:3834: result: yes
 571.248 -+configure:3789: checking for string.h
 571.249 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.250 -+configure:3811: $? = 0
 571.251 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.252 -+configure:3817: $? = 0
 571.253 -+configure:3820: test -s conftest.o
 571.254 -+configure:3823: $? = 0
 571.255 -+configure:3834: result: yes
 571.256 -+configure:3789: checking for memory.h
 571.257 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.258 -+configure:3811: $? = 0
 571.259 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.260 -+configure:3817: $? = 0
 571.261 -+configure:3820: test -s conftest.o
 571.262 -+configure:3823: $? = 0
 571.263 -+configure:3834: result: yes
 571.264 -+configure:3789: checking for strings.h
 571.265 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.266 -+configure:3811: $? = 0
 571.267 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.268 -+configure:3817: $? = 0
 571.269 -+configure:3820: test -s conftest.o
 571.270 -+configure:3823: $? = 0
 571.271 -+configure:3834: result: yes
 571.272 -+configure:3789: checking for inttypes.h
 571.273 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.274 -+configure:3811: $? = 0
 571.275 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.276 -+configure:3817: $? = 0
 571.277 -+configure:3820: test -s conftest.o
 571.278 -+configure:3823: $? = 0
 571.279 -+configure:3834: result: yes
 571.280 -+configure:3789: checking for stdint.h
 571.281 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.282 -+configure:3811: $? = 0
 571.283 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.284 -+configure:3817: $? = 0
 571.285 -+configure:3820: test -s conftest.o
 571.286 -+configure:3823: $? = 0
 571.287 -+configure:3834: result: yes
 571.288 -+configure:3789: checking for unistd.h
 571.289 -+configure:3805: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.290 -+configure:3811: $? = 0
 571.291 -+configure:3814: test -z 			 || test ! -s conftest.err
 571.292 -+configure:3817: $? = 0
 571.293 -+configure:3820: test -s conftest.o
 571.294 -+configure:3823: $? = 0
 571.295 -+configure:3834: result: yes
 571.296 -+configure:3853: checking for stdlib.h
 571.297 -+configure:3858: result: yes
 571.298 -+configure:3853: checking for string.h
 571.299 -+configure:3858: result: yes
 571.300 -+configure:3853: checking for unistd.h
 571.301 -+configure:3858: result: yes
 571.302 -+configure:3999: checking for an ANSI C-conforming const
 571.303 -+configure:4066: i486-pc-linux-gnu-gcc -c -g -O2  conftest.c >&5
 571.304 -+configure:4072: $? = 0
 571.305 -+configure:4075: test -z 			 || test ! -s conftest.err
 571.306 -+configure:4078: $? = 0
 571.307 -+configure:4081: test -s conftest.o
 571.308 -+configure:4084: $? = 0
 571.309 -+configure:4095: result: yes
 571.310 -+configure:4109: checking for working alloca.h
 571.311 -+configure:4130: i486-pc-linux-gnu-gcc -o conftest -g -O2   conftest.c  >&5
 571.312 -+
 571.313 -+## ---------------- ##
 571.314 -+## Cache variables. ##
 571.315 -+## ---------------- ##
 571.316 -+
 571.317 -+ac_cv_build=i486-pc-linux-gnu
 571.318 -+ac_cv_build_alias=i486-pc-linux-gnu
 571.319 -+ac_cv_c_compiler_gnu=yes
 571.320 -+ac_cv_c_const=yes
 571.321 -+ac_cv_env_CC_set=
 571.322 -+ac_cv_env_CC_value=
 571.323 -+ac_cv_env_CFLAGS_set=
 571.324 -+ac_cv_env_CFLAGS_value=
 571.325 -+ac_cv_env_CPPFLAGS_set=
 571.326 -+ac_cv_env_CPPFLAGS_value=
 571.327 -+ac_cv_env_CPP_set=
 571.328 -+ac_cv_env_CPP_value=
 571.329 -+ac_cv_env_GTK_CFLAGS_set=
 571.330 -+ac_cv_env_GTK_CFLAGS_value=
 571.331 -+ac_cv_env_GTK_LIBS_set=
 571.332 -+ac_cv_env_GTK_LIBS_value=
 571.333 -+ac_cv_env_LDFLAGS_set=
 571.334 -+ac_cv_env_LDFLAGS_value=
 571.335 -+ac_cv_env_PKG_CONFIG_set=
 571.336 -+ac_cv_env_PKG_CONFIG_value=
 571.337 -+ac_cv_env_build_alias_set=set
 571.338 -+ac_cv_env_build_alias_value=i486-pc-linux-gnu
 571.339 -+ac_cv_env_host_alias_set=set
 571.340 -+ac_cv_env_host_alias_value=i486-pc-linux-gnu
 571.341 -+ac_cv_env_target_alias_set=
 571.342 -+ac_cv_env_target_alias_value=
 571.343 -+ac_cv_exeext=
 571.344 -+ac_cv_header_dirent_dirent_h=yes
 571.345 -+ac_cv_header_inttypes_h=yes
 571.346 -+ac_cv_header_memory_h=yes
 571.347 -+ac_cv_header_stdc=yes
 571.348 -+ac_cv_header_stdint_h=yes
 571.349 -+ac_cv_header_stdlib_h=yes
 571.350 -+ac_cv_header_string_h=yes
 571.351 -+ac_cv_header_strings_h=yes
 571.352 -+ac_cv_header_sys_stat_h=yes
 571.353 -+ac_cv_header_sys_types_h=yes
 571.354 -+ac_cv_header_unistd_h=yes
 571.355 -+ac_cv_objext=o
 571.356 -+ac_cv_path_BASH_PROG=/bin/bash
 571.357 -+ac_cv_path_ac_pt_PKG_CONFIG=/usr/bin/pkg-config
 571.358 -+ac_cv_path_install='/usr/bin/install -c'
 571.359 -+ac_cv_prog_AWK=awk
 571.360 -+ac_cv_prog_CC=i486-pc-linux-gnu-gcc
 571.361 -+ac_cv_prog_CPP='i486-pc-linux-gnu-gcc -E'
 571.362 -+ac_cv_prog_cc_g=yes
 571.363 -+ac_cv_prog_cc_stdc=
 571.364 -+ac_cv_prog_egrep='grep -E'
 571.365 -+ac_cv_prog_make_make_set=yes
 571.366 -+ac_cv_search_opendir='none required'
 571.367 -+am_cv_CC_dependencies_compiler_type=gcc3
 571.368 -+pkg_cv_GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  '
 571.369 -+pkg_cv_GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  '
 571.370 -+
 571.371 -+## ----------------- ##
 571.372 -+## Output variables. ##
 571.373 -+## ----------------- ##
 571.374 -+
 571.375 -+ACLOCAL='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run aclocal-1.6'
 571.376 -+ALLOCA=''
 571.377 -+AMDEPBACKSLASH='\'
 571.378 -+AMDEP_FALSE='#'
 571.379 -+AMDEP_TRUE=''
 571.380 -+AMTAR='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run tar'
 571.381 -+AUTOCONF='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoconf'
 571.382 -+AUTOHEADER='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run autoheader'
 571.383 -+AUTOMAKE='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run automake-1.6'
 571.384 -+AWK='awk'
 571.385 -+BASH_PROG='/bin/bash'
 571.386 -+BASH_PROG='/bin/bash'
 571.387 -+CC='i486-pc-linux-gnu-gcc'
 571.388 -+CCDEPMODE='depmode=gcc3'
 571.389 -+CFLAGS='-g -O2'
 571.390 -+CONFIGURE_CFLAGS=''
 571.391 -+CONFIGURE_LDFLAGS=''
 571.392 -+CPP='i486-pc-linux-gnu-gcc -E'
 571.393 -+CPPFLAGS=''
 571.394 -+DEFS=''
 571.395 -+DEPDIR='.deps'
 571.396 -+ECHO_C=''
 571.397 -+ECHO_N='-n'
 571.398 -+ECHO_T=''
 571.399 -+EGREP='grep -E'
 571.400 -+EXEEXT=''
 571.401 -+GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  '
 571.402 -+GTK_CFLAGS='-I/usr/include/gtk-2.0 -I/usr/lib/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -I/usr/include/libpng12  '
 571.403 -+GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  '
 571.404 -+GTK_LIBS='-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgdk_pixbuf-2.0 -lm -lpangocairo-1.0 -lpango-1.0 -lcairo -lgobject-2.0 -lgmodule-2.0 -ldl -lglib-2.0  '
 571.405 -+INSTALL_DATA='${INSTALL} -m 644'
 571.406 -+INSTALL_PROGRAM='${INSTALL}'
 571.407 -+INSTALL_SCRIPT='${INSTALL}'
 571.408 -+INSTALL_STRIP_PROGRAM='${SHELL} $(install_sh) -c -s'
 571.409 -+LDFLAGS=''
 571.410 -+LIBOBJS=''
 571.411 -+LIBS=''
 571.412 -+LTLIBOBJS=''
 571.413 -+MAKEINFO='${SHELL} /home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/missing --run makeinfo'
 571.414 -+OBJEXT='o'
 571.415 -+PACKAGE='xarchive'
 571.416 -+PACKAGE_BUGREPORT='Lee Bigelow <ligelowbee@yahoo.com>'
 571.417 -+PACKAGE_NAME='XArchive'
 571.418 -+PACKAGE_STRING='XArchive 0.2.8-6'
 571.419 -+PACKAGE_TARNAME='xarchive'
 571.420 -+PACKAGE_VERSION='0.2.8-6'
 571.421 -+PATH_SEPARATOR=':'
 571.422 -+PKG_CONFIG='/usr/bin/pkg-config'
 571.423 -+SET_MAKE=''
 571.424 -+SHELL='/bin/bash'
 571.425 -+STRIP=''
 571.426 -+VERSION='0.2.8-6'
 571.427 -+ac_ct_CC=''
 571.428 -+ac_ct_STRIP=''
 571.429 -+ac_pt_PKG_CONFIG='/usr/bin/pkg-config'
 571.430 -+am__include='include'
 571.431 -+am__quote=''
 571.432 -+bindir='${exec_prefix}/bin'
 571.433 -+build='i486-pc-linux-gnu'
 571.434 -+build_alias='i486-pc-linux-gnu'
 571.435 -+build_cpu='i486'
 571.436 -+build_os='linux-gnu'
 571.437 -+build_os='linux-gnu'
 571.438 -+build_vendor='pc'
 571.439 -+datadir='${prefix}/share'
 571.440 -+exec_prefix='NONE'
 571.441 -+host_alias='i486-pc-linux-gnu'
 571.442 -+includedir='${prefix}/include'
 571.443 -+infodir='/usr/share/info'
 571.444 -+install_sh='/home/slitaz/wok/xarchive/xarchive-0.2.8-6/config/install-sh'
 571.445 -+libdir='${exec_prefix}/lib'
 571.446 -+libexecdir='${exec_prefix}/libexec'
 571.447 -+localstatedir='${prefix}/var'
 571.448 -+mandir='/usr/share/man'
 571.449 -+oldincludedir='/usr/include'
 571.450 -+prefix='/usr'
 571.451 -+program_transform_name='s,x,x,'
 571.452 -+sbindir='${exec_prefix}/sbin'
 571.453 -+sharedstatedir='${prefix}/com'
 571.454 -+sysconfdir='${prefix}/etc'
 571.455 -+target_alias=''
 571.456 -+
 571.457 -+## ----------- ##
 571.458 -+## confdefs.h. ##
 571.459 -+## ----------- ##
 571.460 -+
 571.461 -+#define HAVE_DIRENT_H 1
 571.462 -+#define HAVE_INTTYPES_H 1
 571.463 -+#define HAVE_MEMORY_H 1
 571.464 -+#define HAVE_STDINT_H 1
 571.465 -+#define HAVE_STDLIB_H 1
 571.466 -+#define HAVE_STDLIB_H 1
 571.467 -+#define HAVE_STRINGS_H 1
 571.468 -+#define HAVE_STRING_H 1
 571.469 -+#define HAVE_STRING_H 1
 571.470 -+#define HAVE_SYS_STAT_H 1
 571.471 -+#define HAVE_SYS_TYPES_H 1
 571.472 -+#define HAVE_UNISTD_H 1
 571.473 -+#define HAVE_UNISTD_H 1
 571.474 -+#define PACKAGE "xarchive"
 571.475 -+#define PACKAGE_BUGREPORT "Lee Bigelow <ligelowbee@yahoo.com>"
 571.476 -+#define PACKAGE_NAME "XArchive"
 571.477 -+#define PACKAGE_STRING "XArchive 0.2.8-6"
 571.478 -+#define PACKAGE_TARNAME "xarchive"
 571.479 -+#define PACKAGE_VERSION "0.2.8-6"
 571.480 -+#define STDC_HEADERS 1
 571.481 -+#define VERSION "0.2.8-6"
 571.482 -+#define _GNU_SOURCE 1
 571.483 -+
 571.484 -+configure: caught signal 2
 571.485 -+configure: exit 1
 571.486 ---- xarchive-0.2.8-6.old/wrappers/7za.src	Tue Nov 15 12:59:51 2005
 571.487 -+++ xarchive-0.2.8-6/wrappers/7za.src	Sat Mar 22 13:01:15 2008
 571.488 -@@ -51,9 +51,9 @@
 571.489 - # the shifting will leave the files passed as
 571.490 - # all the remaining args: "$@"
 571.491 - opt="$1"
 571.492 --shift 1
 571.493 -+test -z $1 || shift 1
 571.494 - archive="$1"
 571.495 --shift 1
 571.496 -+test -z $1 || shift 1
 571.497 - 
 571.498 - # Command line options for prog functions
 571.499 - NEW_OPTS="a -ms=off"
 571.500 ---- xarchive-0.2.8-6.old/wrappers/ace.src	Sat Jan 14 04:49:36 2006
 571.501 -+++ xarchive-0.2.8-6/wrappers/ace.src	Sat Mar 22 13:01:15 2008
 571.502 -@@ -48,9 +48,9 @@
 571.503 - # the shifting will leave the files passed as
 571.504 - # all the remaining args "$@"
 571.505 - opt="$1"
 571.506 --shift 1
 571.507 -+test -z $1 || shift 1
 571.508 - archive="$1"
 571.509 --shift 1
 571.510 -+test -z $1 || shift 1
 571.511 - 
 571.512 - # Command line options for prog functions
 571.513 - # disable comments when opening
 571.514 ---- xarchive-0.2.8-6.old/wrappers/arj.src	Tue Nov 15 12:59:56 2005
 571.515 -+++ xarchive-0.2.8-6/wrappers/arj.src	Sat Mar 22 13:01:15 2008
 571.516 -@@ -52,9 +52,9 @@
 571.517 - # the shifting will leave the files passed as
 571.518 - # all the remaining args: "$@"
 571.519 - opt="$1"
 571.520 --shift 1
 571.521 -+test -z $1 || shift 1
 571.522 - archive="$1"
 571.523 --shift 1
 571.524 -+test -z $1 || shift 1
 571.525 - 
 571.526 - # Command line options for prog functions
 571.527 - NEW_OPTS="a"
 571.528 ---- xarchive-0.2.8-6.old/wrappers/deb.src	Tue Nov  8 17:49:13 2005
 571.529 -+++ xarchive-0.2.8-6/wrappers/deb.src	Sat Mar 22 13:01:15 2008
 571.530 -@@ -40,9 +40,9 @@
 571.531 - # the shifting will leave the files passed as
 571.532 - # all the remaining args "$@"
 571.533 - opt="$1"
 571.534 --shift 1
 571.535 -+test -z $1 || shift 1
 571.536 - archive="$1"
 571.537 --shift 1
 571.538 -+test -z $1 || shift 1
 571.539 - 
 571.540 - 
 571.541 - # Command line options for prog functions
 571.542 ---- xarchive-0.2.8-6.old/wrappers/rar.src	Mon Nov 14 21:41:21 2005
 571.543 -+++ xarchive-0.2.8-6/wrappers/rar.src	Sat Mar 22 13:01:15 2008
 571.544 -@@ -53,9 +53,9 @@
 571.545 - # the shifting will leave the files passed as
 571.546 - # all the remaining args "$@"
 571.547 - opt="$1"
 571.548 --shift 1
 571.549 -+test -z $1 || shift 1
 571.550 - archive="$1"
 571.551 --shift 1
 571.552 -+test -z $1 || shift 1
 571.553 - 
 571.554 - # Command line options for prog functions
 571.555 - # disable comments when opening
 571.556 ---- xarchive-0.2.8-6.old/wrappers/rpm-bsd.src	Tue Nov  8 17:49:13 2005
 571.557 -+++ xarchive-0.2.8-6/wrappers/rpm-bsd.src	Sat Mar 22 13:01:16 2008
 571.558 -@@ -42,9 +42,9 @@
 571.559 - # the shifting will leave the files passed as
 571.560 - # all the remaining args "$@"
 571.561 - opt="$1"
 571.562 --shift 1
 571.563 -+test -z $1 || shift 1
 571.564 - archive="$1"
 571.565 --shift 1
 571.566 -+test -z $1 || shift 1
 571.567 - 
 571.568 - # the option switches
 571.569 - case "$opt" in
 571.570 ---- xarchive-0.2.8-6.old/wrappers/rpm-gnu.src	Tue Nov  8 17:49:13 2005
 571.571 -+++ xarchive-0.2.8-6/wrappers/rpm-gnu.src	Sat Mar 22 13:01:16 2008
 571.572 -@@ -41,9 +41,9 @@
 571.573 - # the shifting will leave the files passed as
 571.574 - # all the remaining args "$@"
 571.575 - opt="$1"
 571.576 --shift 1
 571.577 -+test -z $1 || shift 1
 571.578 - archive="$1"
 571.579 --shift 1
 571.580 -+test -z $1 || shift 1
 571.581 - 
 571.582 - # the option switches
 571.583 - case "$opt" in
 571.584 ---- xarchive-0.2.8-6.old/wrappers/tar-bsd.src	Tue Nov  8 20:51:54 2005
 571.585 -+++ xarchive-0.2.8-6/wrappers/tar-bsd.src	Sat Mar 22 13:01:16 2008
 571.586 -@@ -43,9 +43,9 @@
 571.587 - # the shifting will leave the files passed as
 571.588 - # all the remaining args "$@"
 571.589 - opt="$1"
 571.590 --shift 1
 571.591 -+test -z $1 || shift 1
 571.592 - archive="$1"
 571.593 --shift 1
 571.594 -+test -z $1 || shift 1
 571.595 - 
 571.596 - # set up compression variables for our compression functions. 
 571.597 - # translate archive name to lower case for pattern matching.
 571.598 ---- xarchive-0.2.8-6.old/wrappers/tar-gnu.src	Tue Nov  8 20:50:59 2005
 571.599 -+++ xarchive-0.2.8-6/wrappers/tar-gnu.src	Sat Mar 22 13:16:15 2008
 571.600 -@@ -42,9 +42,9 @@
 571.601 - # the shifting will leave the files passed as
 571.602 - # all the remaining args "$@"
 571.603 - opt="$1"
 571.604 --shift 1
 571.605 -+test -z $1 || shift 1
 571.606 - archive="$1"
 571.607 --shift 1
 571.608 -+test -z $1 || shift 1
 571.609 - 
 571.610 - # set up compression variables for our compression functions. 
 571.611 - # translate archive name to lower case for pattern matching.
 571.612 -@@ -54,14 +54,14 @@
 571.613 -     if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
 571.614 -         DECOMPRESS="gzip -dc"
 571.615 -         COMPRESS="gzip -c"
 571.616 --        TAR_COMPRESS_OPT="--use-compress-prog=gzip"
 571.617 -+        TAR_COMPRESS_OPT="z"
 571.618 -     fi
 571.619 - done
 571.620 - for ext in $BZIP2_EXTS; do
 571.621 -     if [ $(expr "$lc_archive" : ".*\."$ext"$") -gt 0 ]; then
 571.622 -         DECOMPRESS="bzip2 -dc" 
 571.623 -         COMPRESS="bzip2 -c"
 571.624 --        TAR_COMPRESS_OPT="--use-compress-prog=bzip2"
 571.625 -+        TAR_COMPRESS_OPT="j"
 571.626 -     fi
 571.627 - done
 571.628 - for ext in $COMPRESS_EXTS; do
 571.629 -@@ -76,8 +76,8 @@
 571.630 - # open and extract can use tar's cmd line option
 571.631 - # add, new, and remove need to decompress the tar first
 571.632 - # do their thing, than recompress the tar.
 571.633 --OPEN_OPTS="$TAR_COMPRESS_OPT -tvf"
 571.634 --EXTRACT_OPTS="$TAR_COMPRESS_OPT -xf"
 571.635 -+OPEN_OPTS="-tv${TAR_COMPRESS_OPT}f"
 571.636 -+EXTRACT_OPTS="-x${TAR_COMPRESS_OPT}f"
 571.637 - ADD_OPTS="-rf"
 571.638 - NEW_OPTS="-cf"
 571.639 - REMOVE_OPTS="--delete -f"
 571.640 -@@ -206,11 +206,12 @@
 571.641 -         ;;
 571.642 - 
 571.643 -     -r) # remove: from archive passed files 
 571.644 --        decompress_func
 571.645 --        $TAR_PROG $REMOVE_OPTS "$archive" "$@"
 571.646 --        wrapper_status=$?
 571.647 --        compress_func
 571.648 --        exit $wrapper_status
 571.649 -+        #decompress_func
 571.650 -+        #$TAR_PROG $REMOVE_OPTS "$archive" "$@"
 571.651 -+        #wrapper_status=$?
 571.652 -+        #compress_func
 571.653 -+        #exit $wrapper_status
 571.654 -+        exit $E_UNSUPPORTED
 571.655 -         ;;
 571.656 - 
 571.657 -     -e) # extract: from archive passed files 
 571.658 ---- xarchive-0.2.8-6.old/wrappers/zip.src	Tue Nov 15 13:02:08 2005
 571.659 -+++ xarchive-0.2.8-6/wrappers/zip.src	Sat Mar 22 13:01:16 2008
 571.660 -@@ -51,9 +51,9 @@
 571.661 - # the shifting will leave the files passed as
 571.662 - # all the remaining args: "$@"
 571.663 - opt="$1"
 571.664 --shift 1
 571.665 -+test -z $1 || shift 1
 571.666 - archive="$1"
 571.667 --shift 1
 571.668 -+test -z $1 || shift 1
 571.669 - 
 571.670 - # Command line options for prog functions
 571.671 - 
 571.672 ---- xarchive-0.2.8-6/xarchive.desktop.src	
 571.673 -+++ xarchive-0.2.8-6/xarchive.desktop.src	
 571.674 -@@ -12,7 +12,7 @@
 571.675 - Comment[en_GB]=Create, modify and browse an archive
 571.676 - GenericName=Archive Manager
 571.677 - 
 571.678 --Categories=Gtk;Application;System;Utility;
 571.679 -+Categories=Gtk;Utility;
 571.680 - Exec=xarchive %F
 571.681 - Icon=/path/to/icons/xarchive.xpm
 571.682 - StartupNotify=true
 571.683 -
 571.684 ---- xarchive-0.2.8-6/src/main.c
 571.685 -+++ xarchive-0.2.8-6/src/main.c
 571.686 -@@ -178,6 +178,10 @@
 571.687 -     {
 571.688 -       ext = (gchar *) g_ptr_array_index(wrapent->ext_array, e);
 571.689 -       g_string_append_printf(info_text,"%s ", ext);
 571.690 -+      if (e % 10 == 9)
 571.691 -+      {
 571.692 -+        g_string_append_printf(info_text,"\n                 ");
 571.693 -+      }
 571.694 -     }
 571.695 -     g_string_append_c(info_text, '\n');
 571.696 -   }
   572.1 --- a/xbattle/receipt	Wed May 09 17:03:28 2018 +0300
   572.2 +++ b/xbattle/receipt	Thu May 10 21:12:00 2018 +0300
   572.3 @@ -17,8 +17,6 @@
   572.4  # Rules to configure and make the package.
   572.5  compile_rules()
   572.6  {
   572.7 -	cd $src
   572.8 -	patch -p0 < $stuff/pseudo_color.u
   572.9  	xmkmf
  572.10  	make && make DESTDIR=$DESTDIR install
  572.11  }
   573.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   573.2 +++ b/xbattle/stuff/patches/pseudo_color.u	Thu May 10 21:12:00 2018 +0300
   573.3 @@ -0,0 +1,71 @@
   573.4 +--- window.c
   573.5 ++++ window.c
   573.6 +@@ -708,8 +708,7 @@
   573.7 +   unsigned long valuemask;
   573.8 +   XSetWindowAttributes attrib;
   573.9 +   XVisualInfo vinfo;
  573.10 +-  long event_mask,
  573.11 +-       full_depth;
  573.12 ++  long event_mask;
  573.13 +   Atom wm_delete_window;
  573.14 + 
  573.15 +   /** Open display and screen **/
  573.16 +@@ -742,36 +741,11 @@
  573.17 +   /** Set bitplane depth to default **/
  573.18 + 
  573.19 +   xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen);
  573.20 +-  full_depth = xwindow->depth;
  573.21 + 
  573.22 +   /** Get a visual **/
  573.23 + 
  573.24 +   visual = DefaultVisual (xwindow->display, xwindow->screen);
  573.25 + 
  573.26 +-  /** Try to force the display to 8 planes **/
  573.27 +-
  573.28 +-  if (xwindow->depth != 8)
  573.29 +-  {
  573.30 +-    if (XMatchVisualInfo
  573.31 +-		(xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo))
  573.32 +-    {
  573.33 +-      visual = vinfo.visual;
  573.34 +-      xwindow->depth = 8;
  573.35 +-    }
  573.36 +-  }
  573.37 +-
  573.38 +-  /** If couldn't find an 8 bit visual, try a 16 bit visual **/
  573.39 +-
  573.40 +-  if (xwindow->depth != 8)
  573.41 +-  {
  573.42 +-    if (XMatchVisualInfo
  573.43 +-		(xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo))
  573.44 +-    {
  573.45 +-      visual = vinfo.visual;
  573.46 +-      xwindow->depth = 16;
  573.47 +-    }
  573.48 +-  }
  573.49 +-
  573.50 +   /** If have less than 8 planes, just use a single plane **/
  573.51 + 
  573.52 +   if (xwindow->depth < 8)
  573.53 +@@ -790,20 +764,8 @@
  573.54 + #else
  573.55 +     /** Allocate existing colormap **/
  573.56 + 
  573.57 +-    if (full_depth > 8)
  573.58 ++    if (xwindow->depth > 8)
  573.59 +     {
  573.60 +-      /** XBattle won't work for 24 bit displays with no optional	**/
  573.61 +-      /** visuals with 8 or 16 bits.  This may be the case on some PCs.	**/
  573.62 +-      /** In these cases, it may be possible to reconfigure the display	**/
  573.63 +-      /** to 8 or 16 bits.						**/
  573.64 +-
  573.65 +-      if (xwindow->depth > 16)
  573.66 +-      {
  573.67 +-        throw_warning ("No PseudoColor visual available\n%s",
  573.68 +-		"         Try changing display to <= 16 bits");
  573.69 +-        throw_error ("Unable to continue without colormap", NULL);
  573.70 +-      }
  573.71 +-
  573.72 +       /** If display is 24 bit, have to create a dedicated colormap **/
  573.73 + 
  573.74 +       xwindow->cmap = XCreateColormap (xwindow->display,
   574.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   574.2 +++ b/xbattle/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   574.3 @@ -0,0 +1,1 @@
   574.4 +-p0|pseudo_color.u
   575.1 --- a/xbattle/stuff/pseudo_color.u	Wed May 09 17:03:28 2018 +0300
   575.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   575.3 @@ -1,71 +0,0 @@
   575.4 ---- window.c
   575.5 -+++ window.c
   575.6 -@@ -708,8 +708,7 @@
   575.7 -   unsigned long valuemask;
   575.8 -   XSetWindowAttributes attrib;
   575.9 -   XVisualInfo vinfo;
  575.10 --  long event_mask,
  575.11 --       full_depth;
  575.12 -+  long event_mask;
  575.13 -   Atom wm_delete_window;
  575.14 - 
  575.15 -   /** Open display and screen **/
  575.16 -@@ -742,36 +741,11 @@
  575.17 -   /** Set bitplane depth to default **/
  575.18 - 
  575.19 -   xwindow->depth = DefaultDepth (xwindow->display, xwindow->screen);
  575.20 --  full_depth = xwindow->depth;
  575.21 - 
  575.22 -   /** Get a visual **/
  575.23 - 
  575.24 -   visual = DefaultVisual (xwindow->display, xwindow->screen);
  575.25 - 
  575.26 --  /** Try to force the display to 8 planes **/
  575.27 --
  575.28 --  if (xwindow->depth != 8)
  575.29 --  {
  575.30 --    if (XMatchVisualInfo
  575.31 --		(xwindow->display, xwindow->screen, 8, PseudoColor, &vinfo))
  575.32 --    {
  575.33 --      visual = vinfo.visual;
  575.34 --      xwindow->depth = 8;
  575.35 --    }
  575.36 --  }
  575.37 --
  575.38 --  /** If couldn't find an 8 bit visual, try a 16 bit visual **/
  575.39 --
  575.40 --  if (xwindow->depth != 8)
  575.41 --  {
  575.42 --    if (XMatchVisualInfo
  575.43 --		(xwindow->display, xwindow->screen, 16, PseudoColor, &vinfo))
  575.44 --    {
  575.45 --      visual = vinfo.visual;
  575.46 --      xwindow->depth = 16;
  575.47 --    }
  575.48 --  }
  575.49 --
  575.50 -   /** If have less than 8 planes, just use a single plane **/
  575.51 - 
  575.52 -   if (xwindow->depth < 8)
  575.53 -@@ -790,20 +764,8 @@
  575.54 - #else
  575.55 -     /** Allocate existing colormap **/
  575.56 - 
  575.57 --    if (full_depth > 8)
  575.58 -+    if (xwindow->depth > 8)
  575.59 -     {
  575.60 --      /** XBattle won't work for 24 bit displays with no optional	**/
  575.61 --      /** visuals with 8 or 16 bits.  This may be the case on some PCs.	**/
  575.62 --      /** In these cases, it may be possible to reconfigure the display	**/
  575.63 --      /** to 8 or 16 bits.						**/
  575.64 --
  575.65 --      if (xwindow->depth > 16)
  575.66 --      {
  575.67 --        throw_warning ("No PseudoColor visual available\n%s",
  575.68 --		"         Try changing display to <= 16 bits");
  575.69 --        throw_error ("Unable to continue without colormap", NULL);
  575.70 --      }
  575.71 --
  575.72 -       /** If display is 24 bit, have to create a dedicated colormap **/
  575.73 - 
  575.74 -       xwindow->cmap = XCreateColormap (xwindow->display,
   576.1 --- a/xfmedia/receipt	Wed May 09 17:03:28 2018 +0300
   576.2 +++ b/xfmedia/receipt	Thu May 10 21:12:00 2018 +0300
   576.3 @@ -18,9 +18,6 @@
   576.4  compile_rules() {
   576.5  	export LDFLAGS="$LDFLAGS -lXext -lm -lgmodule-2.0"
   576.6  	sed -i 's/return xine_trick_mode.*/return 0;/' src/xfmedia-xine.c
   576.7 -	patch -Np1 -i $stuff/xfmedia-dbus-0.6-support.patch
   576.8 -	patch -Np1 -i $stuff/xfmedia-empty-prev-next-fix.patch
   576.9 -	patch -Np1 -i $stuff/xfmedia-exo-0.6.patch
  576.10  
  576.11  	./configure \
  576.12  		--enable-exo \
   577.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   577.2 +++ b/xfmedia/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   577.3 @@ -0,0 +1,3 @@
   577.4 +xfmedia-dbus-0.6-support.patch
   577.5 +xfmedia-empty-prev-next-fix.patch
   577.6 +xfmedia-exo-0.6.patch
   578.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   578.2 +++ b/xfmedia/stuff/patches/xfmedia-dbus-0.6-support.patch	Thu May 10 21:12:00 2018 +0300
   578.3 @@ -0,0 +1,14 @@
   578.4 +diff -Naur xfmedia-0.9.1.orig/src/remote.c xfmedia-0.9.1/src/remote.c
   578.5 +--- xfmedia-0.9.1.orig/src/remote.c	2005-09-05 00:56:37.000000000 -0400
   578.6 ++++ xfmedia-0.9.1/src/remote.c	2006-04-08 00:27:18.000000000 -0400
   578.7 +@@ -55,6 +55,10 @@
   578.8 + #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER DBUS_SERVICE_REPLY_PRIMARY_OWNER
   578.9 + #endif
  578.10 + 
  578.11 ++#ifndef DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT
  578.12 ++#define DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT DBUS_NAME_FLAG_DO_NOT_QUEUE
  578.13 ++#endif
  578.14 ++
  578.15 + #endif  /* HAVE_DBUS */
  578.16 + 
  578.17 + #include <libxfce4util/libxfce4util.h>
   579.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   579.2 +++ b/xfmedia/stuff/patches/xfmedia-empty-prev-next-fix.patch	Thu May 10 21:12:00 2018 +0300
   579.3 @@ -0,0 +1,25 @@
   579.4 +diff -wbBur xfmedia-0.9.2/src/mainwin.c xfmedia-0.9.2.my/src/mainwin.c
   579.5 +--- xfmedia-0.9.2/src/mainwin.c	2006-11-27 07:21:23.000000000 +0000
   579.6 ++++ xfmedia-0.9.2.my/src/mainwin.c	2010-11-01 13:01:17.000000000 +0000
   579.7 +@@ -1865,6 +1865,10 @@
   579.8 +     gboolean use_playlist_q  = xfmedia_playlist_queue_n_entries(mwin->playlist_q);
   579.9 +     gboolean ret = FALSE;
  579.10 +     
  579.11 ++    if(xfmedia_playlist_get_n_entries(mwin->plist) == 0)
  579.12 ++//    if(xfmedia_playlist_queue_is_empty(mwin->plist))
  579.13 ++	return;
  579.14 ++
  579.15 +     if(mwin->cur_playing
  579.16 +        && xfmedia_settings_get_bool("/xfmedia/playlist/shuffle")
  579.17 +        && !use_playlist_q )
  579.18 +@@ -1899,6 +1903,10 @@
  579.19 + {
  579.20 +     gint tot_items, idx = -1;
  579.21 +     
  579.22 ++    if(xfmedia_playlist_get_n_entries(mwin->plist) == 0)
  579.23 ++//    if(xfmedia_playlist_queue_is_empty(mwin->plist))
  579.24 ++	return;
  579.25 ++
  579.26 +     if(xfmedia_settings_get_bool("/xfmedia/playlist/shuffle")) {
  579.27 +         XfmediaPlaylistEntryRef *ref = NULL;
  579.28 +         gboolean playing = FALSE;
   580.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   580.2 +++ b/xfmedia/stuff/patches/xfmedia-exo-0.6.patch	Thu May 10 21:12:00 2018 +0300
   580.3 @@ -0,0 +1,196 @@
   580.4 +diff -wbBur xfmedia-0.9.2/configure xfmedia-0.9.2.my/configure
   580.5 +--- xfmedia-0.9.2/configure	2006-11-27 20:20:59.000000000 +0000
   580.6 ++++ xfmedia-0.9.2.my/configure	2011-01-31 17:15:58.000000000 +0000
   580.7 +@@ -27417,7 +27417,7 @@
   580.8 + 
   580.9 + 
  580.10 +   if test x"$xdt_cv_EXO_check" = x"yes"; then
  580.11 +-    if $PKG_CONFIG --exists "exo-0.3 >= 0.3.0" >/dev/null 2>&1; then
  580.12 ++    if $PKG_CONFIG --exists "exo-1 >= 0.3.0" >/dev/null 2>&1; then
  580.13 + 
  580.14 + 
  580.15 +   # minimum supported version of pkg-config
  580.16 +@@ -27501,22 +27501,22 @@
  580.17 +   fi
  580.18 + 
  580.19 + 
  580.20 +-  { echo "$as_me:$LINENO: checking for exo-0.3 >= 0.3.0" >&5
  580.21 +-echo $ECHO_N "checking for exo-0.3 >= 0.3.0... $ECHO_C" >&6; }
  580.22 +-  if $PKG_CONFIG "--atleast-version=0.3.0" "exo-0.3" >/dev/null 2>&1; then
  580.23 +-    EXO_VERSION=`$PKG_CONFIG --modversion "exo-0.3"`
  580.24 ++  { echo "$as_me:$LINENO: checking for exo-1 >= 0.3.0" >&5
  580.25 ++echo $ECHO_N "checking for exo-1 >= 0.3.0... $ECHO_C" >&6; }
  580.26 ++  if $PKG_CONFIG "--atleast-version=0.3.0" "exo-1" >/dev/null 2>&1; then
  580.27 ++    EXO_VERSION=`$PKG_CONFIG --modversion "exo-1"`
  580.28 +     { echo "$as_me:$LINENO: result: $EXO_VERSION" >&5
  580.29 + echo "${ECHO_T}$EXO_VERSION" >&6; }
  580.30 + 
  580.31 +     { echo "$as_me:$LINENO: checking EXO_CFLAGS" >&5
  580.32 + echo $ECHO_N "checking EXO_CFLAGS... $ECHO_C" >&6; }
  580.33 +-    EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-0.3"`
  580.34 ++    EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-1"`
  580.35 +     { echo "$as_me:$LINENO: result: $EXO_CFLAGS" >&5
  580.36 + echo "${ECHO_T}$EXO_CFLAGS" >&6; }
  580.37 + 
  580.38 +     { echo "$as_me:$LINENO: checking EXO_LIBS" >&5
  580.39 + echo $ECHO_N "checking EXO_LIBS... $ECHO_C" >&6; }
  580.40 +-    EXO_LIBS=`$PKG_CONFIG --libs "exo-0.3"`
  580.41 ++    EXO_LIBS=`$PKG_CONFIG --libs "exo-1"`
  580.42 +     { echo "$as_me:$LINENO: result: $EXO_LIBS" >&5
  580.43 + echo "${ECHO_T}$EXO_LIBS" >&6; }
  580.44 + 
  580.45 +@@ -27535,15 +27535,15 @@
  580.46 + 
  580.47 +         EXO_FOUND="yes"
  580.48 + 
  580.49 +-  elif $PKG_CONFIG --exists "exo-0.3" >/dev/null 2>&1; then
  580.50 +-    xdt_cv_version=`$PKG_CONFIG --modversion "exo-0.3"`
  580.51 ++  elif $PKG_CONFIG --exists "exo-1" >/dev/null 2>&1; then
  580.52 ++    xdt_cv_version=`$PKG_CONFIG --modversion "exo-1"`
  580.53 +     { echo "$as_me:$LINENO: result: found, but $xdt_cv_version" >&5
  580.54 + echo "${ECHO_T}found, but $xdt_cv_version" >&6; }
  580.55 + 
  580.56 + 
  580.57 +-      echo "*** The required package exo-0.3 was found on your system,"
  580.58 ++      echo "*** The required package exo-1 was found on your system,"
  580.59 +       echo "*** but the installed version ($xdt_cv_version) is too old."
  580.60 +-      echo "*** Please upgrade exo-0.3 to atleast version 0.3.0, or adjust"
  580.61 ++      echo "*** Please upgrade exo-1 to atleast version 0.3.0, or adjust"
  580.62 +       echo "*** the PKG_CONFIG_PATH environment variable if you installed"
  580.63 +       echo "*** the new version of the package in a nonstandard prefix so"
  580.64 +       echo "*** pkg-config is able to find it."
  580.65 +@@ -27554,8 +27554,8 @@
  580.66 + echo "${ECHO_T}not found" >&6; }
  580.67 + 
  580.68 + 
  580.69 +-      echo "*** The required package exo-0.3 was not found on your system."
  580.70 +-      echo "*** Please install exo-0.3 (atleast version 0.3.0) or adjust"
  580.71 ++      echo "*** The required package exo-1 was not found on your system."
  580.72 ++      echo "*** Please install exo-1 (atleast version 0.3.0) or adjust"
  580.73 +       echo "*** the PKG_CONFIG_PATH environment variable if you"
  580.74 +       echo "*** installed the package in a nonstandard prefix so that"
  580.75 +       echo "*** pkg-config is able to find it."
  580.76 +@@ -27564,14 +27564,14 @@
  580.77 +   fi
  580.78 + 
  580.79 +     else
  580.80 +-      { echo "$as_me:$LINENO: checking for optional package exo-0.3 >= 0.3.0" >&5
  580.81 +-echo $ECHO_N "checking for optional package exo-0.3 >= 0.3.0... $ECHO_C" >&6; }
  580.82 ++      { echo "$as_me:$LINENO: checking for optional package exo-1 >= 0.3.0" >&5
  580.83 ++echo $ECHO_N "checking for optional package exo-1 >= 0.3.0... $ECHO_C" >&6; }
  580.84 +       { echo "$as_me:$LINENO: result: not found" >&5
  580.85 + echo "${ECHO_T}not found" >&6; }
  580.86 +     fi
  580.87 +   else
  580.88 +-    { echo "$as_me:$LINENO: checking for optional package exo-0.3" >&5
  580.89 +-echo $ECHO_N "checking for optional package exo-0.3... $ECHO_C" >&6; }
  580.90 ++    { echo "$as_me:$LINENO: checking for optional package exo-1" >&5
  580.91 ++echo $ECHO_N "checking for optional package exo-1... $ECHO_C" >&6; }
  580.92 +     { echo "$as_me:$LINENO: result: disabled" >&5
  580.93 + echo "${ECHO_T}disabled" >&6; }
  580.94 +   fi
  580.95 +diff -wbBur xfmedia-0.9.2/src/main.c xfmedia-0.9.2.my/src/main.c
  580.96 +--- xfmedia-0.9.2/src/main.c	2006-11-27 07:21:23.000000000 +0000
  580.97 ++++ xfmedia-0.9.2.my/src/main.c	2011-02-01 11:08:02.000000000 +0000
  580.98 +@@ -388,6 +388,23 @@
  580.99 +     return optind;
 580.100 + }
 580.101 + 
 580.102 ++/**
 580.103 ++ * exo_str_get_md5_str:
 580.104 ++ * @contents : The string to create a digest of.
 580.105 ++ *
 580.106 ++ * Creates a character array MD5 digestof the string
 580.107 ++ * @contents.
 580.108 ++ *
 580.109 ++ * Return value: A newly-allocated character array which
 580.110 ++ *               should be free with g_free() when no
 580.111 ++ *               longer needed.
 580.112 ++ **/
 580.113 ++gchar*
 580.114 ++exo_str_get_md5_str (const gchar *contents)
 580.115 ++{
 580.116 ++  return g_compute_checksum_for_string (G_CHECKSUM_MD5, contents, -1);
 580.117 ++}
 580.118 ++
 580.119 + int
 580.120 + main(int argc, char **argv)
 580.121 + {
 580.122 +diff -wbBur xfmedia-0.9.2/src/mediamarks.c xfmedia-0.9.2.my/src/mediamarks.c
 580.123 +--- xfmedia-0.9.2/src/mediamarks.c	2006-11-27 07:21:23.000000000 +0000
 580.124 ++++ xfmedia-0.9.2.my/src/mediamarks.c	2011-02-01 11:04:42.000000000 +0000
 580.125 +@@ -684,9 +684,9 @@
 580.126 +     
 580.127 +     render = exo_cell_renderer_ellipsized_text_new();
 580.128 +     if(gtk_major_version == 2 && gtk_minor_version >= 6)
 580.129 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 580.130 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 580.131 + 	else {
 580.132 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 580.133 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 580.134 + 				"ellipsize-set", TRUE, NULL);
 580.135 + 	}
 580.136 +     gtk_tree_view_column_pack_start(col, render, TRUE);
 580.137 +@@ -1693,9 +1693,9 @@
 580.138 +     
 580.139 +     render = exo_cell_renderer_ellipsized_text_new();
 580.140 +     if(gtk_major_version == 2 && gtk_minor_version >= 6)
 580.141 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 580.142 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 580.143 + 	else {
 580.144 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 580.145 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 580.146 + 				"ellipsize-set", TRUE, NULL);
 580.147 + 	}
 580.148 +     gtk_tree_view_column_pack_start(col, render, TRUE);
 580.149 +@@ -1705,9 +1705,9 @@
 580.150 +     
 580.151 +     render = exo_cell_renderer_ellipsized_text_new();
 580.152 +     if(gtk_major_version == 2 && gtk_minor_version >= 6)
 580.153 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 580.154 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 580.155 + 	else {
 580.156 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 580.157 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 580.158 + 				"ellipsize-set", TRUE, NULL);
 580.159 + 	}
 580.160 +     col = gtk_tree_view_column_new_with_attributes(_("Location"), render,
 580.161 +diff -wbBur xfmedia-0.9.2/src/playlist.c xfmedia-0.9.2.my/src/playlist.c
 580.162 +--- xfmedia-0.9.2/src/playlist.c	2006-11-27 07:21:22.000000000 +0000
 580.163 ++++ xfmedia-0.9.2.my/src/playlist.c	2011-02-01 11:04:47.000000000 +0000
 580.164 +@@ -1409,9 +1409,9 @@
 580.165 +     
 580.166 +     render = exo_cell_renderer_ellipsized_text_new();
 580.167 + 	if(gtk_major_version == 2 && gtk_minor_version >= 6)
 580.168 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 580.169 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 580.170 + 	else {
 580.171 +-		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 580.172 ++		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 580.173 + 				"ellipsize-set", TRUE, NULL);
 580.174 + 	}
 580.175 +     col = gtk_tree_view_column_new_with_attributes(_("Title"), render, "text",
 580.176 +diff -wbBur xfmedia-0.9.2/src/settings-dialog.c xfmedia-0.9.2.my/src/settings-dialog.c
 580.177 +--- xfmedia-0.9.2/src/settings-dialog.c	2006-11-27 07:21:23.000000000 +0000
 580.178 ++++ xfmedia-0.9.2.my/src/settings-dialog.c	2011-02-01 11:04:53.000000000 +0000
 580.179 +@@ -552,7 +552,7 @@
 580.180 +     render = exo_cell_renderer_ellipsized_text_new();
 580.181 +     col = gtk_tree_view_column_new_with_attributes("name", render,
 580.182 +             "text", PLUGINS_NAME, NULL);
 580.183 +-    g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 580.184 ++    g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 580.185 +             "ellipsize-set", TRUE, NULL);
 580.186 +     gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col);
 580.187 +     
 580.188 +diff -wbBur xfmedia-0.9.2/src/xfmedia-playlist-queue.c xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c
 580.189 +--- xfmedia-0.9.2/src/xfmedia-playlist-queue.c	2006-11-27 07:21:22.000000000 +0000
 580.190 ++++ xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c	2011-02-01 11:04:57.000000000 +0000
 580.191 +@@ -171,7 +171,7 @@
 580.192 +     
 580.193 +     render = exo_cell_renderer_ellipsized_text_new();
 580.194 +     g_object_set(G_OBJECT(render),
 580.195 +-                 "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 580.196 ++                 "ellipsize", PANGO_ELLIPSIZE_END,
 580.197 +                  "ellipsize-set", TRUE,
 580.198 +                  NULL);
 580.199 +     col = gtk_tree_view_column_new_with_attributes("display-name", render,
   581.1 --- a/xfmedia/stuff/xfmedia-dbus-0.6-support.patch	Wed May 09 17:03:28 2018 +0300
   581.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   581.3 @@ -1,14 +0,0 @@
   581.4 -diff -Naur xfmedia-0.9.1.orig/src/remote.c xfmedia-0.9.1/src/remote.c
   581.5 ---- xfmedia-0.9.1.orig/src/remote.c	2005-09-05 00:56:37.000000000 -0400
   581.6 -+++ xfmedia-0.9.1/src/remote.c	2006-04-08 00:27:18.000000000 -0400
   581.7 -@@ -55,6 +55,10 @@
   581.8 - #define DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER DBUS_SERVICE_REPLY_PRIMARY_OWNER
   581.9 - #endif
  581.10 - 
  581.11 -+#ifndef DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT
  581.12 -+#define DBUS_NAME_FLAG_PROHIBIT_REPLACEMENT DBUS_NAME_FLAG_DO_NOT_QUEUE
  581.13 -+#endif
  581.14 -+
  581.15 - #endif  /* HAVE_DBUS */
  581.16 - 
  581.17 - #include <libxfce4util/libxfce4util.h>
   582.1 --- a/xfmedia/stuff/xfmedia-empty-prev-next-fix.patch	Wed May 09 17:03:28 2018 +0300
   582.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   582.3 @@ -1,25 +0,0 @@
   582.4 -diff -wbBur xfmedia-0.9.2/src/mainwin.c xfmedia-0.9.2.my/src/mainwin.c
   582.5 ---- xfmedia-0.9.2/src/mainwin.c	2006-11-27 07:21:23.000000000 +0000
   582.6 -+++ xfmedia-0.9.2.my/src/mainwin.c	2010-11-01 13:01:17.000000000 +0000
   582.7 -@@ -1865,6 +1865,10 @@
   582.8 -     gboolean use_playlist_q  = xfmedia_playlist_queue_n_entries(mwin->playlist_q);
   582.9 -     gboolean ret = FALSE;
  582.10 -     
  582.11 -+    if(xfmedia_playlist_get_n_entries(mwin->plist) == 0)
  582.12 -+//    if(xfmedia_playlist_queue_is_empty(mwin->plist))
  582.13 -+	return;
  582.14 -+
  582.15 -     if(mwin->cur_playing
  582.16 -        && xfmedia_settings_get_bool("/xfmedia/playlist/shuffle")
  582.17 -        && !use_playlist_q )
  582.18 -@@ -1899,6 +1903,10 @@
  582.19 - {
  582.20 -     gint tot_items, idx = -1;
  582.21 -     
  582.22 -+    if(xfmedia_playlist_get_n_entries(mwin->plist) == 0)
  582.23 -+//    if(xfmedia_playlist_queue_is_empty(mwin->plist))
  582.24 -+	return;
  582.25 -+
  582.26 -     if(xfmedia_settings_get_bool("/xfmedia/playlist/shuffle")) {
  582.27 -         XfmediaPlaylistEntryRef *ref = NULL;
  582.28 -         gboolean playing = FALSE;
   583.1 --- a/xfmedia/stuff/xfmedia-exo-0.6.patch	Wed May 09 17:03:28 2018 +0300
   583.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   583.3 @@ -1,196 +0,0 @@
   583.4 -diff -wbBur xfmedia-0.9.2/configure xfmedia-0.9.2.my/configure
   583.5 ---- xfmedia-0.9.2/configure	2006-11-27 20:20:59.000000000 +0000
   583.6 -+++ xfmedia-0.9.2.my/configure	2011-01-31 17:15:58.000000000 +0000
   583.7 -@@ -27417,7 +27417,7 @@
   583.8 - 
   583.9 - 
  583.10 -   if test x"$xdt_cv_EXO_check" = x"yes"; then
  583.11 --    if $PKG_CONFIG --exists "exo-0.3 >= 0.3.0" >/dev/null 2>&1; then
  583.12 -+    if $PKG_CONFIG --exists "exo-1 >= 0.3.0" >/dev/null 2>&1; then
  583.13 - 
  583.14 - 
  583.15 -   # minimum supported version of pkg-config
  583.16 -@@ -27501,22 +27501,22 @@
  583.17 -   fi
  583.18 - 
  583.19 - 
  583.20 --  { echo "$as_me:$LINENO: checking for exo-0.3 >= 0.3.0" >&5
  583.21 --echo $ECHO_N "checking for exo-0.3 >= 0.3.0... $ECHO_C" >&6; }
  583.22 --  if $PKG_CONFIG "--atleast-version=0.3.0" "exo-0.3" >/dev/null 2>&1; then
  583.23 --    EXO_VERSION=`$PKG_CONFIG --modversion "exo-0.3"`
  583.24 -+  { echo "$as_me:$LINENO: checking for exo-1 >= 0.3.0" >&5
  583.25 -+echo $ECHO_N "checking for exo-1 >= 0.3.0... $ECHO_C" >&6; }
  583.26 -+  if $PKG_CONFIG "--atleast-version=0.3.0" "exo-1" >/dev/null 2>&1; then
  583.27 -+    EXO_VERSION=`$PKG_CONFIG --modversion "exo-1"`
  583.28 -     { echo "$as_me:$LINENO: result: $EXO_VERSION" >&5
  583.29 - echo "${ECHO_T}$EXO_VERSION" >&6; }
  583.30 - 
  583.31 -     { echo "$as_me:$LINENO: checking EXO_CFLAGS" >&5
  583.32 - echo $ECHO_N "checking EXO_CFLAGS... $ECHO_C" >&6; }
  583.33 --    EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-0.3"`
  583.34 -+    EXO_CFLAGS=`$PKG_CONFIG --cflags "exo-1"`
  583.35 -     { echo "$as_me:$LINENO: result: $EXO_CFLAGS" >&5
  583.36 - echo "${ECHO_T}$EXO_CFLAGS" >&6; }
  583.37 - 
  583.38 -     { echo "$as_me:$LINENO: checking EXO_LIBS" >&5
  583.39 - echo $ECHO_N "checking EXO_LIBS... $ECHO_C" >&6; }
  583.40 --    EXO_LIBS=`$PKG_CONFIG --libs "exo-0.3"`
  583.41 -+    EXO_LIBS=`$PKG_CONFIG --libs "exo-1"`
  583.42 -     { echo "$as_me:$LINENO: result: $EXO_LIBS" >&5
  583.43 - echo "${ECHO_T}$EXO_LIBS" >&6; }
  583.44 - 
  583.45 -@@ -27535,15 +27535,15 @@
  583.46 - 
  583.47 -         EXO_FOUND="yes"
  583.48 - 
  583.49 --  elif $PKG_CONFIG --exists "exo-0.3" >/dev/null 2>&1; then
  583.50 --    xdt_cv_version=`$PKG_CONFIG --modversion "exo-0.3"`
  583.51 -+  elif $PKG_CONFIG --exists "exo-1" >/dev/null 2>&1; then
  583.52 -+    xdt_cv_version=`$PKG_CONFIG --modversion "exo-1"`
  583.53 -     { echo "$as_me:$LINENO: result: found, but $xdt_cv_version" >&5
  583.54 - echo "${ECHO_T}found, but $xdt_cv_version" >&6; }
  583.55 - 
  583.56 - 
  583.57 --      echo "*** The required package exo-0.3 was found on your system,"
  583.58 -+      echo "*** The required package exo-1 was found on your system,"
  583.59 -       echo "*** but the installed version ($xdt_cv_version) is too old."
  583.60 --      echo "*** Please upgrade exo-0.3 to atleast version 0.3.0, or adjust"
  583.61 -+      echo "*** Please upgrade exo-1 to atleast version 0.3.0, or adjust"
  583.62 -       echo "*** the PKG_CONFIG_PATH environment variable if you installed"
  583.63 -       echo "*** the new version of the package in a nonstandard prefix so"
  583.64 -       echo "*** pkg-config is able to find it."
  583.65 -@@ -27554,8 +27554,8 @@
  583.66 - echo "${ECHO_T}not found" >&6; }
  583.67 - 
  583.68 - 
  583.69 --      echo "*** The required package exo-0.3 was not found on your system."
  583.70 --      echo "*** Please install exo-0.3 (atleast version 0.3.0) or adjust"
  583.71 -+      echo "*** The required package exo-1 was not found on your system."
  583.72 -+      echo "*** Please install exo-1 (atleast version 0.3.0) or adjust"
  583.73 -       echo "*** the PKG_CONFIG_PATH environment variable if you"
  583.74 -       echo "*** installed the package in a nonstandard prefix so that"
  583.75 -       echo "*** pkg-config is able to find it."
  583.76 -@@ -27564,14 +27564,14 @@
  583.77 -   fi
  583.78 - 
  583.79 -     else
  583.80 --      { echo "$as_me:$LINENO: checking for optional package exo-0.3 >= 0.3.0" >&5
  583.81 --echo $ECHO_N "checking for optional package exo-0.3 >= 0.3.0... $ECHO_C" >&6; }
  583.82 -+      { echo "$as_me:$LINENO: checking for optional package exo-1 >= 0.3.0" >&5
  583.83 -+echo $ECHO_N "checking for optional package exo-1 >= 0.3.0... $ECHO_C" >&6; }
  583.84 -       { echo "$as_me:$LINENO: result: not found" >&5
  583.85 - echo "${ECHO_T}not found" >&6; }
  583.86 -     fi
  583.87 -   else
  583.88 --    { echo "$as_me:$LINENO: checking for optional package exo-0.3" >&5
  583.89 --echo $ECHO_N "checking for optional package exo-0.3... $ECHO_C" >&6; }
  583.90 -+    { echo "$as_me:$LINENO: checking for optional package exo-1" >&5
  583.91 -+echo $ECHO_N "checking for optional package exo-1... $ECHO_C" >&6; }
  583.92 -     { echo "$as_me:$LINENO: result: disabled" >&5
  583.93 - echo "${ECHO_T}disabled" >&6; }
  583.94 -   fi
  583.95 -diff -wbBur xfmedia-0.9.2/src/main.c xfmedia-0.9.2.my/src/main.c
  583.96 ---- xfmedia-0.9.2/src/main.c	2006-11-27 07:21:23.000000000 +0000
  583.97 -+++ xfmedia-0.9.2.my/src/main.c	2011-02-01 11:08:02.000000000 +0000
  583.98 -@@ -388,6 +388,23 @@
  583.99 -     return optind;
 583.100 - }
 583.101 - 
 583.102 -+/**
 583.103 -+ * exo_str_get_md5_str:
 583.104 -+ * @contents : The string to create a digest of.
 583.105 -+ *
 583.106 -+ * Creates a character array MD5 digestof the string
 583.107 -+ * @contents.
 583.108 -+ *
 583.109 -+ * Return value: A newly-allocated character array which
 583.110 -+ *               should be free with g_free() when no
 583.111 -+ *               longer needed.
 583.112 -+ **/
 583.113 -+gchar*
 583.114 -+exo_str_get_md5_str (const gchar *contents)
 583.115 -+{
 583.116 -+  return g_compute_checksum_for_string (G_CHECKSUM_MD5, contents, -1);
 583.117 -+}
 583.118 -+
 583.119 - int
 583.120 - main(int argc, char **argv)
 583.121 - {
 583.122 -diff -wbBur xfmedia-0.9.2/src/mediamarks.c xfmedia-0.9.2.my/src/mediamarks.c
 583.123 ---- xfmedia-0.9.2/src/mediamarks.c	2006-11-27 07:21:23.000000000 +0000
 583.124 -+++ xfmedia-0.9.2.my/src/mediamarks.c	2011-02-01 11:04:42.000000000 +0000
 583.125 -@@ -684,9 +684,9 @@
 583.126 -     
 583.127 -     render = exo_cell_renderer_ellipsized_text_new();
 583.128 -     if(gtk_major_version == 2 && gtk_minor_version >= 6)
 583.129 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 583.130 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 583.131 - 	else {
 583.132 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 583.133 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 583.134 - 				"ellipsize-set", TRUE, NULL);
 583.135 - 	}
 583.136 -     gtk_tree_view_column_pack_start(col, render, TRUE);
 583.137 -@@ -1693,9 +1693,9 @@
 583.138 -     
 583.139 -     render = exo_cell_renderer_ellipsized_text_new();
 583.140 -     if(gtk_major_version == 2 && gtk_minor_version >= 6)
 583.141 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 583.142 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 583.143 - 	else {
 583.144 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 583.145 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 583.146 - 				"ellipsize-set", TRUE, NULL);
 583.147 - 	}
 583.148 -     gtk_tree_view_column_pack_start(col, render, TRUE);
 583.149 -@@ -1705,9 +1705,9 @@
 583.150 -     
 583.151 -     render = exo_cell_renderer_ellipsized_text_new();
 583.152 -     if(gtk_major_version == 2 && gtk_minor_version >= 6)
 583.153 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 583.154 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 583.155 - 	else {
 583.156 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 583.157 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 583.158 - 				"ellipsize-set", TRUE, NULL);
 583.159 - 	}
 583.160 -     col = gtk_tree_view_column_new_with_attributes(_("Location"), render,
 583.161 -diff -wbBur xfmedia-0.9.2/src/playlist.c xfmedia-0.9.2.my/src/playlist.c
 583.162 ---- xfmedia-0.9.2/src/playlist.c	2006-11-27 07:21:22.000000000 +0000
 583.163 -+++ xfmedia-0.9.2.my/src/playlist.c	2011-02-01 11:04:47.000000000 +0000
 583.164 -@@ -1409,9 +1409,9 @@
 583.165 -     
 583.166 -     render = exo_cell_renderer_ellipsized_text_new();
 583.167 - 	if(gtk_major_version == 2 && gtk_minor_version >= 6)
 583.168 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END, NULL);
 583.169 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
 583.170 - 	else {
 583.171 --		g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 583.172 -+		g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 583.173 - 				"ellipsize-set", TRUE, NULL);
 583.174 - 	}
 583.175 -     col = gtk_tree_view_column_new_with_attributes(_("Title"), render, "text",
 583.176 -diff -wbBur xfmedia-0.9.2/src/settings-dialog.c xfmedia-0.9.2.my/src/settings-dialog.c
 583.177 ---- xfmedia-0.9.2/src/settings-dialog.c	2006-11-27 07:21:23.000000000 +0000
 583.178 -+++ xfmedia-0.9.2.my/src/settings-dialog.c	2011-02-01 11:04:53.000000000 +0000
 583.179 -@@ -552,7 +552,7 @@
 583.180 -     render = exo_cell_renderer_ellipsized_text_new();
 583.181 -     col = gtk_tree_view_column_new_with_attributes("name", render,
 583.182 -             "text", PLUGINS_NAME, NULL);
 583.183 --    g_object_set(G_OBJECT(render), "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 583.184 -+    g_object_set(G_OBJECT(render), "ellipsize", PANGO_ELLIPSIZE_END,
 583.185 -             "ellipsize-set", TRUE, NULL);
 583.186 -     gtk_tree_view_append_column(GTK_TREE_VIEW(treeview), col);
 583.187 -     
 583.188 -diff -wbBur xfmedia-0.9.2/src/xfmedia-playlist-queue.c xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c
 583.189 ---- xfmedia-0.9.2/src/xfmedia-playlist-queue.c	2006-11-27 07:21:22.000000000 +0000
 583.190 -+++ xfmedia-0.9.2.my/src/xfmedia-playlist-queue.c	2011-02-01 11:04:57.000000000 +0000
 583.191 -@@ -171,7 +171,7 @@
 583.192 -     
 583.193 -     render = exo_cell_renderer_ellipsized_text_new();
 583.194 -     g_object_set(G_OBJECT(render),
 583.195 --                 "ellipsize", EXO_PANGO_ELLIPSIZE_END,
 583.196 -+                 "ellipsize", PANGO_ELLIPSIZE_END,
 583.197 -                  "ellipsize-set", TRUE,
 583.198 -                  NULL);
 583.199 -     col = gtk_tree_view_column_new_with_attributes("display-name", render,
   584.1 --- a/xfprint/receipt	Wed May 09 17:03:28 2018 +0300
   584.2 +++ b/xfprint/receipt	Thu May 10 21:12:00 2018 +0300
   584.3 @@ -18,7 +18,6 @@
   584.4  
   584.5  compile_rules() {
   584.6  	export LDFLAGS="$LDFLAGS -lX11"
   584.7 -	patch -p1 < $stuff/xfprint-4.6.1-cups-1.6.patch
   584.8  
   584.9  	./configure \
  584.10  		--prefix=/usr \
   585.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   585.2 +++ b/xfprint/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   585.3 @@ -0,0 +1,1 @@
   585.4 +-p1|xfprint-4.6.1-cups-1.6.patch
   586.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   586.2 +++ b/xfprint/stuff/patches/xfprint-4.6.1-cups-1.6.patch	Thu May 10 21:12:00 2018 +0300
   586.3 @@ -0,0 +1,136 @@
   586.4 +>From 2b5b2efdf2ce8233933c1304dc00c271303a4d92 Mon Sep 17 00:00:00 2001
   586.5 +From: Matt Philips <matt.philips@timesys.com>
   586.6 +Date: Fri, 19 Apr 2013 14:31:37 -0400
   586.7 +Subject: [PATCH] Use CUPS-1.6 IPP API getter/setter functions
   586.8 +
   586.9 +CUPS 1.6 makes various structures private and introduces these ippGet
  586.10 +and ippSet functions for all of the fields in these structures.
  586.11 +http://www.cups.org/str.php?L3928
  586.12 +
  586.13 +We define our own accessors when building against CUPS < 1.6.
  586.14 +
  586.15 +Based on work by Jiri Popelka <jpopelka@redhat.com> at
  586.16 +https://bugzilla.gnome.org/show_bug.cgi?id=679759
  586.17 +---
  586.18 + printing-systems/cups/cups.c |   64 +++++++++++++++++-----------
  586.19 + 1 file changed, 38 insertions(+), 26 deletions(-)
  586.20 +
  586.21 +diff --git a/printing-systems/cups/cups.c b/xfprint-4.6.1/printing-systems/cups/cups.c
  586.22 +index 96b30d1..9d5df01 100644
  586.23 +--- a/printing-systems/cups/cups.c
  586.24 ++++ b/printing-systems/cups/cups.c
  586.25 +@@ -44,6 +44,37 @@ G_MODULE_EXPORT const gchar version[] = VERSION;
  586.26 + G_MODULE_EXPORT const gchar author[] = "Jean-François Wauthy";
  586.27 + G_MODULE_EXPORT const gchar homepage[] = "http://www.xfce.org";
  586.28 + 
  586.29 ++/* fix for cups 1.6 incompatibility */
  586.30 ++#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
  586.31 ++#define HAVE_CUPS_1_6 1
  586.32 ++#endif
  586.33 ++
  586.34 ++#ifndef HAVE_CUPS_1_6
  586.35 ++#define ippGetState(request) request->state 
  586.36 ++#define ippGetInteger(attr, element) attr->values[element].integer
  586.37 ++#define ippGetString(attr, element, language) attr->values[element].string.text
  586.38 ++#define ippNewRequest(operation_id) cups_request_new(operation_id)
  586.39 ++
  586.40 ++static ipp_t *
  586.41 ++cups_request_new (int operation_id)
  586.42 ++{
  586.43 ++  ipp_t *request;
  586.44 ++  cups_lang_t *language;
  586.45 ++
  586.46 ++  language = cupsLangDefault ();
  586.47 ++  request = ippNew ();
  586.48 ++  request->request.op.operation_id = operation_id;
  586.49 ++  request->request.op.request_id = 1;
  586.50 ++
  586.51 ++  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
  586.52 ++
  586.53 ++  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language);
  586.54 ++  cupsLangFree (language);
  586.55 ++
  586.56 ++  return request;
  586.57 ++}
  586.58 ++#endif
  586.59 ++
  586.60 + static GtkActionEntry printer_list_action_entries[] = {
  586.61 +   {"set-default-printer", GTK_STOCK_PRINT, N_("Set as default printer"), NULL,
  586.62 +    N_("Set as default CUPS printer"), G_CALLBACK (action_set_default_printer_cb),},
  586.63 +@@ -126,25 +157,6 @@ cups_password_cb (const char *prompt)
  586.64 + }
  586.65 + 
  586.66 + static ipp_t *
  586.67 +-cups_request_new (int operation_id)
  586.68 +-{
  586.69 +-  ipp_t *request;
  586.70 +-  cups_lang_t *language;
  586.71 +-
  586.72 +-  language = cupsLangDefault ();
  586.73 +-  request = ippNew ();
  586.74 +-  request->request.op.operation_id = operation_id;
  586.75 +-  request->request.op.request_id = 1;
  586.76 +-
  586.77 +-  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
  586.78 +-
  586.79 +-  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language);
  586.80 +-  cupsLangFree (language);
  586.81 +-
  586.82 +-  return request;
  586.83 +-}
  586.84 +-
  586.85 +-static ipp_t *
  586.86 + cups_request_new_for_printer (int operation_id, const gchar * printer)
  586.87 + {
  586.88 +   ipp_t *request;
  586.89 +@@ -160,7 +172,7 @@ cups_request_new_for_printer (int operation_id, const gchar * printer)
  586.90 +   }
  586.91 + 
  586.92 +   printer_uri = g_strdup_printf ("ipp://%s/printers/%s", server, printer);
  586.93 +-  request = cups_request_new (operation_id);
  586.94 ++  request = ippNewRequest (operation_id);
  586.95 + 
  586.96 +   ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri);
  586.97 + 
  586.98 +@@ -242,24 +254,24 @@ get_printers ()
  586.99 + 
 586.100 +       if (!request)
 586.101 +         continue;
 586.102 +-      if (request->state == IPP_ERROR || request->state == IPP_IDLE) {
 586.103 ++      if (ippGetState (request) == IPP_ERROR || ippGetState (request) == IPP_IDLE) {
 586.104 +         ippDelete (request);
 586.105 +         continue;
 586.106 +       }
 586.107 + 
 586.108 +       attr = ippFindAttribute (request, "printer-info", IPP_TAG_TEXT);
 586.109 +-      if (!attr || strlen (attr->values[0].string.text) == 0) {
 586.110 ++      if (!attr || strlen (ippGetString (attr, 0, NULL)) == 0) {
 586.111 +         attr = ippFindAttribute (request, "printer-make-and-model", IPP_TAG_TEXT);
 586.112 +         if (attr)
 586.113 +-          printer->alias = g_strdup (attr->values[0].string.text);
 586.114 ++          printer->alias = g_strdup (ippGetString (attr, 0, NULL));
 586.115 +         else
 586.116 +           printer->alias = g_strdup ("");
 586.117 +       }
 586.118 +       else
 586.119 +-        printer->alias = g_strdup (attr->values[0].string.text);
 586.120 ++        printer->alias = g_strdup (ippGetString (attr, 0, NULL));
 586.121 + 
 586.122 +       attr = ippFindAttribute (request, "printer-type", IPP_TAG_ENUM);
 586.123 +-      if (attr && (attr->values[0].integer & CUPS_PRINTER_CLASS))
 586.124 ++      if (attr && (ippGetInteger (attr, 0) & CUPS_PRINTER_CLASS))
 586.125 +         printer->type = PRINTER_TYPE_CLASS;
 586.126 +       else
 586.127 +         printer->type = PRINTER_TYPE_PRINTER;
 586.128 +@@ -309,7 +321,7 @@ get_printer_state (const gchar * printer)
 586.129 +     ipp_attribute_t *attr = ippFindAttribute (request, "printer-state",
 586.130 +                                               IPP_TAG_ENUM);
 586.131 +     if (attr)
 586.132 +-      switch (attr->values[0].integer) {
 586.133 ++      switch (ippGetInteger (attr, 0)) {
 586.134 +       case IPP_PRINTER_IDLE:
 586.135 +         state = PRINTER_STATE_IDLE;
 586.136 +         break;
 586.137 +-- 
 586.138 +1.7.9.5
 586.139 +
   587.1 --- a/xfprint/stuff/xfprint-4.6.1-cups-1.6.patch	Wed May 09 17:03:28 2018 +0300
   587.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   587.3 @@ -1,136 +0,0 @@
   587.4 ->From 2b5b2efdf2ce8233933c1304dc00c271303a4d92 Mon Sep 17 00:00:00 2001
   587.5 -From: Matt Philips <matt.philips@timesys.com>
   587.6 -Date: Fri, 19 Apr 2013 14:31:37 -0400
   587.7 -Subject: [PATCH] Use CUPS-1.6 IPP API getter/setter functions
   587.8 -
   587.9 -CUPS 1.6 makes various structures private and introduces these ippGet
  587.10 -and ippSet functions for all of the fields in these structures.
  587.11 -http://www.cups.org/str.php?L3928
  587.12 -
  587.13 -We define our own accessors when building against CUPS < 1.6.
  587.14 -
  587.15 -Based on work by Jiri Popelka <jpopelka@redhat.com> at
  587.16 -https://bugzilla.gnome.org/show_bug.cgi?id=679759
  587.17 ----
  587.18 - printing-systems/cups/cups.c |   64 +++++++++++++++++-----------
  587.19 - 1 file changed, 38 insertions(+), 26 deletions(-)
  587.20 -
  587.21 -diff --git a/printing-systems/cups/cups.c b/xfprint-4.6.1/printing-systems/cups/cups.c
  587.22 -index 96b30d1..9d5df01 100644
  587.23 ---- a/printing-systems/cups/cups.c
  587.24 -+++ b/printing-systems/cups/cups.c
  587.25 -@@ -44,6 +44,37 @@ G_MODULE_EXPORT const gchar version[] = VERSION;
  587.26 - G_MODULE_EXPORT const gchar author[] = "Jean-François Wauthy";
  587.27 - G_MODULE_EXPORT const gchar homepage[] = "http://www.xfce.org";
  587.28 - 
  587.29 -+/* fix for cups 1.6 incompatibility */
  587.30 -+#if (CUPS_VERSION_MAJOR > 1) || (CUPS_VERSION_MINOR > 5)
  587.31 -+#define HAVE_CUPS_1_6 1
  587.32 -+#endif
  587.33 -+
  587.34 -+#ifndef HAVE_CUPS_1_6
  587.35 -+#define ippGetState(request) request->state 
  587.36 -+#define ippGetInteger(attr, element) attr->values[element].integer
  587.37 -+#define ippGetString(attr, element, language) attr->values[element].string.text
  587.38 -+#define ippNewRequest(operation_id) cups_request_new(operation_id)
  587.39 -+
  587.40 -+static ipp_t *
  587.41 -+cups_request_new (int operation_id)
  587.42 -+{
  587.43 -+  ipp_t *request;
  587.44 -+  cups_lang_t *language;
  587.45 -+
  587.46 -+  language = cupsLangDefault ();
  587.47 -+  request = ippNew ();
  587.48 -+  request->request.op.operation_id = operation_id;
  587.49 -+  request->request.op.request_id = 1;
  587.50 -+
  587.51 -+  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
  587.52 -+
  587.53 -+  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language);
  587.54 -+  cupsLangFree (language);
  587.55 -+
  587.56 -+  return request;
  587.57 -+}
  587.58 -+#endif
  587.59 -+
  587.60 - static GtkActionEntry printer_list_action_entries[] = {
  587.61 -   {"set-default-printer", GTK_STOCK_PRINT, N_("Set as default printer"), NULL,
  587.62 -    N_("Set as default CUPS printer"), G_CALLBACK (action_set_default_printer_cb),},
  587.63 -@@ -126,25 +157,6 @@ cups_password_cb (const char *prompt)
  587.64 - }
  587.65 - 
  587.66 - static ipp_t *
  587.67 --cups_request_new (int operation_id)
  587.68 --{
  587.69 --  ipp_t *request;
  587.70 --  cups_lang_t *language;
  587.71 --
  587.72 --  language = cupsLangDefault ();
  587.73 --  request = ippNew ();
  587.74 --  request->request.op.operation_id = operation_id;
  587.75 --  request->request.op.request_id = 1;
  587.76 --
  587.77 --  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_CHARSET, "attributes-charset", NULL, "utf-8");
  587.78 --
  587.79 --  ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_LANGUAGE, "attributes-natural-language", NULL, language->language);
  587.80 --  cupsLangFree (language);
  587.81 --
  587.82 --  return request;
  587.83 --}
  587.84 --
  587.85 --static ipp_t *
  587.86 - cups_request_new_for_printer (int operation_id, const gchar * printer)
  587.87 - {
  587.88 -   ipp_t *request;
  587.89 -@@ -160,7 +172,7 @@ cups_request_new_for_printer (int operation_id, const gchar * printer)
  587.90 -   }
  587.91 - 
  587.92 -   printer_uri = g_strdup_printf ("ipp://%s/printers/%s", server, printer);
  587.93 --  request = cups_request_new (operation_id);
  587.94 -+  request = ippNewRequest (operation_id);
  587.95 - 
  587.96 -   ippAddString (request, IPP_TAG_OPERATION, IPP_TAG_URI, "printer-uri", NULL, printer_uri);
  587.97 - 
  587.98 -@@ -242,24 +254,24 @@ get_printers ()
  587.99 - 
 587.100 -       if (!request)
 587.101 -         continue;
 587.102 --      if (request->state == IPP_ERROR || request->state == IPP_IDLE) {
 587.103 -+      if (ippGetState (request) == IPP_ERROR || ippGetState (request) == IPP_IDLE) {
 587.104 -         ippDelete (request);
 587.105 -         continue;
 587.106 -       }
 587.107 - 
 587.108 -       attr = ippFindAttribute (request, "printer-info", IPP_TAG_TEXT);
 587.109 --      if (!attr || strlen (attr->values[0].string.text) == 0) {
 587.110 -+      if (!attr || strlen (ippGetString (attr, 0, NULL)) == 0) {
 587.111 -         attr = ippFindAttribute (request, "printer-make-and-model", IPP_TAG_TEXT);
 587.112 -         if (attr)
 587.113 --          printer->alias = g_strdup (attr->values[0].string.text);
 587.114 -+          printer->alias = g_strdup (ippGetString (attr, 0, NULL));
 587.115 -         else
 587.116 -           printer->alias = g_strdup ("");
 587.117 -       }
 587.118 -       else
 587.119 --        printer->alias = g_strdup (attr->values[0].string.text);
 587.120 -+        printer->alias = g_strdup (ippGetString (attr, 0, NULL));
 587.121 - 
 587.122 -       attr = ippFindAttribute (request, "printer-type", IPP_TAG_ENUM);
 587.123 --      if (attr && (attr->values[0].integer & CUPS_PRINTER_CLASS))
 587.124 -+      if (attr && (ippGetInteger (attr, 0) & CUPS_PRINTER_CLASS))
 587.125 -         printer->type = PRINTER_TYPE_CLASS;
 587.126 -       else
 587.127 -         printer->type = PRINTER_TYPE_PRINTER;
 587.128 -@@ -309,7 +321,7 @@ get_printer_state (const gchar * printer)
 587.129 -     ipp_attribute_t *attr = ippFindAttribute (request, "printer-state",
 587.130 -                                               IPP_TAG_ENUM);
 587.131 -     if (attr)
 587.132 --      switch (attr->values[0].integer) {
 587.133 -+      switch (ippGetInteger (attr, 0)) {
 587.134 -       case IPP_PRINTER_IDLE:
 587.135 -         state = PRINTER_STATE_IDLE;
 587.136 -         break;
 587.137 --- 
 587.138 -1.7.9.5
 587.139 -
   588.1 --- a/xpat2/receipt	Wed May 09 17:03:28 2018 +0300
   588.2 +++ b/xpat2/receipt	Thu May 10 21:12:00 2018 +0300
   588.3 @@ -16,11 +16,6 @@
   588.4  # Rules to configure and make the package.
   588.5  compile_rules()
   588.6  {
   588.7 -	for i in xpat2.patch layout.patch ; do
   588.8 -		[ -f done.$i ] && continue
   588.9 -		patch -p1 < $stuff/$i
  588.10 -		touch done.$i
  588.11 -	done
  588.12  	cd src
  588.13  	cp $stuff/Makefile .
  588.14  	make LDFLAGS="-lX11 -lXaw -lXmu -lXt -lXpm" &&
   589.1 --- a/xpat2/stuff/layout.patch	Wed May 09 17:03:28 2018 +0300
   589.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   589.3 @@ -1,38 +0,0 @@
   589.4 ---- xpat2-1.07.orig/src/layout.c
   589.5 -+++ xpat2-1.07/src/layout.c
   589.6 -@@ -332,17 +332,9 @@
   589.7 - 	}
   589.8 -     } else {
   589.9 - 	/* enough space for the slots! */
  589.10 --	int currentx = geo.dx;
  589.11 --/*	printf("generating high layout for %d,%d\n", geo.w, geo.h); */
  589.12 --	if (rem_x >= (rules.numslots + 1) * (geo.cw + geo.dx) &&
  589.13 --	    !(rules.variant & NODEAL)) {
  589.14 --	    /* there is space for the deck, and we can use one! */
  589.15 --	    geo.pg[game.numpiles-1].x = geo.dx;
  589.16 --	    geo.pg[game.numpiles-1].y = geo.dy + geo.ch + geo.dy;
  589.17 --	    currentx += geo.cw + geo.dx;
  589.18 --	    new_layout_type = GEN_BIG_LAYOUT_WITH_DECK;
  589.19 --	    geo.preferred_width += geo.dx + geo.cw;
  589.20 --	}
  589.21 -+	int currentx = geo.dx + rules.numdecks * (geo.cw + geo.dx);
  589.22 -+	new_layout_type = GEN_BIG_LAYOUT_WITH_DECK;
  589.23 -+	geo.preferred_width += rules.numdecks * (geo.dx + geo.cw);
  589.24 - 	for (i = 0; i < rules.numslots; ++i) {
  589.25 - 	    /* create slot of full window height */
  589.26 - 	    p->x = currentx;
  589.27 -@@ -351,6 +343,14 @@
  589.28 - 	    currentx += geo.cw + geo.dx;
  589.29 - 	    ++p;
  589.30 - 	}
  589.31 -+	/* finally, position the decks */
  589.32 -+	for (i = 0; i < rules.numdecks; ++i) {
  589.33 -+	    p[0].x = i * (geo.dx + geo.cw);
  589.34 -+	    p[1].x = p[0].x;
  589.35 -+	    p[0].y = geo.dy + 2 * (geo.ch + geo.dy);
  589.36 -+	    p[1].y = geo.dy + geo.ch + geo.dy;
  589.37 -+	    p += 2;
  589.38 -+	}
  589.39 - 	/* redo pos. of stacks */
  589.40 - 	p = geo.pg;
  589.41 - 	for (i = 0; i < rules.numstacks; ++i) {
   590.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   590.2 +++ b/xpat2/stuff/patches/layout.patch	Thu May 10 21:12:00 2018 +0300
   590.3 @@ -0,0 +1,38 @@
   590.4 +--- xpat2-1.07.orig/src/layout.c
   590.5 ++++ xpat2-1.07/src/layout.c
   590.6 +@@ -332,17 +332,9 @@
   590.7 + 	}
   590.8 +     } else {
   590.9 + 	/* enough space for the slots! */
  590.10 +-	int currentx = geo.dx;
  590.11 +-/*	printf("generating high layout for %d,%d\n", geo.w, geo.h); */
  590.12 +-	if (rem_x >= (rules.numslots + 1) * (geo.cw + geo.dx) &&
  590.13 +-	    !(rules.variant & NODEAL)) {
  590.14 +-	    /* there is space for the deck, and we can use one! */
  590.15 +-	    geo.pg[game.numpiles-1].x = geo.dx;
  590.16 +-	    geo.pg[game.numpiles-1].y = geo.dy + geo.ch + geo.dy;
  590.17 +-	    currentx += geo.cw + geo.dx;
  590.18 +-	    new_layout_type = GEN_BIG_LAYOUT_WITH_DECK;
  590.19 +-	    geo.preferred_width += geo.dx + geo.cw;
  590.20 +-	}
  590.21 ++	int currentx = geo.dx + rules.numdecks * (geo.cw + geo.dx);
  590.22 ++	new_layout_type = GEN_BIG_LAYOUT_WITH_DECK;
  590.23 ++	geo.preferred_width += rules.numdecks * (geo.dx + geo.cw);
  590.24 + 	for (i = 0; i < rules.numslots; ++i) {
  590.25 + 	    /* create slot of full window height */
  590.26 + 	    p->x = currentx;
  590.27 +@@ -351,6 +343,14 @@
  590.28 + 	    currentx += geo.cw + geo.dx;
  590.29 + 	    ++p;
  590.30 + 	}
  590.31 ++	/* finally, position the decks */
  590.32 ++	for (i = 0; i < rules.numdecks; ++i) {
  590.33 ++	    p[0].x = i * (geo.dx + geo.cw);
  590.34 ++	    p[1].x = p[0].x;
  590.35 ++	    p[0].y = geo.dy + 2 * (geo.ch + geo.dy);
  590.36 ++	    p[1].y = geo.dy + geo.ch + geo.dy;
  590.37 ++	    p += 2;
  590.38 ++	}
  590.39 + 	/* redo pos. of stacks */
  590.40 + 	p = geo.pg;
  590.41 + 	for (i = 0; i < rules.numstacks; ++i) {
   591.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   591.2 +++ b/xpat2/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   591.3 @@ -0,0 +1,2 @@
   591.4 +-p1|xpat2.patch
   591.5 +-p1|layout.patch
   592.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   592.2 +++ b/xpat2/stuff/patches/xpat2.patch	Thu May 10 21:12:00 2018 +0300
   592.3 @@ -0,0 +1,10 @@
   592.4 +--- xpat2-1.07-orig/src/loadsave.c	Fri Jul 11 19:33:50 2008
   592.5 ++++ xpat2-1.07/src/loadsave.c	Fri Jul 11 19:35:36 2008
   592.6 +@@ -31,6 +31,7 @@
   592.7 + #  define NAME_MAX	14	/* every UNIX should have at least this */
   592.8 + #else
   592.9 + #  include <unistd.h>		/* for pathconf() */
  592.10 ++#  include <sys/types.h>
  592.11 + #  include <sys/utsname.h>	/* for uname() */
  592.12 + #endif
  592.13 + 
   593.1 --- a/xpat2/stuff/xpat2.patch	Wed May 09 17:03:28 2018 +0300
   593.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   593.3 @@ -1,10 +0,0 @@
   593.4 ---- xpat2-1.07-orig/src/loadsave.c	Fri Jul 11 19:33:50 2008
   593.5 -+++ xpat2-1.07/src/loadsave.c	Fri Jul 11 19:35:36 2008
   593.6 -@@ -31,6 +31,7 @@
   593.7 - #  define NAME_MAX	14	/* every UNIX should have at least this */
   593.8 - #else
   593.9 - #  include <unistd.h>		/* for pathconf() */
  593.10 -+#  include <sys/types.h>
  593.11 - #  include <sys/utsname.h>	/* for uname() */
  593.12 - #endif
  593.13 - 
   594.1 --- a/yarock/receipt	Wed May 09 17:03:28 2018 +0300
   594.2 +++ b/yarock/receipt	Thu May 10 21:12:00 2018 +0300
   594.3 @@ -27,7 +27,6 @@
   594.4  	sed -i 's/TAGLIB_VERSION STRLESS/TAGLIB_VERSION VERSION_LESS/' \
   594.5  		cmake/FindTaglib.cmake
   594.6  	cp -f $stuff/yarock_ru.ts $src/translation
   594.7 -	patch -p0 < $stuff/yarock.patch
   594.8  
   594.9  	mkdir build; cd build
  594.10  	cmake -DCMAKE_INSTALL_PREFIX=/usr ..
   595.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   595.2 +++ b/yarock/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   595.3 @@ -0,0 +1,1 @@
   595.4 +-p0|yarock.patch
   596.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   596.2 +++ b/yarock/stuff/patches/yarock.patch	Thu May 10 21:12:00 2018 +0300
   596.3 @@ -0,0 +1,16 @@
   596.4 +--- src/core/player/engine_phonon.cpp
   596.5 ++++ src/core/player/engine_phonon.cpp
   596.6 +@@ -26,6 +26,7 @@
   596.7 + // Qt
   596.8 + #include <QFileInfo>
   596.9 + #include <QList>
  596.10 ++#include <QtCore/QUrl>
  596.11 + 
  596.12 + // phonon
  596.13 + #include <phonon/backendcapabilities.h>
  596.14 +
  596.15 +--- src/dbus/org.mpris.MediaPlayer2.Player.xml
  596.16 ++++ src/dbus/org.mpris.MediaPlayer2.Player.xml
  596.17 +@@ -30 +30 @@
  596.18 +-			<annotation name="com.trolltech.QtDBus.QtTypeName" value="QVariantMap"/>
  596.19 ++			<annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariantMap"/>
   597.1 --- a/yarock/stuff/yarock.patch	Wed May 09 17:03:28 2018 +0300
   597.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   597.3 @@ -1,16 +0,0 @@
   597.4 ---- src/core/player/engine_phonon.cpp
   597.5 -+++ src/core/player/engine_phonon.cpp
   597.6 -@@ -26,6 +26,7 @@
   597.7 - // Qt
   597.8 - #include <QFileInfo>
   597.9 - #include <QList>
  597.10 -+#include <QtCore/QUrl>
  597.11 - 
  597.12 - // phonon
  597.13 - #include <phonon/backendcapabilities.h>
  597.14 -
  597.15 ---- src/dbus/org.mpris.MediaPlayer2.Player.xml
  597.16 -+++ src/dbus/org.mpris.MediaPlayer2.Player.xml
  597.17 -@@ -30 +30 @@
  597.18 --			<annotation name="com.trolltech.QtDBus.QtTypeName" value="QVariantMap"/>
  597.19 -+			<annotation name="org.qtproject.QtDBus.QtTypeName" value="QVariantMap"/>
   598.1 --- a/yasr/receipt	Wed May 09 17:03:28 2018 +0300
   598.2 +++ b/yasr/receipt	Thu May 10 21:12:00 2018 +0300
   598.3 @@ -15,9 +15,6 @@
   598.4  # Rules to configure and make the package.
   598.5  compile_rules()
   598.6  {
   598.7 -	cd $src/yasr
   598.8 -	patch -p0 < $stuff/yasr.patch || return 1
   598.9 -	cd ../
  598.10  	./configure \
  598.11  		--prefix=/usr $CONFIGURE_ARGS &&
  598.12  	make && make DESTDIR=$DESTDIR install
   599.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   599.2 +++ b/yasr/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   599.3 @@ -0,0 +1,1 @@
   599.4 +-p0|yasr.patch
   600.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   600.2 +++ b/yasr/stuff/patches/yasr.patch	Thu May 10 21:12:00 2018 +0300
   600.3 @@ -0,0 +1,22 @@
   600.4 +--- yasr/yasr.h.old	Thu Jan 31 12:56:45 2008
   600.5 ++++ yasr/yasr.h	Sat Jan 30 11:37:31 2010
   600.6 +@@ -309,7 +309,9 @@
   600.7 + extern void opt_write(FILE * fp);
   600.8 + 
   600.9 + /* openpty.c prototypes */
  600.10 ++#ifndef HAVE_OPENPTY
  600.11 + extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
  600.12 ++#endif
  600.13 + 
  600.14 + /* cfmakeraw.c prototypes */
  600.15 + extern void cfmakeraw(struct termios *);
  600.16 +@@ -318,7 +320,9 @@
  600.17 + extern int login_tty(int);
  600.18 + 
  600.19 + /* forkpty.c prototypes */
  600.20 ++#ifndef HAVE_FORKPTY
  600.21 + extern int forkpty(int *, char *, struct termios *, struct winsize *);
  600.22 ++#endif
  600.23 + 
  600.24 + /* tbc - Would it be more efficient to ensure that "blank" grids always held
  600.25 +    ascii 0x20 rather than ascii 0x00? */
   601.1 --- a/yasr/stuff/yasr.patch	Wed May 09 17:03:28 2018 +0300
   601.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   601.3 @@ -1,22 +0,0 @@
   601.4 ---- yasr.h.old	Thu Jan 31 12:56:45 2008
   601.5 -+++ yasr.h	Sat Jan 30 11:37:31 2010
   601.6 -@@ -309,7 +309,9 @@
   601.7 - extern void opt_write(FILE * fp);
   601.8 - 
   601.9 - /* openpty.c prototypes */
  601.10 -+#ifndef HAVE_OPENPTY
  601.11 - extern int openpty(int *, int *, char *, struct termios *, struct winsize *);
  601.12 -+#endif
  601.13 - 
  601.14 - /* cfmakeraw.c prototypes */
  601.15 - extern void cfmakeraw(struct termios *);
  601.16 -@@ -318,7 +320,9 @@
  601.17 - extern int login_tty(int);
  601.18 - 
  601.19 - /* forkpty.c prototypes */
  601.20 -+#ifndef HAVE_FORKPTY
  601.21 - extern int forkpty(int *, char *, struct termios *, struct winsize *);
  601.22 -+#endif
  601.23 - 
  601.24 - /* tbc - Would it be more efficient to ensure that "blank" grids always held
  601.25 -    ascii 0x20 rather than ascii 0x00? */
   602.1 --- a/ypserv/receipt	Wed May 09 17:03:28 2018 +0300
   602.2 +++ b/ypserv/receipt	Thu May 10 21:12:00 2018 +0300
   602.3 @@ -14,7 +14,6 @@
   602.4  BUILD_DEPENDS="gdbm-dev"
   602.5  
   602.6  compile_rules() {
   602.7 -	patch -Np1 -i $stuff/confpost.patch
   602.8  	./configure \
   602.9  		$CONFIGURE_ARGS &&
  602.10  	make &&
   603.1 --- a/ypserv/stuff/confpost.patch	Wed May 09 17:03:28 2018 +0300
   603.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   603.3 @@ -1,14 +0,0 @@
   603.4 -diff -up ypserv-2.27/conf_post.h.qdbm ypserv-2.27/conf_post.h
   603.5 ---- ypserv-2.27/conf_post.h.qdbm	2012-02-01 14:18:01.780846425 +0100
   603.6 -+++ ypserv-2.27/conf_post.h	2012-02-01 14:18:01.780846425 +0100
   603.7 -@@ -0,0 +1,10 @@
   603.8 -+/* Define common preprocessor symbol for HAVE_LIBGDBM and HAVE_LIBQDBM, since
   603.9 -+ * libraries gdbm and qdbm have same symbol names. */
  603.10 -+#undef HAVE_COMPAT_LIBGDBM
  603.11 -+#ifdef HAVE_LIBGDBM
  603.12 -+#define HAVE_COMPAT_LIBGDBM
  603.13 -+#endif
  603.14 -+#ifdef HAVE_LIBQDBM
  603.15 -+#define HAVE_COMPAT_LIBGDBM
  603.16 -+#endif
  603.17 -+
   604.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   604.2 +++ b/ypserv/stuff/patches/confpost.patch	Thu May 10 21:12:00 2018 +0300
   604.3 @@ -0,0 +1,14 @@
   604.4 +diff -up ypserv-2.27/conf_post.h.qdbm ypserv-2.27/conf_post.h
   604.5 +--- ypserv-2.27/conf_post.h.qdbm	2012-02-01 14:18:01.780846425 +0100
   604.6 ++++ ypserv-2.27/conf_post.h	2012-02-01 14:18:01.780846425 +0100
   604.7 +@@ -0,0 +1,10 @@
   604.8 ++/* Define common preprocessor symbol for HAVE_LIBGDBM and HAVE_LIBQDBM, since
   604.9 ++ * libraries gdbm and qdbm have same symbol names. */
  604.10 ++#undef HAVE_COMPAT_LIBGDBM
  604.11 ++#ifdef HAVE_LIBGDBM
  604.12 ++#define HAVE_COMPAT_LIBGDBM
  604.13 ++#endif
  604.14 ++#ifdef HAVE_LIBQDBM
  604.15 ++#define HAVE_COMPAT_LIBGDBM
  604.16 ++#endif
  604.17 ++
   605.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   605.2 +++ b/ypserv/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   605.3 @@ -0,0 +1,1 @@
   605.4 +confpost.patch
   606.1 --- a/zerobin/receipt	Wed May 09 17:03:28 2018 +0300
   606.2 +++ b/zerobin/receipt	Thu May 10 21:12:00 2018 +0300
   606.3 @@ -13,7 +13,6 @@
   606.4  WGET_URL="https://github.com/sebsauvage/ZeroBin/archive/$VERSION.tar.gz"
   606.5  
   606.6  compile_rules() {
   606.7 -	patch -p0 < $stuff/zerobin.u
   606.8  	mkdir -p \
   606.9  		$install/usr/share/zerobin/ \
  606.10  		$install/var/lib/zerobin/data/ \
   607.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   607.2 +++ b/zerobin/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   607.3 @@ -0,0 +1,1 @@
   607.4 +-p0|zerobin.u
   608.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   608.2 +++ b/zerobin/stuff/patches/zerobin.u	Thu May 10 21:12:00 2018 +0300
   608.3 @@ -0,0 +1,92 @@
   608.4 +--- index.php
   608.5 ++++ index.php
   608.6 +@@ -17,6 +17,13 @@
   608.7 +     $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
   608.8 + }
   608.9 + 
  608.10 ++function remote_address()
  608.11 ++{
  608.12 ++	// if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
  608.13 ++	//	return $_SERVER["HTTP_X_FORWARDED_FOR"];
  608.14 ++	return $_SERVER["REMOTE_ADDR"];
  608.15 ++}
  608.16 ++
  608.17 + // trafic_limiter : Make sure the IP address makes at most 1 request every 10 seconds.
  608.18 + // Will return false if IP address made a call less than 10 seconds ago.
  608.19 + function trafic_limiter_canPass($ip)
  608.20 +@@ -157,7 +164,7 @@
  608.21 +     }
  608.22 + 
  608.23 +     // Make sure last paste from the IP address was more than 10 seconds ago.
  608.24 +-    if (!trafic_limiter_canPass($_SERVER['REMOTE_ADDR']))
  608.25 ++    if (!trafic_limiter_canPass(remote_address()))
  608.26 +         { echo json_encode(array('status'=>1,'message'=>'Please wait 10 seconds between each post.')); exit; }
  608.27 + 
  608.28 +     // Make sure content is not too big.
  608.29 +@@ -229,7 +236,7 @@
  608.30 +             // (We assume that if the user did not enter a nickname, he/she wants
  608.31 +             // to be anonymous and we will not generate the vizhash.)
  608.32 +             $vz = new vizhash16x16();
  608.33 +-            $pngdata = $vz->generate($_SERVER['REMOTE_ADDR']);
  608.34 ++            $pngdata = $vz->generate(remote_address());
  608.35 +             if ($pngdata!='') $meta['vizhash'] = 'data:image/png;base64,'.base64_encode($pngdata);
  608.36 +             // Once the avatar is generated, we do not keep the IP address, nor its hash.
  608.37 +         }
  608.38 +--- js/zerobin.js
  608.39 ++++ js/zerobin.js
  608.40 +@@ -340,7 +340,13 @@
  608.41 +     
  608.42 +     showStatus('Sending paste...', spin=true);
  608.43 + 
  608.44 +-    var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8, 0), 0);
  608.45 ++    var randomkey = (window.location.hash.length > 2) ?
  608.46 ++	// force key
  608.47 ++	window.location.hash.substring(1) :
  608.48 ++	// Generate a random 256 bits key, encoded in base64:
  608.49 ++	sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0);
  608.50 ++    if (randomkey.charAt(randomkey.length-1) !== '=')
  608.51 ++	randomkey+='='; // Add trailing = if missing.
  608.52 +     var cipherdata = zeroCipher(randomkey, $('textarea#message').val());
  608.53 +     var data_to_send = { data:           cipherdata,
  608.54 +                          expire:         $('select#pasteExpiration').val(),
  608.55 +@@ -410,6 +416,7 @@
  608.56 +     $('button#sendbutton').show();
  608.57 +     $('button#clonebutton').hide();
  608.58 +     $('button#rawtextbutton').hide();
  608.59 ++    $('button#downloadbutton').hide();
  608.60 +     $('div#expiration').show();
  608.61 +     $('div#remainingtime').hide();
  608.62 +     $('div#burnafterreadingoption').show();
  608.63 +@@ -438,6 +445,7 @@
  608.64 +         $('button#clonebutton').show();
  608.65 +     }
  608.66 +     $('button#rawtextbutton').show();
  608.67 ++    $('button#downloadbutton').show();
  608.68 + 
  608.69 +     $('div#expiration').hide();
  608.70 +     $('div#burnafterreadingoption').hide();
  608.71 +@@ -457,6 +465,14 @@
  608.72 +     var newDoc = document.open('text/html', 'replace');
  608.73 +     newDoc.write('<pre>'+paste+'</pre>');
  608.74 +     newDoc.close();
  608.75 ++}
  608.76 ++
  608.77 ++/** Download raw text
  608.78 ++  */
  608.79 ++function downLoad()
  608.80 ++{
  608.81 ++    var paste = $('div#cleartext').html();
  608.82 ++    document.location = 'data:Application/octet-stream,' + encodeURIComponent(paste);
  608.83 + }
  608.84 + 
  608.85 + /**
  608.86 +--- tpl/page.html
  608.87 ++++ tpl/page.html
  608.88 +@@ -47,6 +47,7 @@
  608.89 +     <button id="sendbutton" onclick="send_data();return false;" style="display:none;"><img src="img/icon_send.png#" width="18" height="15" />Send</button>
  608.90 +     <button id="clonebutton" onclick="clonePaste();return false;" style="display:none;"><img src="img/icon_clone.png#" width="15" height="17" />Clone</button>
  608.91 +     <button id="rawtextbutton" onclick="rawText();return false;" style="display:none; "><img src="img/icon_raw.png#" width="15" height="15" style="padding:1px 0px 1px 0px;"/>Raw text</button>
  608.92 ++    <button id="downloadbutton" onclick="downLoad();return false;" style="display:none; "><img src="img/icon_new.png#" width="11" height="15" style="padding:1px 0px 1px 0px;"/>Download</button>
  608.93 +       <div id="expiration" style="display:none;">Expires: 
  608.94 +       <select id="pasteExpiration" name="pasteExpiration">
  608.95 +         <option value="5min">5 minutes</option>
   609.1 --- a/zerobin/stuff/zerobin.u	Wed May 09 17:03:28 2018 +0300
   609.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   609.3 @@ -1,92 +0,0 @@
   609.4 ---- index.php
   609.5 -+++ index.php
   609.6 -@@ -17,6 +17,13 @@
   609.7 -     $_COOKIE = array_map('stripslashes_deep', $_COOKIE);
   609.8 - }
   609.9 - 
  609.10 -+function remote_address()
  609.11 -+{
  609.12 -+	// if (isset($_SERVER["HTTP_X_FORWARDED_FOR"]))
  609.13 -+	//	return $_SERVER["HTTP_X_FORWARDED_FOR"];
  609.14 -+	return $_SERVER["REMOTE_ADDR"];
  609.15 -+}
  609.16 -+
  609.17 - // trafic_limiter : Make sure the IP address makes at most 1 request every 10 seconds.
  609.18 - // Will return false if IP address made a call less than 10 seconds ago.
  609.19 - function trafic_limiter_canPass($ip)
  609.20 -@@ -157,7 +164,7 @@
  609.21 -     }
  609.22 - 
  609.23 -     // Make sure last paste from the IP address was more than 10 seconds ago.
  609.24 --    if (!trafic_limiter_canPass($_SERVER['REMOTE_ADDR']))
  609.25 -+    if (!trafic_limiter_canPass(remote_address()))
  609.26 -         { echo json_encode(array('status'=>1,'message'=>'Please wait 10 seconds between each post.')); exit; }
  609.27 - 
  609.28 -     // Make sure content is not too big.
  609.29 -@@ -229,7 +236,7 @@
  609.30 -             // (We assume that if the user did not enter a nickname, he/she wants
  609.31 -             // to be anonymous and we will not generate the vizhash.)
  609.32 -             $vz = new vizhash16x16();
  609.33 --            $pngdata = $vz->generate($_SERVER['REMOTE_ADDR']);
  609.34 -+            $pngdata = $vz->generate(remote_address());
  609.35 -             if ($pngdata!='') $meta['vizhash'] = 'data:image/png;base64,'.base64_encode($pngdata);
  609.36 -             // Once the avatar is generated, we do not keep the IP address, nor its hash.
  609.37 -         }
  609.38 ---- js/zerobin.js
  609.39 -+++ js/zerobin.js
  609.40 -@@ -340,7 +340,13 @@
  609.41 -     
  609.42 -     showStatus('Sending paste...', spin=true);
  609.43 - 
  609.44 --    var randomkey = sjcl.codec.base64.fromBits(sjcl.random.randomWords(8, 0), 0);
  609.45 -+    var randomkey = (window.location.hash.length > 2) ?
  609.46 -+	// force key
  609.47 -+	window.location.hash.substring(1) :
  609.48 -+	// Generate a random 256 bits key, encoded in base64:
  609.49 -+	sjcl.codec.base64.fromBits(sjcl.random.randomWords(8,0),0);
  609.50 -+    if (randomkey.charAt(randomkey.length-1) !== '=')
  609.51 -+	randomkey+='='; // Add trailing = if missing.
  609.52 -     var cipherdata = zeroCipher(randomkey, $('textarea#message').val());
  609.53 -     var data_to_send = { data:           cipherdata,
  609.54 -                          expire:         $('select#pasteExpiration').val(),
  609.55 -@@ -410,6 +416,7 @@
  609.56 -     $('button#sendbutton').show();
  609.57 -     $('button#clonebutton').hide();
  609.58 -     $('button#rawtextbutton').hide();
  609.59 -+    $('button#downloadbutton').hide();
  609.60 -     $('div#expiration').show();
  609.61 -     $('div#remainingtime').hide();
  609.62 -     $('div#burnafterreadingoption').show();
  609.63 -@@ -438,6 +445,7 @@
  609.64 -         $('button#clonebutton').show();
  609.65 -     }
  609.66 -     $('button#rawtextbutton').show();
  609.67 -+    $('button#downloadbutton').show();
  609.68 - 
  609.69 -     $('div#expiration').hide();
  609.70 -     $('div#burnafterreadingoption').hide();
  609.71 -@@ -457,6 +465,14 @@
  609.72 -     var newDoc = document.open('text/html', 'replace');
  609.73 -     newDoc.write('<pre>'+paste+'</pre>');
  609.74 -     newDoc.close();
  609.75 -+}
  609.76 -+
  609.77 -+/** Download raw text
  609.78 -+  */
  609.79 -+function downLoad()
  609.80 -+{
  609.81 -+    var paste = $('div#cleartext').html();
  609.82 -+    document.location = 'data:Application/octet-stream,' + encodeURIComponent(paste);
  609.83 - }
  609.84 - 
  609.85 - /**
  609.86 ---- tpl/page.html
  609.87 -+++ tpl/page.html
  609.88 -@@ -47,6 +47,7 @@
  609.89 -     <button id="sendbutton" onclick="send_data();return false;" style="display:none;"><img src="img/icon_send.png#" width="18" height="15" />Send</button>
  609.90 -     <button id="clonebutton" onclick="clonePaste();return false;" style="display:none;"><img src="img/icon_clone.png#" width="15" height="17" />Clone</button>
  609.91 -     <button id="rawtextbutton" onclick="rawText();return false;" style="display:none; "><img src="img/icon_raw.png#" width="15" height="15" style="padding:1px 0px 1px 0px;"/>Raw text</button>
  609.92 -+    <button id="downloadbutton" onclick="downLoad();return false;" style="display:none; "><img src="img/icon_new.png#" width="11" height="15" style="padding:1px 0px 1px 0px;"/>Download</button>
  609.93 -       <div id="expiration" style="display:none;">Expires: 
  609.94 -       <select id="pasteExpiration" name="pasteExpiration">
  609.95 -         <option value="5min">5 minutes</option>
   610.1 --- a/zsnes/receipt	Wed May 09 17:03:28 2018 +0300
   610.2 +++ b/zsnes/receipt	Thu May 10 21:12:00 2018 +0300
   610.3 @@ -19,7 +19,6 @@
   610.4  	  -e 's/info_ptr->color_type/png_get_color_type(png_ptr, info_ptr)/' \
   610.5  		src/zip/zpng.c
   610.6  	sed -i 's/cstdio.*/&\n#include <unistd.h>/' src/tools/depbuild.cpp
   610.7 -	patch -p1 -i $stuff/zsnes.patch
   610.8  
   610.9  	cd $src/src
  610.10  
   611.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   611.2 +++ b/zsnes/stuff/patches/series	Thu May 10 21:12:00 2018 +0300
   611.3 @@ -0,0 +1,1 @@
   611.4 +-p1|zsnes.patch
   612.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
   612.2 +++ b/zsnes/stuff/patches/zsnes.patch	Thu May 10 21:12:00 2018 +0300
   612.3 @@ -0,0 +1,67 @@
   612.4 +diff -cr zsnes_1_51/src/parsegen.cpp zsnes_1_51-patched/src/parsegen.cpp
   612.5 +*** zsnes_1_51/src/parsegen.cpp	2007-10-31 01:30:26.000000000 -0300
   612.6 +--- zsnes_1_51-patched/src/parsegen.cpp	2008-07-13 18:28:53.000000000 -0300
   612.7 +***************
   612.8 +*** 19,24 ****
   612.9 +--- 19,27 ----
  612.10 +  Config file handler creator by Nach (C) 2005-2007
  612.11 +  */
  612.12 +  
  612.13 ++ #include <cstring>
  612.14 ++ #include <cstdlib>
  612.15 ++ 
  612.16 +  #if !defined(__GNUC__) && !defined(_MSC_VER)
  612.17 +  #error You are using an unsupported compiler
  612.18 +  #endif
  612.19 +***************
  612.20 +*** 1822,1828 ****
  612.21 +    }
  612.22 +  }
  612.23 +  
  612.24 +! int main(size_t argc, const char *const *const argv)
  612.25 +  {
  612.26 +    const char *cheader_file = 0;
  612.27 +    bool compile = false;
  612.28 +--- 1825,1831 ----
  612.29 +    }
  612.30 +  }
  612.31 +  
  612.32 +! int main(int argc, const char *const *const argv)
  612.33 +  {
  612.34 +    const char *cheader_file = 0;
  612.35 +    bool compile = false;
  612.36 +diff -cr zsnes_1_51/src/tools/depbuild.cpp zsnes_1_51-patched/src/tools/depbuild.cpp
  612.37 +*** zsnes_1_51/src/tools/depbuild.cpp	2006-12-27 08:04:05.000000000 -0300
  612.38 +--- zsnes_1_51-patched/src/tools/depbuild.cpp	2008-07-13 18:30:46.000000000 -0300
  612.39 +***************
  612.40 +*** 183,189 ****
  612.41 +    }
  612.42 +  }
  612.43 +  
  612.44 +! int main(size_t argc, const char *const *const argv)
  612.45 +  {
  612.46 +    if (argc < 5)
  612.47 +    {
  612.48 +--- 183,189 ----
  612.49 +    }
  612.50 +  }
  612.51 +  
  612.52 +! int main(int argc, const char *const *const argv)
  612.53 +  {
  612.54 +    if (argc < 5)
  612.55 +    {
  612.56 +diff -cr zsnes_1_51/src/tools/strutil.h zsnes_1_51-patched/src/tools/strutil.h
  612.57 +*** zsnes_1_51/src/tools/strutil.h	2006-12-27 08:04:05.000000000 -0300
  612.58 +--- zsnes_1_51-patched/src/tools/strutil.h	2008-07-13 18:30:27.000000000 -0300
  612.59 +***************
  612.60 +*** 15,20 ****
  612.61 +--- 15,23 ----
  612.62 +  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  612.63 +  */
  612.64 +  
  612.65 ++ #include <cstring>
  612.66 ++ #include <cstdlib>
  612.67 ++ 
  612.68 +  /*
  612.69 +  This is part of a toolkit used to assist in ZSNES development
  612.70 +  */
   613.1 --- a/zsnes/stuff/zsnes.patch	Wed May 09 17:03:28 2018 +0300
   613.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
   613.3 @@ -1,67 +0,0 @@
   613.4 -diff -cr zsnes_1_51/src/parsegen.cpp zsnes_1_51-patched/src/parsegen.cpp
   613.5 -*** zsnes_1_51/src/parsegen.cpp	2007-10-31 01:30:26.000000000 -0300
   613.6 ---- zsnes_1_51-patched/src/parsegen.cpp	2008-07-13 18:28:53.000000000 -0300
   613.7 -***************
   613.8 -*** 19,24 ****
   613.9 ---- 19,27 ----
  613.10 -  Config file handler creator by Nach (C) 2005-2007
  613.11 -  */
  613.12 -  
  613.13 -+ #include <cstring>
  613.14 -+ #include <cstdlib>
  613.15 -+ 
  613.16 -  #if !defined(__GNUC__) && !defined(_MSC_VER)
  613.17 -  #error You are using an unsupported compiler
  613.18 -  #endif
  613.19 -***************
  613.20 -*** 1822,1828 ****
  613.21 -    }
  613.22 -  }
  613.23 -  
  613.24 -! int main(size_t argc, const char *const *const argv)
  613.25 -  {
  613.26 -    const char *cheader_file = 0;
  613.27 -    bool compile = false;
  613.28 ---- 1825,1831 ----
  613.29 -    }
  613.30 -  }
  613.31 -  
  613.32 -! int main(int argc, const char *const *const argv)
  613.33 -  {
  613.34 -    const char *cheader_file = 0;
  613.35 -    bool compile = false;
  613.36 -diff -cr zsnes_1_51/src/tools/depbuild.cpp zsnes_1_51-patched/src/tools/depbuild.cpp
  613.37 -*** zsnes_1_51/src/tools/depbuild.cpp	2006-12-27 08:04:05.000000000 -0300
  613.38 ---- zsnes_1_51-patched/src/tools/depbuild.cpp	2008-07-13 18:30:46.000000000 -0300
  613.39 -***************
  613.40 -*** 183,189 ****
  613.41 -    }
  613.42 -  }
  613.43 -  
  613.44 -! int main(size_t argc, const char *const *const argv)
  613.45 -  {
  613.46 -    if (argc < 5)
  613.47 -    {
  613.48 ---- 183,189 ----
  613.49 -    }
  613.50 -  }
  613.51 -  
  613.52 -! int main(int argc, const char *const *const argv)
  613.53 -  {
  613.54 -    if (argc < 5)
  613.55 -    {
  613.56 -diff -cr zsnes_1_51/src/tools/strutil.h zsnes_1_51-patched/src/tools/strutil.h
  613.57 -*** zsnes_1_51/src/tools/strutil.h	2006-12-27 08:04:05.000000000 -0300
  613.58 ---- zsnes_1_51-patched/src/tools/strutil.h	2008-07-13 18:30:27.000000000 -0300
  613.59 -***************
  613.60 -*** 15,20 ****
  613.61 ---- 15,23 ----
  613.62 -  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  613.63 -  */
  613.64 -  
  613.65 -+ #include <cstring>
  613.66 -+ #include <cstdlib>
  613.67 -+ 
  613.68 -  /*
  613.69 -  This is part of a toolkit used to assist in ZSNES development
  613.70 -  */