From cb84aafac3383be5c223e31c1f1376881a712386 Mon Sep 17 00:00:00 2001 From: Caolan McNamara Date: Tue, 8 Dec 2009 14:08:53 +0000 Subject: [PATCH] Resolves: rhbz#544372 survive having no HOME --- hunspell-1.2.8-2910695.nohome.patch | 28 ++++++++++++++++++++++++++++ hunspell.spec | 7 ++++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 hunspell-1.2.8-2910695.nohome.patch diff --git a/hunspell-1.2.8-2910695.nohome.patch b/hunspell-1.2.8-2910695.nohome.patch new file mode 100644 index 0000000..ecbf45c --- /dev/null +++ b/hunspell-1.2.8-2910695.nohome.patch @@ -0,0 +1,28 @@ +diff -ru hunspell-1.2.8.orig/src/tools/hunspell.cxx hunspell-1.2.8/src/tools/hunspell.cxx +--- hunspell-1.2.8.orig/src/tools/hunspell.cxx 2009-12-08 13:54:20.000000000 +0000 ++++ hunspell-1.2.8/src/tools/hunspell.cxx 2009-12-08 14:00:09.000000000 +0000 +@@ -1016,7 +1016,6 @@ + i->next = dicwords; + dicwords = i; + // save +- strcpy(buf,HOME); + if (HOME) strcpy(buf,HOME); else { + fprintf(stderr, gettext("error - missing HOME variable\n")); + break; +@@ -1147,7 +1146,6 @@ + } + // save + +- strcpy(buf,HOME); + if (HOME) strcpy(buf,HOME); else { + fprintf(stderr, gettext("error - missing HOME variable\n")); + continue; +@@ -1541,7 +1539,7 @@ + path = add(path, PATHSEP); // <- check path in root directory + if (getenv("DICPATH")) path = add(add(path, getenv("DICPATH")), PATHSEP); + path = add(add(path, LIBDIR), PATHSEP); +- path = add(add(add(add(path, HOME), DIRSEP), USEROOODIR), PATHSEP); ++ if (HOME) path = add(add(add(add(path, HOME), DIRSEP), USEROOODIR), PATHSEP); + path = add(path, OOODIR); + + if (showpath) { diff --git a/hunspell.spec b/hunspell.spec index 0fde927..dd7e42e 100644 --- a/hunspell.spec +++ b/hunspell.spec @@ -1,7 +1,7 @@ Name: hunspell Summary: A spell checker and morphological analyzer library Version: 1.2.8 -Release: 12%{?dist} +Release: 13%{?dist} Source0: http://downloads.sourceforge.net/%{name}/hunspell-%{version}.tar.gz Source1: http://people.debian.org/~agmartin/misc/ispellaff2myspell Source2: http://people.redhat.com/caolanm/hunspell/wordlist2hunspell @@ -14,6 +14,7 @@ Patch1: hunspell-1.2.7-2314461.ispell-alike.patch Patch2: hunspell-1.2.8-2784983.defaultlanguage.patch Patch3: hunspell-1.2.8-2812045.warnings.fortify.patch Patch4: hunspell-1.2.8-2826164.fixtests.patch +Patch5: hunspell-1.2.8-2910695.nohome.patch %description Hunspell is a spell checker and morphological analyzer library and program @@ -35,6 +36,7 @@ Includes and definitions for developing with hunspell %patch2 -p1 -b .defaultlanguage.patch %patch3 -p1 -b .warnings.fortify.patch %patch4 -p1 -b .fixtests.patch +%patch5 -p1 -b .nohome.patch # Filter unwanted Requires for the "use explicitely" string in ispellaff2myspell cat << \EOF > %{name}-req #!/bin/sh @@ -125,6 +127,9 @@ rm -rf $RPM_BUILD_ROOT %{_mandir}/man3/hunspell.3.gz %changelog +* Tue Dec 08 2009 Caolan McNamara - 1.2.8-13 +- Resolves: rhbz#544372 survive having no HOME + * Thu Jul 30 2009 Caolan McNamara - 1.2.8-12 - handle some other interesting edge-cases