Control: tags 670860 + pending
Dear maintainer, I've prepared an NMU for spell (versioned as 1.0-24.2) and uploaded it to DELAYED/5. Please feel free to tell me if I should delay it longer. Regards. -- .''`. https://info.comodo.priv.at -- Debian Developer https://www.debian.org : :' : OpenPGP fingerprint D1E1 316E 93A7 60A8 104D 85FA BB3A 6801 8649 AA06 `. `' Member VIBE!AT & SPI Inc. -- Supporter Free Software Foundation Europe `-
diff -Nru spell-1.0/debian/changelog spell-1.0/debian/changelog --- spell-1.0/debian/changelog 2022-01-15 03:00:29.000000000 +0100 +++ spell-1.0/debian/changelog 2022-01-15 02:58:06.000000000 +0100 @@ -1,3 +1,13 @@ +spell (1.0-24.2) unstable; urgency=medium + + * Non-maintainer upload. + * Fix "[PATCH] spell: Helping to update to packaging format 3.0": + Convert to source format 3.0 from 1.0+dpatch. + Based on a patch by Jari Aalto from 2012. + (Closes: #670860) + + -- gregor herrmann <[email protected]> Sat, 15 Jan 2022 02:58:06 +0100 + spell (1.0-24.1) unstable; urgency=medium * Non-maintainer upload. diff -Nru spell-1.0/debian/control spell-1.0/debian/control --- spell-1.0/debian/control 2022-01-15 03:00:29.000000000 +0100 +++ spell-1.0/debian/control 2022-01-15 02:47:33.000000000 +0100 @@ -2,7 +2,7 @@ Section: text Priority: optional Maintainer: Giacomo Catenazzi <[email protected]> -Build-Depends: debhelper (>= 7), dpatch, texinfo +Build-Depends: debhelper (>= 7), texinfo Standards-Version: 3.8.2 Homepage: http://directory.fsf.org/project/spell/ diff -Nru spell-1.0/debian/patches/00list spell-1.0/debian/patches/00list --- spell-1.0/debian/patches/00list 2022-01-15 03:00:29.000000000 +0100 +++ spell-1.0/debian/patches/00list 1970-01-01 01:00:00.000000000 +0100 @@ -1 +0,0 @@ -01-conglomeration.dpatch diff -Nru spell-1.0/debian/patches/01-conglomeration.dpatch spell-1.0/debian/patches/01-conglomeration.dpatch --- spell-1.0/debian/patches/01-conglomeration.dpatch 2022-01-15 03:00:29.000000000 +0100 +++ spell-1.0/debian/patches/01-conglomeration.dpatch 1970-01-01 01:00:00.000000000 +0100 @@ -1,599 +0,0 @@ -#!/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; - } - diff -Nru spell-1.0/debian/patches/20-conglomeration.patch spell-1.0/debian/patches/20-conglomeration.patch --- spell-1.0/debian/patches/20-conglomeration.patch 1970-01-01 01:00:00.000000000 +0100 +++ spell-1.0/debian/patches/20-conglomeration.patch 2022-01-15 02:49:56.000000000 +0100 @@ -0,0 +1,596 @@ +From: Unknown +Subject: Needs to be broken out (FIXME). + + +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; + } + diff -Nru spell-1.0/debian/patches/series spell-1.0/debian/patches/series --- spell-1.0/debian/patches/series 1970-01-01 01:00:00.000000000 +0100 +++ spell-1.0/debian/patches/series 2022-01-15 02:49:56.000000000 +0100 @@ -0,0 +1 @@ +20-conglomeration.patch diff -Nru spell-1.0/debian/rules spell-1.0/debian/rules --- spell-1.0/debian/rules 2022-01-15 03:00:29.000000000 +0100 +++ spell-1.0/debian/rules 2022-01-15 02:49:18.000000000 +0100 @@ -1,7 +1,5 @@ #!/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) @@ -11,7 +9,7 @@ CROSS= endif -clean: unpatch +clean: dh_testdir dh_testroot rm -f build-stamp @@ -20,7 +18,7 @@ dh_clean -config.status: configure patch-stamp +config.status: configure dh_testdir CFLAGS="$(CFLAGS)" ./configure $(CROSS) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info diff -Nru spell-1.0/debian/source/format spell-1.0/debian/source/format --- spell-1.0/debian/source/format 1970-01-01 01:00:00.000000000 +0100 +++ spell-1.0/debian/source/format 2022-01-15 02:49:56.000000000 +0100 @@ -0,0 +1 @@ +3.0 (quilt) diff -Nru spell-1.0/spell.c spell-1.0/spell.c --- spell-1.0/spell.c 2022-01-15 03:00:29.000000000 +0100 +++ spell-1.0/spell.c 1996-04-10 06:41:09.000000000 +0200 @@ -279,23 +279,9 @@ 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; @@ -320,13 +306,13 @@ if (file->str[file->len - 1] != '/') str_add_char (file, '/'); - str_add_str (file, nstr_to_str (program)); + str_add_str (file, nstr_to_str ("ispell")); if (stat (str_to_nstr (file), &stat_buf) != -1) return xstrdup (str_to_nstr (file)); if (pos >= path_len) - return NULL; + error (EXIT_FAILURE, 0, "unable to locate Ispell"); pos++; }
signature.asc
Description: Digital Signature

