[owner-abiword-dev@abisource.com: BOUNCE abiword-dev@abisource.com: Non-member submission from [Pavel Roskin <proski@gnu.org>]]


Subject: [owner-abiword-dev@abisource.com: BOUNCE abiword-dev@abisource.com: Non-member submission from [Pavel Roskin ]]
From: Sam TH (sam@uchicago.edu)
Date: Wed Apr 18 2001 - 19:56:41 CDT


           
sam th --- sam@uchicago.edu --- http://www.abisource.com/~sam/
OpenPGP Key: CABD33FC --- http://samth.dyndns.org/key
DeCSS: http://samth.dyndns.org/decss

attached mail follows:


>From owner-abiword-dev@abisource.com Wed Apr 18 16:37:13 2001
Return-Path: <owner-abiword-dev@abisource.com>
Delivered-To: abiword-dev@abisource.com
Received: from fencepost.gnu.org (fencepost.gnu.org [199.232.76.164])
        by parsons.abisource.com (Postfix) with ESMTP id DC87513B818
        for <abiword-dev@abisource.com>; Wed, 18 Apr 2001 16:37:12 -0500 (CDT)
Received: from proski by fencepost.gnu.org with local (Exim 3.16 #1 (Debian))
        id 14pzdM-0006l4-00
        for <abiword-dev@abisource.com>; Wed, 18 Apr 2001 17:37:08 -0400
Date: Wed, 18 Apr 2001 17:38:10 -0400 (EDT)
From: Pavel Roskin <proski@gnu.org>
X-X-Sender: <proski@fonzie.nine.com>
To: <abiword-dev@abisource.com>
Subject: Can't open american.hash
Message-ID: <Pine.LNX.4.33.0104181642420.26845-100000@fonzie.nine.com>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Hello!

The CVS version of Abiword for GTK compiled on RedHat 7.0 keeps printing
"Can't open american.hash"

As far as I understand, this comes from the linit() function in
abi/src/other/spell/xp/lookup.c

It prints exactly the filename that it tried to open, which means that it
tries to open "american.hash" without the full path.

Actually, AP_PREF_DEFAULT_SpellDirectory is defined but never used.
AP_PREF_KEY_SpellDirectory is used only in the Win32, BeOS and QNX
frontends.

The fix should be something like what I'm attaching, but it doesn't work
since lookup.c is written in C, not C++, hence no getAbiSuiteLibDir().

-- 
Regards,
Pavel Roskin

____________________________ --- src/other/spell/xp/lookup.c +++ src/other/spell/xp/lookup.c @@ -149,15 +149,28 @@ char *hashname; /* name of the hash file int nextchar, x; int viazero; register ichar_t * cp; + char * full_hashname;

if (inited) return 0;

- if ((fpHash = fopen (hashname, "rb")) == NULL) + full_hashname = malloc(strlen(XAP_App::getApp()->getAbiSuiteLibDir()) + + strlen(AP_PREF_DEFAULT_SpellDirectory) + + strlen(hashname) + 4); + + sprintf(full_hashname, "%s/%s/%s", + XAP_App::getApp()->getAbiSuiteLibDir(), + AP_PREF_DEFAULT_SpellDirectory, + hashname); + + if ((fpHash = fopen (full_hashname, "rb")) == NULL) { - (void) fprintf (stderr, CANT_OPEN, hashname); + (void) fprintf (stderr, CANT_OPEN, full_hashname); + free (full_hashname); return (-1); } + + free (full_hashname);

hashsize = fread ((char *) &hashheader, 1, sizeof hashheader, fpHash); if (hashsize < (int)sizeof(hashheader)) ____________________________




This archive was generated by hypermail 2b25 : Wed Apr 18 2001 - 19:44:47 CDT