--- spell-1.0.orig/spell.c +++ spell-1.0/spell.c @@ -279,9 +279,23 @@ by `str_make'), or find it in the `PATH' environmental variable, or exit with an error if it is not found. */ +static char * +find_file_in_path (char * program) ; + char * find_ispell () { + char * ret; + if (NULL != (ret = find_file_in_path("ispell"))) + return ret; + if (NULL != (ret = find_file_in_path("aspell"))) + return ret; + error (EXIT_FAILURE, 0, "unable to locate Ispell/Aspell"); +} + +static char * +find_file_in_path (char * program) +{ char *ispell = NULL; char *path = NULL; int path_len = 0; @@ -306,13 +320,13 @@ if (file->str[file->len - 1] != '/') str_add_char (file, '/'); - str_add_str (file, nstr_to_str ("ispell")); + str_add_str (file, nstr_to_str (program)); if (stat (str_to_nstr (file), &stat_buf) != -1) return xstrdup (str_to_nstr (file)); if (pos >= path_len) - error (EXIT_FAILURE, 0, "unable to locate Ispell"); + return NULL; pos++; } --- spell-1.0.orig/debian/rules +++ spell-1.0/debian/rules @@ -0,0 +1,66 @@ +#!/usr/bin/make -f + +include /usr/share/dpatch/dpatch.make + +DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) +DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) + +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc +else + CROSS= +endif + +clean: unpatch + dh_testdir + dh_testroot + rm -f build-stamp + + [ ! -f Makefile ] || $(MAKE) distclean + + dh_clean + +config.status: configure patch-stamp + dh_testdir + + CFLAGS="$(CFLAGS)" ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info + +build: build-stamp +build-stamp: config.status + dh_testdir + + $(MAKE) + + touch build-stamp + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + $(MAKE) prefix=$(CURDIR)/debian/spell/usr install + + mkdir -p debian/spell/usr/share + mv debian/spell/usr/info debian/spell/usr/share + +binary: binary-arch + +binary-arch: build install + dh_testdir + dh_testroot + dh_installchangelogs + dh_installdocs + dh_installman + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary-indep: + +.PHONY: clean build install binary binary-arch binary-indep --- spell-1.0.orig/debian/compat +++ spell-1.0/debian/compat @@ -0,0 +1 @@ +7 --- spell-1.0.orig/debian/watch +++ spell-1.0/debian/watch @@ -0,0 +1,2 @@ +version=3 +http://ftp.gnu.org/gnu/spell/spell-(.*)\.tar\.gz --- spell-1.0.orig/debian/control +++ spell-1.0/debian/control @@ -0,0 +1,19 @@ +Source: spell +Section: text +Priority: optional +Maintainer: Giacomo Catenazzi +Build-Depends: debhelper (>= 7), dpatch, texinfo +Standards-Version: 3.8.2 +Homepage: http://directory.fsf.org/project/spell/ + +Package: spell +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends}, ispell | aspell, + iamerican | ibritish | ispell-dictionary +Description: GNU Spell, a clone of Unix `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 assumes that it should process standard input. --- spell-1.0.orig/debian/changelog +++ spell-1.0/debian/changelog @@ -0,0 +1,189 @@ +spell (1.0-24) unstable; urgency=low + + * Support also aspell (Closes: #381511) + * Removing some format only changes in 01-conglomeration.dpatch + + -- Giacomo Catenazzi Wed, 12 Aug 2009 21:01:58 +0200 + +spell (1.0-23) unstable; urgency=low + + * Adopting the package (Closes: #540590) + * Added Homepage field in debian/control + * Added again debian/watch + + -- Giacomo Catenazzi Wed, 12 Aug 2009 13:28:25 +0200 + +spell (1.0-22) unstable; urgency=low + + * Updating package to standards version 3.8.2. + * Removing vcs fields. + * Orphaning package. + + -- Daniel Baumann Sun, 09 Aug 2009 01:09:08 +0200 + +spell (1.0-21) unstable; urgency=low + + * Removing watch file. + * Reverting config.guess and config.sub to upstream. + * Removing useless whitespaces in changelog file. + * Upgrading package to debhelper 7. + * Upgrading package to standards 3.8.0. + * Removing autotools-dev from build-depends, not needed. + * Adding vcs fields in control file. + * Rewriting copyright file in machine-interpretable format. + * Removing useless docs debhelper file. + * Updating dpatch list file. + * Reordering rules file. + + -- Daniel Baumann Sat, 8 Nov 2008 12:23:00 +0100 + +spell (1.0-20) unstable; urgency=low + + * Applying patch from Chris Lamb to update + 01-conglomeration.dpatch (Closes: #441748). + + -- Daniel Baumann Mon, 5 May 2008 07:06:00 +0100 + +spell (1.0-19) unstable; urgency=low + + * Bumped policy version. + * Don't hide make errors in clean target of rules. + + -- Daniel Baumann Sun, 23 Dec 2007 18:01:00 +0100 + +spell (1.0-18) unstable; urgency=low + + * Minor cleanups. + * Bumped package to debhelper 5. + + -- Daniel Baumann Tue, 1 May 2007 13:18:00 +0200 + +spell (1.0-17) unstable; urgency=low + + * New email address. + * Updated policy version. + * Using dpatch for upstream modifications now. + + -- Daniel Baumann Fri, 8 Sep 2006 20:53:00 +0200 + +spell (1.0-16) unstable; urgency=low + + * Applied patch to fix pin/pout misstake (Closes: #335235). + + -- Daniel Baumann Sat, 22 Oct 2005 21:17:00 +0200 + +spell (1.0-15) unstable; urgency=low + + * New maintainer (Closes: #330244). + * Redone debian/ using newer debhelper-templates. + * Added INFO-DIR-SECTION and INFO-DIR-SECTION to spell.texi/spell.info + * Added build-depends for missing texinfo. + * Added watch file. + + -- Daniel Baumann Mon, 3 Oct 2005 16:40:00 +0200 + +spell (1.0-14) unstable; urgency=low + + * Orphaning spell. + * Adding description of spell in manpage (Closes: Bug#208940) + + -- David Frey Mon, 26 Sep 2005 23:57:55 +0200 + +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 Sun, 11 Jan 2004 17:45:08 +0100 + +spell (1.0-12) unstable; urgency=low + + * recompile for unstable, + * linted the package, + * added depends on ibritish and ispell-dictionary (closes: #108351) + + -- David Frey Sun, 25 Aug 2002 17:26:48 +0200 + +spell (1.0-11) unstable; urgency=low + + * fixed priority. + + -- David Frey Sat, 10 Feb 2001 23:57:47 +0100 + +spell (1.0-10) unstable; urgency=low + + * recompile for woody. + + -- David Frey Sun, 7 Jan 2001 23:09:10 +0100 + +spell (1.0-9) unstable; urgency=low + + * made package FHS compliant. + + -- David Frey Sun, 10 Oct 1999 17:18:51 +0200 + +spell (1.0-8) unstable; urgency=low + + * recompile for potato. + * renamed changelog into changelog.Debian. + + -- David Frey Sat, 15 May 1999 21:18:13 +0200 + +spell (1.0-7) unstable; urgency=low + + * cleaned up manpage from template leftovers. + + -- David Frey Sat, 15 May 1999 21:18:01 +0200 + +spell (1.0-6) frozen unstable; urgency=medium + + * fixed Bug#22943: spell: Segmentation fault every time used + (Faulty pointer arithmetics in str.c) + + -- David Frey Sun, 7 Jun 1998 23:04:49 +0200 + +spell (1.0-5) unstable; urgency=low + + * changed maintainer address to official Debian address. + * fixed bugs reported by debian: old FSF address, md5sums starting with dot. + + -- David Frey Wed, 11 Feb 1998 00:17:31 +0100 + +spell (1.0-4) unstable; urgency=low + + * Close Bug#16479: 'spell: debian/rules assumes post{inst,rm} are + executable' by installing post{inst,rm} with install and not + copying it. + + -- David Frey Sat, 3 Jan 1998 21:57:25 +0100 + +spell (1.0-3) unstable; urgency=low + + * got rid of debstd call + * md5sum doesn't include DEBIAN anymore. + + -- David Frey Tue, 16 Dec 1997 20:24:43 +0100 + +spell (1.0-2) unstable; urgency=low + + * New maintainer + * cleaned up debmake stuff + + -- David Frey Mon, 3 Nov 1997 21:34:59 +0100 + +spell (1.0-1) unstable; urgency=low + + * Initial Release. + * Added a simple manpage by using the template provided by deb-make. + + -- Dominik Kubla Fri, 28 Feb 1997 14:54:43 +0100 --- spell-1.0.orig/debian/manpages +++ spell-1.0/debian/manpages @@ -0,0 +1 @@ +debian/manpage/* --- spell-1.0.orig/debian/copyright +++ spell-1.0/debian/copyright @@ -0,0 +1,42 @@ +Author: Thomas Morgan +Download: http://ftp.gnu.org/gnu/spell/ + +Files: * +Copyright: (C) 1996 Free Software Foundation, Inc. +License: GPL-2+ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + . + On Debian systems, the complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-2 file. + +Files: debian/* +Copyright: (C) 2005-2008 Daniel Baumann +License: GPL-2+ + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version 2 + of the License, or (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + . + On Debian systems, the complete text of the GNU General Public License + can be found in /usr/share/common-licenses/GPL-2 file. --- spell-1.0.orig/debian/patches/01-conglomeration.dpatch +++ spell-1.0/debian/patches/01-conglomeration.dpatch @@ -0,0 +1,599 @@ +#!/bin/sh /usr/share/dpatch/dpatch-run +## 01-conglomeration.dpatch +## +## DP: Needs to be broken out (FIXME). + +@DPATCH@ + +diff -Naur spell-1.0.orig/spell.c spell-1.0/spell.c +--- spell-1.0.orig/spell.c 1996-04-10 04:41:09.000000000 +0000 ++++ spell-1.0/spell.c 2006-09-08 18:49:47.000000000 +0000 +@@ -71,17 +71,17 @@ + struct pipe + { + /* File descriptors used by the parent process. */ +- int pin; /* Input channel. */ +- int pout; /* Output channel. */ +- int perr; /* Error channel (for reading). */ ++ int pin; /* Input channel. */ ++ int pout; /* Output channel. */ ++ int perr; /* Error channel (for reading). */ + + /* File descriptors used by the child process. */ +- int cin; /* Input channel. */ +- int cout; /* Output channel. */ +- int cerr; /* Error channel (for writing). */ ++ int cin; /* Input channel. */ ++ int cout; /* Output channel. */ ++ int cerr; /* Error channel (for writing). */ + +- fd_set error_set; /* Descriptor set used to check for +- errors (contains perr). */ ++ fd_set error_set; /* Descriptor set used to check for ++ errors (contains perr). */ + }; + typedef struct pipe pipe_t; + +@@ -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 = NULL; + +-/* Dictionary to use. Just use the default if NULL. */ ++/* Personal dictionary to use. Just use the default if NULL. */ + char *dictionary = NULL; + ++/* Ispell dictionary to use via ispell's -d argument */ ++char *idict = NULL; ++ + /* Display Ispell's version (--ispell-version, -I). */ + int show_ispell_version = 0; + +@@ -159,69 +163,75 @@ + int + main (int argc, char **argv) + { +- char opt = 0; /* Current option. */ +- int opt_error = 0; /* Whether an option error occurred. */ +- int show_help = 0; /* Display help (--help, -h). */ +- int show_version = 0; /* Display the version (--version, -V). */ +- pid_t pid = 0; /* Child's pid. */ +- pipe_t ispell_pipe; /* The descriptors for our pipe. */ ++ int opt = 0; /* Current option. */ ++ int opt_error = 0; /* Whether an option error occurred. */ ++ int show_help = 0; /* Display help (--help, -h). */ ++ int show_version = 0; /* Display the version (--version, -V). */ ++ pid_t pid = 0; /* Child's pid. */ ++ pipe_t ispell_pipe; /* The descriptors for our pipe. */ + + program_name = argv[0]; + + /* Option processing loop. */ + while (1) + { +- opt = getopt_long (argc, argv, "IVbdhilnosvx", long_options, +- (int *) 0); ++ opt = getopt_long (argc, argv, "IVbd:D:hi:lnos:vx", long_options, ++ (int *) 0); + + if (opt == EOF) +- break; ++ break; + + switch (opt) +- { +- case 'I': +- show_ispell_version = 1; +- break; +- case 'V': +- show_version = 1; +- break; +- case 'b': +- british = 1; +- break; +- case 'd': +- if (optarg != NULL) +- dictionary = xstrdup (optarg); +- else +- error (0, 0, "option argument not given"); +- break; +- case 'h': +- show_help = 1; +- break; +- case 'i': +- if (optarg != NULL) +- ispell_prog = xstrdup (optarg); +- else +- error (0, 0, "option argument not given"); +- break; +- case 'l': +- break; +- case 'n': +- number_lines = 1; +- break; +- case 'o': +- print_file_names = 1; +- break; +- case 's': +- break; +- case 'v': +- verbose = 1; +- break; +- case 'x': +- break; +- default: +- opt_error = 1; +- break; +- } ++ { ++ case 'I': ++ show_ispell_version = 1; ++ break; ++ case 'V': ++ show_version = 1; ++ break; ++ case 'b': ++ british = 1; ++ break; ++ case 'd': ++ if (optarg != NULL) ++ dictionary = xstrdup (optarg); ++ else ++ error (0, 0, "option argument not given to -d"); ++ break; ++ case 'h': ++ show_help = 1; ++ break; ++ case 'i': ++ if (optarg != NULL) ++ ispell_prog = xstrdup (optarg); ++ else ++ error (0, 0, "option argument not given to -i"); ++ break; ++ case 'l': ++ break; ++ case 'n': ++ number_lines = 1; ++ break; ++ case 'o': ++ print_file_names = 1; ++ break; ++ case 'D': ++ if (optarg !=NULL) ++ idict = xstrdup (optarg); ++ else ++ error (0, 0, "option argument not given to -D"); ++ break; ++ case 's': ++ break; ++ case 'v': ++ verbose = 1; ++ break; ++ case 'x': ++ break; ++ default: ++ opt_error = 1; ++ break; ++ } + } + + if (opt_error) +@@ -235,26 +245,27 @@ + error (0, 0, version); + + if (!show_help) +- exit (EXIT_SUCCESS); ++ exit (EXIT_SUCCESS); + } + + if (show_help) + { + 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=FILE\t\tUse FILE to look up words.\n" +- " -h, --help\t\t\tPrint a summary of the options.\n" +- " -i, --ispell=PROGRAM\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=FILE\t\tIgnored; for compatibility.\n" +- " -v, --verbose\t\t\tPrint words not literally found.\n" +- " -x, --print-stems\t\tIgnored; for compatibility.\n\n" +- "Please use Info to read more (type `info spell').\n", stderr); ++ " -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=FILE\t\t\tUse FILE to look up words.\n" ++ " -h, --help\t\t\t\tPrint a summary of the options.\n" ++ " -i, --ispell=PROGRAM\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=DICTIONARY\tUse DICTIONARY to look up words.\n" ++ " -s, --stop-list=FILE\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); + } + +@@ -378,42 +389,42 @@ + str = str_make (str); + + if (str_add_line_from_desc (str, ispell_pipe->pin) == ADD_LINE_EOF) +- exit (EXIT_SUCCESS); ++ exit (EXIT_SUCCESS); + + /* Ispell gives us a blank line when it's finished processing + the line we just gave it. */ + if (str->len == 1 && str->str[0] == '\n') +- return; ++ return; + + /* There was no problem with this word. */ + if (str->str[0] == '*' || str->str[0] == '+' +- || str->str[0] == '-') +- continue; ++ || str->str[0] == '-') ++ continue; + + /* The word appears to have been misspelled. */ + if (str->str[0] == '&' || str->str[0] == '#' +- || (str->str[0] == '?' && verbose)) +- { +- int pos; +- +- if (print_file_names) +- { +- printf ("%s:", file); +- if (!number_lines) +- putchar (' '); +- } +- if (number_lines) +- printf ("%d: ", line); +- +- for (pos = 2; str->str[pos] != ' '; pos++) +- putchar (str->str[pos]); +- putchar ('\n'); ++ || (str->str[0] == '?' && verbose)) ++ { ++ int pos; ++ ++ if (print_file_names) ++ { ++ printf ("%s:", file); ++ if (!number_lines) ++ putchar (' '); ++ } ++ if (number_lines) ++ printf ("%d: ", line); ++ ++ for (pos = 2; str->str[pos] != ' '; pos++) ++ putchar (str->str[pos]); ++ putchar ('\n'); + +- continue; +- } ++ continue; ++ } + + if (str->str[0] == '?' && !verbose) +- continue; ++ continue; + + error (0, 0, "unrecognized Ispell line `%s'", str_to_nstr (str)); + } +@@ -429,28 +440,29 @@ + { + struct timeval time_out; + str_t *str = str_make (0); ++ int ret; + +- time_out.tv_sec = time_out.tv_usec = 0; ++ time_out.tv_sec=0; time_out.tv_usec=0; + +- while (select (FD_SETSIZE, &(the_pipe->error_set), NULL, NULL, +- &time_out) == 1) +- { +- str = str_make (str); ++ if (select(FD_SETSIZE, &(the_pipe->error_set), NULL, NULL, ++ &time_out) == 1) ++ { ++ str = str_make (str); + +- if (str_add_line_from_desc (str, the_pipe->perr) == ADD_LINE_EOF) +- /* Ispell closed its stderr. */ +- error (EXIT_FAILURE, 0, "premature EOF from Ispell's stderr"); ++ if (str_add_line_from_desc (str, the_pipe->perr) == ADD_LINE_EOF) ++ /* Ispell closed its stderr. */ ++ error (EXIT_FAILURE, 0, "premature EOF from Ispell's stderr"); + +- /* Strip the crlf. */ +- str->len -= 2; ++ /* Strip the lf. */ ++ str->len -= 1; + str->str[str->len - 1] = 0; + + if (!memcmp (str->str, "Can't open ", strlen ("Can't open "))) +- error (EXIT_FAILURE, 0, "%s: cannot open", +- str->str + strlen ("Can't open ")); ++ error (EXIT_FAILURE, 0, "%s: cannot open", ++ str->str + strlen ("Can't open ")); + + fprintf (stderr, "%s: %s\n", ispell_prog, str->str); +- } ++ } + } + + /* Create *THE_PIPE, setting up the file descriptors and streams, and +@@ -465,7 +477,7 @@ + + if (signal (SIGPIPE, sig_pipe) == SIG_ERR) + error (EXIT_FAILURE, errno, "error creating SIGPIPE handler"); +- if (signal (SIGCHLD, sig_chld) == SIG_ERR) ++ if (signal (SIGCHLD, SIG_IGN) == SIG_ERR) + error (EXIT_FAILURE, errno, "error creating SIGCHLD handler"); + + if (pipe (ifd) < 0) +@@ -523,33 +535,68 @@ + close (the_pipe->cout); + close (the_pipe->cerr); + +- read_ispell_errors (the_pipe); +- +- /* This block parses Ispell's banner and grabs its version. It then +- prints it if the flag `--ispell-version' or `-I' was used. +- FIXME: check that the version is high enough that it is going to +- be able to interact with GNU Spell sucessfully. */ +- + { +- int pos = 0; +- str_t *ispell_version = str_make (0); ++ struct timeval time_out; ++ fd_set fdset; + str_t *str = str_make (0); ++ int ret=0; + +- if (str_add_line_from_desc (str, the_pipe->pin) == ADD_LINE_EOF) +- error (EXIT_FAILURE, 0, "premature EOF from Ispell's stdout"); +- +- for (; !isdigit (str->str[pos]) && pos <= str->len; pos++); +- for (; str->str[pos] != ' ' && pos <= str->len; pos++) +- str_add_char (ispell_version, str->str[pos]); ++ while (ret == 0) ++ { ++ FD_ZERO(&fdset); ++ FD_SET (the_pipe->perr, &fdset); ++ FD_SET (the_pipe->pin, &fdset); ++ time_out.tv_sec=1; time_out.tv_usec=0; + +- if (show_ispell_version) ++ ret=select(FD_SETSIZE, &fdset, NULL, NULL,&time_out); ++ if (ret > 0) + { +- printf ("%s: Ispell version %s\n", program_name, +- str_to_nstr (ispell_version)); +- exit (EXIT_SUCCESS); ++ if (FD_ISSET(the_pipe->perr, &fdset)) ++ { ++ str=str_make (str); ++ ++ if (str_add_line_from_desc (str, the_pipe->perr) == ADD_LINE_EOF) ++ /* Ispell closed its stderr. */ ++ error (EXIT_FAILURE, 0, "premature EOF from Ispell's stderr"); ++ ++ /* Strip the lf. */ ++ str->len -= 1; ++ str->str[str->len - 1] = 0; ++ ++ if (!memcmp (str->str, "Can't open ", strlen ("Can't open "))) ++ error (EXIT_FAILURE, 0, "%s: cannot open", ++ str->str + strlen ("Can't open ")); ++ fprintf (stderr, "%s: %s\n", ispell_prog, str->str); ++ } ++ ++ if (FD_ISSET(the_pipe->pin, &fdset)) ++ { ++ /* This block parses Ispell's banner and grabs its version. It then ++ prints it if the flag `--ispell-version' or `-I' was used. ++ FIXME: check that the version is high enough that it is going to ++ be able to interact with GNU Spell sucessfully. */ ++ ++ int pos = 0; ++ str_t *ispell_version = str_make (0); ++ str_t *str = str_make (0); ++ ++ if (str_add_line_from_desc (str, the_pipe->pin) == ADD_LINE_EOF) ++ error (EXIT_FAILURE, 0, "premature EOF from Ispell's stdout"); ++ ++ for (; !isdigit (str->str[pos]) && pos <= str->len; pos++); ++ for (; str->str[pos] != ' ' && pos <= str->len; pos++) ++ str_add_char (ispell_version, str->str[pos]); ++ ++ if (show_ispell_version) ++ { ++ printf ("%s: Ispell version %s\n", program_name, ++ str_to_nstr (ispell_version)); ++ exit (EXIT_SUCCESS); ++ } ++ } + } ++ } + } +- + file = xstrdup ("-"); + + if (argc == 1) +@@ -562,40 +609,40 @@ + file = argv[arg_index]; + + if (file[0] == '-' && file[1] == 0) +- { +- if (!read_stdin) +- { +- read_stdin = 1; +- stream = stdin; +- } +- } ++ { ++ if (!read_stdin) ++ { ++ read_stdin = 1; ++ stream = stdin; ++ } ++ } + else +- { +- struct stat stat_buf; ++ { ++ struct stat stat_buf; + +- if (stat (file, &stat_buf) == -1) +- { +- error (0, errno, "%s: stat error", file); +- arg_index++; +- continue; +- } +- if (S_ISDIR (stat_buf.st_mode)) +- { +- error (0, 0, "%s: is a directory", file); +- arg_index++; +- continue; +- } +- +- stream = fopen (file, "r"); +- if (!stream) +- { +- error (0, errno, "%s: open error", file); +- arg_error = 1; +- } +- } ++ if (stat (file, &stat_buf) == -1) ++ { ++ error (0, errno, "%s: stat error", file); ++ arg_index++; ++ continue; ++ } ++ if (S_ISDIR (stat_buf.st_mode)) ++ { ++ error (0, 0, "%s: is a directory", file); ++ arg_index++; ++ continue; ++ } ++ ++ stream = fopen (file, "r"); ++ if (!stream) ++ { ++ error (0, errno, "%s: open error", file); ++ arg_error = 1; ++ } ++ } + + if (!arg_error) +- read_file (the_pipe, stream, file); ++ read_file (the_pipe, stream, file); + + arg_index++; + } +@@ -625,14 +672,19 @@ + if (dup2 (the_pipe->cerr, STDERR_FILENO) != STDERR_FILENO) + error (EXIT_FAILURE, errno, "error duping to stderr"); + ++ if (idict != NULL) ++ if (execl (ispell_prog, "ispell", "-a", "-d", idict, NULL) ++ < 0) ++ error (EXIT_FAILURE, errno, "error executing %s", ispell_prog); ++ + if (dictionary != NULL) + if (execl (ispell_prog, "ispell", "-a", "-p", dictionary, NULL) +- < 0) ++ < 0) + error (EXIT_FAILURE, errno, "error executing %s", ispell_prog); + + if (british) + if (execl (ispell_prog, "ispell", "-a", "-d", "british", NULL) +- < 0) ++ < 0) + error (EXIT_FAILURE, errno, "error executing %s", ispell_prog); + + if (execl (ispell_prog, "ispell", "-a", NULL) < 0) +diff -Naur spell-1.0.orig/spell.texi spell-1.0/spell.texi +--- spell-1.0.orig/spell.texi 1996-04-10 04:20:14.000000000 +0000 ++++ spell-1.0/spell.texi 2006-09-08 18:49:47.000000000 +0000 +@@ -2,6 +2,10 @@ + @c %**start of header + @setfilename spell.info + @settitle GNU Spell ++@direntry ++* Spell: (spell). A clone of Unix `spell'. ++@end direntry ++@dircategory Spell Checker + @finalout + @setchapternewpage odd + @include version.texi +@@ -125,7 +129,7 @@ + + @item --dictionary=@var{file} + @itemx -d @var{file} +-Use the named dictionary. ++Use the named file as a personal dictionary. + + @item --help + @itemx -h +@@ -144,6 +148,10 @@ + Print the line number of each misspelled word along with the word + itself. + ++@item --ispell-dictionary=@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 +diff -Naur spell-1.0.orig/str.c spell-1.0/str.c +--- spell-1.0.orig/str.c 1996-04-07 08:05:02.000000000 +0000 ++++ spell-1.0/str.c 2006-09-08 18:49:47.000000000 +0000 +@@ -136,7 +136,7 @@ + + while (1) + { +- register char c = getc (stream); ++ register int c = getc (stream); + + if (c == EOF || ferror (stream)) + return ADD_LINE_EOF; +@@ -205,12 +205,13 @@ + char * + str_to_nstr (str_t * str) + { +- char *nstr = xmalloc (str->len + 1); ++ char *nstr = NULL; + int pos = 0; + + if (!str || !str->str) + return nstr; + ++ nstr = xmalloc (str->len + 1); + for (; pos < str->len; pos++) + { + if (!str->str[pos]) +@@ -222,7 +223,7 @@ + nstr[pos] = str->str[pos]; + } + +- nstr[pos + 1] = 0; ++ nstr[pos] = 0; + return nstr; + } + --- spell-1.0.orig/debian/patches/00list +++ spell-1.0/debian/patches/00list @@ -0,0 +1 @@ +01-conglomeration.dpatch --- spell-1.0.orig/debian/manpage/spell.1 +++ spell-1.0/debian/manpage/spell.1 @@ -0,0 +1,68 @@ +.TH SPELL 1 + +.SH NAME +spell \- GNU spell, a Unix spell emulator + +.SH SYNOPSIS +.B spell +.I "[options] files ..." + +.SH "DESCRIPTION" +This manual page documents briefly the +.BR spell +command. This manual page was written for the Debian GNU/Linux distribution (but may be used by others), because the original program does not have a manual page. Instead, it has documentation in the GNU Info format; see below. +.PP +.B spell +is a program that emulates the traditional Unix spell command by calling the Ispell utility. +.PP +It is a spell checking program which prints each misspelled word on a line of its own. + +.SH OPTIONS +The programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options are included below. For a complete description, see the Info files. +.TP +.B \-I, \-\-ispell-version +Print Ispell's version. +.TP +.B \-V, \-\-version +Print the version number. +.TP +.B \-b, \-\-british +Use the British dictionary. +.TP +.B \-d, \-\-dictionary=FILE +Use FILE to look up words. +.TP +.B \-h, \-\-help +Print a summary of the options. +.TP +.B \-i, \-\-ispell=PROGRAM +Calls PROGRAM as Ispell. +.TP +.B \-D, \-\-ispell-dictionary=DICTIONARY +Use the named DICTIONARY to look up words. +.TP +.B \-l, \-\-all-chains +Ignored; for compatibility. +.TP +.B \-n, \-\-number +Print line numbers before lines. +.TP +.B \-o, \-\-print-file-name +Print file names before lines. +.TP +.B \-s, \-\-stop-list=FILE +Ignored; for compatibility. +.TP +.B \-v, \-\-verbose +Print words not literally found. +.TP +.B \-x, \-\-print-stems +Ignored; for compatibility. + +.SH "SEE ALSO" +The programs are documented fully by +.IR "GNU Spell, a clone of Unix `spell'" , +available via the Info system. + +.SH AUTHOR +This manual page was written by Dominik Kubla , for the Debian GNU/Linux system.