summaryrefslogtreecommitdiff
path: root/textproc/ispell/files/patch-ispell.c
diff options
context:
space:
mode:
authorMatthew N. Dodd <mdodd@FreeBSD.org>2003-02-22 20:14:57 +0000
committerMatthew N. Dodd <mdodd@FreeBSD.org>2003-02-22 20:14:57 +0000
commitfedb6e57676bd54f6ac8d1afba35cf3aab77e107 (patch)
tree29dc82ae60b657af36f62ab8cc77822d396dc108 /textproc/ispell/files/patch-ispell.c
parentUpdate to 1.0.20. (diff)
Provide a limited compatibility with the Unix spell command.
Approved by: jmz
Diffstat (limited to 'textproc/ispell/files/patch-ispell.c')
-rw-r--r--textproc/ispell/files/patch-ispell.c90
1 files changed, 90 insertions, 0 deletions
diff --git a/textproc/ispell/files/patch-ispell.c b/textproc/ispell/files/patch-ispell.c
new file mode 100644
index 000000000000..24dc68cb1712
--- /dev/null
+++ b/textproc/ispell/files/patch-ispell.c
@@ -0,0 +1,90 @@
+--- ispell.c.orig Wed Jul 25 17:51:46 2001
++++ ispell.c Sat Feb 22 14:24:29 2003
+@@ -209,6 +209,7 @@
+ #include <fcntl.h>
+ #endif /* NO_FCNTL_H */
+ #include <sys/stat.h>
++#include <libgen.h>
+
+ static void usage P ((void));
+ static void initckch P ((char * wchars));
+@@ -327,6 +328,7 @@
+ char ** versionp;
+ char * wchars = NULL;
+ char * preftype = NULL;
++ char * cmdname;
+ static char libdictname[sizeof DEFHASH];
+ static char outbuf[BUFSIZ];
+ int argno;
+@@ -334,6 +336,11 @@
+
+ Cmd = *argv;
+
++ cmdname = (char *)basename(argv[0]);
++ if (strncmp(cmdname, "spell", 5) == 0) {
++ uflag++;
++ }
++
+ Trynum = 0;
+
+ p = getenv ("DICTIONARY");
+@@ -792,6 +799,11 @@
+ LibDict = p + 1;
+ }
+ break;
++ case 'u':
++ if (arglen > 2)
++ usage ();
++ uflag++;
++ break;
+ case 'V': /* Display 8-bit characters as M-xxx */
+ if (arglen > 2)
+ usage ();
+@@ -827,7 +839,7 @@
+ argc--;
+ }
+
+- if (!argc && !lflag && !aflag && !eflag && !dumpflag)
++ if (!argc && !lflag && !aflag && !eflag && !dumpflag && !uflag)
+ {
+ if (argc != 0)
+ usage ();
+@@ -848,7 +860,7 @@
+ if (access (argv[argno], 4) >= 0)
+ break;
+ }
+- if (argno >= argc && !lflag && !aflag && !eflag && !dumpflag)
++ if (argno >= argc && !lflag && !aflag && !eflag && !dumpflag && !uflag)
+ {
+ (void) fprintf (stderr,
+ argc == 1 ? ISPELL_C_NO_FILE : ISPELL_C_NO_FILES);
+@@ -935,6 +947,29 @@
+ outfile = stdout;
+ checkfile ();
+ exit (0);
++ }
++
++ if (uflag)
++ {
++ lflag++;
++ if (!argc)
++ {
++ infile = setupdefmt(NULL);
++ outfile = stdout;
++ checkfile ();
++ exit (0);
++ }
++ else
++ {
++ while (argc--)
++ {
++ infile = setupdefmt (*argv++);
++ outfile = stdout;
++ checkfile ();
++ (void) fclose (infile);
++ }
++ exit (0);
++ }
+ }
+
+ terminit ();