[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#297308: marked as done (spell: '-d' option does not work and more)



Your message dated Fri, 30 Sep 2005 15:06:32 +0200
with message-id <87mzluiu1z.fsf@diziet.irb.hr>
and subject line Bug#297308: fixed in spell 1.0-14
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

--------------------------------------
Received: (at submit) by bugs.debian.org; 28 Feb 2005 14:48:58 +0000
>From ukh@id.cbs.dk Mon Feb 28 06:48:57 2005
Return-path: <ukh@id.cbs.dk>
Received: from mailhub.id.cbs.dk [130.226.47.91] (mail)
	by spohr.debian.org with esmtp (Exim 3.35 1 (Debian))
	id 1D5mCe-0007t4-00; Mon, 28 Feb 2005 06:48:56 -0800
Received: from mail.id.cbs.dk ([172.16.14.53] ident=mail)
	by mailhub.id.cbs.dk with esmtp 
	(Cipher TLSv1:AES256-SHA:256) (Exim 3.36 #1 (Debian))
	id 1D5mCU-0002YP-00
	for <submit@bugs.debian.org>; Mon, 28 Feb 2005 15:48:46 +0100
Received: from deskpro02.id.cbs.dk ([130.226.34.10])
	by mail.id.cbs.dk with esmtp 
	(Cipher TLSv1:AES256-SHA:256) (Exim 3.36 #1 (Debian))
	id 1D5mCT-00029L-00
	for <submit@bugs.debian.org>; Mon, 28 Feb 2005 15:48:45 +0100
Received: from ukh by deskpro02.id.cbs.dk with local (Exim 3.36 #1 (Debian))
	id 1D5mBz-0008GR-00
	for <submit@bugs.debian.org>; Mon, 28 Feb 2005 15:48:15 +0100
Date: Mon, 28 Feb 2005 15:48:14 +0100
To: submit@bugs.debian.org
Subject: spell: '-d' option does not work and more
Message-ID: <20050228144814.GA31574@id.cbs.dk>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
User-Agent: Mutt/1.5.6+20040907i
From: Kaare Hviid <ukh@id.cbs.dk>
X-Scanner: exiscan *1D5mCU-0002YP-00*8S/HgyIz9lE*
Delivered-To: submit@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Status: No, hits=-8.0 required=4.0 tests=BAYES_00,HAS_PACKAGE 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-Spam-Level: 

Package: spell
Version: 1.0-12
Severity: minor

This does not work:

	echo hello >dummy; echo hello >dummy2; spell -d dummy dummy2

it yields:

	spell: option argument not given

This is because of a now forgotten change in getopt_long().

Also, the '-d/--dictionary' option is misleading, since it does not
refer to an actual dictionary, but a wordlist.  I propose a '-D'
option to specify an ispell dictionary, while not touching '-d', as I
don't want to break backwards compatibility.  (And in some true spell
implementations, '-d' is also used for specifying a wordlist.)

I believe I sent you this proposed patch quite some time ago, but I
never submitted it to the BTS...

diff -Naur spell-1.0/debian/spell.1 spell-1.0.fixed/debian/spell.1
--- spell-1.0/debian/spell.1	2005-02-28 15:02:15.000000000 +0100
+++ spell-1.0.fixed/debian/spell.1	2003-12-04 11:50:30.000000000 +0100
@@ -42,6 +42,9 @@
 .B \-i, \-\-ispell=3DPROGRAM
 Calls PROGRAM as Ispell.
 .TP
+.B \-D, \-\-ispell-dictionary=3DDICTIONARY
+Use the named DICTIONARY to look up words.
+.TP
 .B \-l, \-\-all-chains
 Ignored; for compatibility.
 .TP
diff -Naur spell-1.0/spell.c spell-1.0.fixed/spell.c
--- spell-1.0/spell.c	1996-04-10 06:41:09.000000000 +0200
+++ spell-1.0.fixed/spell.c	2003-12-04 11:41:28.000000000 +0100
@@ -116,6 +116,7 @@
   {"ispell", required_argument, NULL, 'i'},
   {"ispell-version", no_argument, NULL, 'I'},
   {"number", no_argument, NULL, 'n'},
+  {"ispell-dictionary", required_argument, NULL, 'D'},
   {"print-file-name", no_argument, NULL, 'o'},
   {"print-stems", no_argument, NULL, 'x'},
   {"stop-list", required_argument, NULL, 's'},
@@ -130,9 +131,12 @@
 /* Ispell's location.  */
 char *ispell_prog =3D NULL;
=20
-/* Dictionary to use.  Just use the default if NULL.  */
+/* Personal dictionary to use.  Just use the default if NULL.  */
 char *dictionary =3D NULL;
=20
+/* Ispell dictionary to use via ispell's -d argument */
+char *idict =3D NULL;
+
 /* Display Ispell's version (--ispell-version, -I). */
 int show_ispell_version =3D 0;
=20
@@ -171,7 +175,7 @@
   /* Option processing loop.  */
   while (1)
     {
-      opt =3D getopt_long (argc, argv, "IVbdhilnosvx", long_options,
+      opt =3D getopt_long (argc, argv, "IVbd:D:hi:lnos:vx", long_options,
 			 (int *) 0);
=20
       if (opt =3D=3D EOF)
@@ -192,7 +196,7 @@
 	  if (optarg !=3D NULL)
 	    dictionary =3D xstrdup (optarg);
 	  else
-	    error (0, 0, "option argument not given");
+	    error (0, 0, "option argument not given to -d");
 	  break;
 	case 'h':
 	  show_help =3D 1;
@@ -201,7 +205,7 @@
 	  if (optarg !=3D NULL)
 	    ispell_prog =3D xstrdup (optarg);
 	  else
-	    error (0, 0, "option argument not given");
+	    error (0, 0, "option argument not given to -i");
 	  break;
 	case 'l':
 	  break;
@@ -211,6 +215,12 @@
 	case 'o':
 	  print_file_names =3D 1;
 	  break;
+	case 'D':
+	  if (optarg !=3DNULL)
+	    idict =3D xstrdup (optarg);
+	  else
+	    error (0, 0, "option argument not given to -D");
+	  break;
 	case 's':
 	  break;
 	case 'v':
@@ -242,18 +252,19 @@
     {
       printf ("Usage: %s [OPTION]... [FILE]...\n", program_name);
       fputs ("This is GNU Spell, a Unix spell emulator.\n\n"
-	     "  -I, --ispell-version\t\tPrint Ispell's version.\n"
-	     "  -V, --version\t\t\tPrint the version number.\n"
-	     "  -b, --british\t\t\tUse the British dictionary.\n"
-	     "  -d, --dictionary=3DFILE\t\tUse FILE to look up words.\n"
-	     "  -h, --help\t\t\tPrint a summary of the options.\n"
-	     "  -i, --ispell=3DPROGRAM\t\tCalls PROGRAM as Ispell.\n"
-	     "  -l, --all-chains\t\tIgnored; for compatibility.\n"
-	     "  -n, --number\t\t\tPrint line numbers before lines.\n"
-	     "  -o, --print-file-name\t\tPrint file names before lines.\n"
-	     "  -s, --stop-list=3DFILE\t\tIgnored; for compatibility.\n"
-	     "  -v, --verbose\t\t\tPrint words not literally found.\n"
-	     "  -x, --print-stems\t\tIgnored; for compatibility.\n\n"
+	     "  -I, --ispell-version\t\t\tPrint Ispell's version.\n"
+	     "  -V, --version\t\t\t\tPrint the version number.\n"
+	     "  -b, --british\t\t\t\tUse the British dictionary.\n"
+	     "  -d, --dictionary=3DFILE\t\t\tUse FILE to look up words.\n"
+	     "  -h, --help\t\t\t\tPrint a summary of the options.\n"
+	     "  -i, --ispell=3DPROGRAM\t\t\tCalls PROGRAM as Ispell.\n"
+	     "  -l, --all-chains\t\t\tIgnored; for compatibility.\n"
+	     "  -n, --number\t\t\t\tPrint line numbers before lines.\n"
+	     "  -o, --print-file-name\t\t\tPrint file names before lines.\n"
+	     "  -D, --ispell-dictionary=3DDICTIONARY\tUse DICTIONARY to look up w=
ords.\n"
+	     "  -s, --stop-list=3DFILE\t\t\tIgnored; for compatibility.\n"
+	     "  -v, --verbose\t\t\t\tPrint words not literally found.\n"
+	     "  -x, --print-stems\t\t\tIgnored; for compatibility.\n\n"
 	     "Please use Info to read more (type `info spell').\n", stderr);
       exit (EXIT_SUCCESS);
     }
@@ -625,6 +636,11 @@
     if (dup2 (the_pipe->cerr, STDERR_FILENO) !=3D STDERR_FILENO)
       error (EXIT_FAILURE, errno, "error duping to stderr");
=20
+  if (idict !=3D NULL)
+    if (execl (ispell_prog, "ispell", "-a", "-d", idict, NULL)
+	< 0)
+      error (EXIT_FAILURE, errno, "error executing %s", ispell_prog);
+
   if (dictionary !=3D NULL)
     if (execl (ispell_prog, "ispell", "-a", "-p", dictionary, NULL)
 	< 0)
diff -Naur spell-1.0/spell.info spell-1.0.fixed/spell.info
--- spell-1.0/spell.info	2005-02-28 15:02:15.000000000 +0100
+++ spell-1.0.fixed/spell.info	2003-12-04 11:54:53.000000000 +0100
@@ -1,4 +1,4 @@
-This is spell.info, produced by makeinfo version 4.2 from ./spell.texi.
+This is spell.info, produced by makeinfo version 4.6 from ./spell.texi.
=20
    This file documents GNU Spell, a clone of Unix `spell'.
=20
@@ -38,9 +38,9 @@
 Overview
 ********
=20
-   GNU Spell is a spell checking program which prints each misspelled
-word on a line of its own.  It is designed as a clone of the standard
-Unix `spell' program, and implemented as a wrapper for Ispell.  Spell
+GNU Spell is a spell checking program which prints each misspelled word
+on a line of its own.  It is designed as a clone of the standard Unix
+`spell' program, and implemented as a wrapper for Ispell.  Spell
 accepts as its arguments a list of files to read from.  Within that
 list, the magical file name `-' causes Spell to read from standard
 input.  In addition, when called with no file name arguments, Spell
@@ -57,7 +57,7 @@
 Invoking Spell
 **************
=20
-   The format for running GNU Spell is:
+The format for running GNU Spell is:
=20
      spell [OPTION]... [FILE]...
=20
@@ -75,7 +75,7 @@
=20
 `--dictionary=3DFILE'
 `-d FILE'
-     Use the named dictionary.
+     Use the named file as a personal dictionary.
=20
 `--help'
 `-h'
@@ -95,6 +95,10 @@
      Print the line number of each misspelled word along with the word
      itself.
=20
+`--ispell-dictionary=3DDICTIONARY'
+`-D DICTIONARY'
+     Use the named Ispell dictionary.
+
 `--print-file-name'
 `-o'
      Print the file name which contained the misspelled words on each
@@ -113,14 +117,15 @@
 `-x'
      Ignored; for compatibility.
=20
+
 =1F
 File: spell.info,  Node: Example,  Next: Problems,  Prev: Invoking Spell, =
 Up: Top
=20
 Example
 *******
=20
-   Using GNU Spell is quite simple.  Here's an example, which you can
-try when in the directory of Spell's source code.
+Using GNU Spell is quite simple.  Here's an example, which you can try
+when in the directory of Spell's source code.
=20
      $ spell --print-file-name --number sample
      sample:1: Tihs
@@ -149,7 +154,7 @@
 Problems
 ********
=20
-   If you find a bug in GNU Spell, or have any questions, comments, or
+If you find a bug in GNU Spell, or have any questions, comments, or
 suggestions about it, please send electronic mail to
 `bug-gnu-utils@prep.ai.mit.edu'.  When sending bug reports, include the
 version number, which you can find by running `spell --version'.  Also
@@ -184,9 +189,9 @@
 Tag Table:
 Node: Top=7F847
 Node: Overview=7F1221
-Node: Invoking Spell=7F2021
-Node: Example=7F3225
-Node: Problems=7F4027
-Node: Concept Index=7F4680
+Node: Invoking Spell=7F2018
+Node: Example=7F3327
+Node: Problems=7F4126
+Node: Concept Index=7F4776
 =1F
 End Tag Table
diff -Naur spell-1.0/spell.texi spell-1.0.fixed/spell.texi
--- spell-1.0/spell.texi	1996-04-10 06:20:14.000000000 +0200
+++ spell-1.0.fixed/spell.texi	2003-12-04 11:37:12.000000000 +0100
@@ -125,7 +125,7 @@
=20
 @item --dictionary=3D@var{file}
 @itemx -d @var{file}
-Use the named dictionary.
+Use the named file as a personal dictionary.
=20
 @item --help
 @itemx -h
@@ -144,6 +144,10 @@
 Print the line number of each misspelled word along with the word
 itself.
=20
+@item --ispell-dictionary=3D@var{dictionary}
+@itemx -D @var{dictionary}
+Use the named Ispell dictionary.
+
 @item --print-file-name
 @itemx -o
 Print the file name which contained the misspelled words on each line


---------------------------------------
Received: (at 297308-done) by bugs.debian.org; 30 Sep 2005 13:06:35 +0000
>From mvela@irb.hr Fri Sep 30 06:06:35 2005
Return-path: <mvela@irb.hr>
Received: from mail.irb.hr [161.53.22.8] (UNKNOWN)
	by spohr.debian.org with esmtp (Exim 3.36 1 (Debian))
	id 1ELKaw-00089K-00; Fri, 30 Sep 2005 06:06:35 -0700
Received: from diziet.irb.hr (diziet.irb.hr [161.53.22.31])
	by mail.irb.hr (8.13.3/8.13.3/Debian-6) with ESMTP id j8UD6VRw011432
	for <297308-done@bugs.debian.org>; Fri, 30 Sep 2005 15:06:31 +0200
Received: from diziet.irb.hr (localhost [127.0.0.1])
	by diziet.irb.hr (8.13.5/8.13.5/Debian-1) with ESMTP id j8UD6W8H010345
	for <297308-done@bugs.debian.org>; Fri, 30 Sep 2005 15:06:32 +0200
Received: (from mvela@localhost)
	by diziet.irb.hr (8.13.5/8.13.5/Submit) id j8UD6WXl010343;
	Fri, 30 Sep 2005 15:06:32 +0200
X-Authentication-Warning: diziet.irb.hr: mvela set sender to mvela@irb.hr using -f
From: Matej Vela <vela@debian.org>
To: 297308-done@bugs.debian.org
Subject: Bug#297308: fixed in spell 1.0-14
Date: Fri, 30 Sep 2005 15:06:32 +0200
Message-ID: <87mzluiu1z.fsf@diziet.irb.hr>
User-Agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Scanned-By: MIMEDefang 2.51 on 161.53.22.8
Delivered-To: 297308-done@bugs.debian.org
X-Spam-Checker-Version: SpamAssassin 2.60-bugs.debian.org_2005_01_02 
	(1.212-2003-09-23-exp) on spohr.debian.org
X-Spam-Level: 
X-Spam-Status: No, hits=-6.0 required=4.0 tests=BAYES_00,HAS_BUG_NUMBER 
	autolearn=no version=2.60-bugs.debian.org_2005_01_02
X-CrossAssassin-Score: 2

Source: spell
Source-Version: 1.0-14

This was fixed in 1.0-13, an intermediate release that was never uploaded:

  spell (1.0-13) unstable; urgency=low

    * Applied patch from Kaare Hviid which fixes the following
      Thanks to Kaare for the patch.
      * fix getopt_long for proper parsing in libc6,
      * Applied a bug fix from Luca Saiu:
        http://mail.gnu.org/archive/html/bug-gnu-utils/2003-07/msg00345.html,
      * added --ispell-dictionary to specify an ispell dictionary.
    * do not set link to /usr/doc in postinst (fixes lintian bug)
    * ignore SIGCHLD.
      Rewrote part of the select-logic in parent to simplify parsing
      of spell's output.
      This removes the dependency on ibritisch since the error output
      is parsed correctly. (closes: #158514)

   -- David Frey <david@eos.lugs.ch>  Sun, 11 Jan 2004 17:45:08 +0100



Reply to: