delete upstreamed patches

This commit is contained in:
Caolan McNamara 2010-04-09 11:56:55 +00:00
parent d219b41a45
commit fedf41c51c
6 changed files with 0 additions and 482 deletions

View File

@ -1,78 +0,0 @@
diff -ru hunspell-1.2.7.orig/src/tools/hunspell.cxx hunspell-1.2.7/src/tools/hunspell.cxx
--- hunspell-1.2.7.orig/src/tools/hunspell.cxx 2008-08-15 11:06:33.000000000 +0100
+++ hunspell-1.2.7/src/tools/hunspell.cxx 2008-11-19 09:13:31.000000000 +0000
@@ -1468,9 +1468,21 @@
fprintf(stdout,gettext(HUNSPELL_PIPE_HEADING));
fflush(stdout);
} else if ((strcmp(argv[i],"-m")==0)) {
- filter_mode = ANALYZE;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: Make possible root/affix combinations that aren't in the dictionary.
+ hunspell: Analyze the words of the input text
+ */
+ if (filter_mode != PIPE)
+ filter_mode = ANALYZE;
} else if ((strcmp(argv[i],"-s")==0)) {
- filter_mode = STEM;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: Stop itself with a SIGTSTP signal after each line of input.
+ hunspell: Stem the words of the input text
+ */
+ if (filter_mode != PIPE)
+ filter_mode = STEM;
} else if ((strcmp(argv[i],"-t")==0)) {
format = FMT_LATEX;
} else if ((strcmp(argv[i],"-n")==0)) {
@@ -1480,15 +1492,45 @@
} else if ((strcmp(argv[i],"-l")==0)) {
filter_mode = BADWORD;
} else if ((strcmp(argv[i],"-w")==0)) {
- filter_mode = WORDFILTER;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: Specify additional characters that can be part of a word.
+ hunspell: Print mispelled words (= lines) from one word/line input
+ */
+ if (filter_mode != PIPE)
+ filter_mode = WORDFILTER;
} else if ((strcmp(argv[i],"-L")==0)) {
- filter_mode = BADLINE;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: Number of lines of context to be shown at the bottom of the screen
+ hunspell: Print lines with mispelled words
+ */
+ if (filter_mode != PIPE)
+ filter_mode = BADLINE;
} else if ((strcmp(argv[i],"-u")==0)) {
- filter_mode = AUTO0;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: None
+ hunspell: Show typical misspellings
+ */
+ if (filter_mode != PIPE)
+ filter_mode = AUTO0;
} else if ((strcmp(argv[i],"-U")==0)) {
- filter_mode = AUTO;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: None
+ hunspell: Automatic correction of typical misspellings to stdout
+ */
+ if (filter_mode != PIPE)
+ filter_mode = AUTO;
} else if ((strcmp(argv[i],"-u2")==0)) {
- filter_mode = AUTO2;
+ /*
+ if -a was used, don't override, i.e. keep ispell compatability
+ ispell: None
+ hunspell: Print typical misspellings in sed format
+ */
+ if (filter_mode != PIPE)
+ filter_mode = AUTO2;
} else if ((strcmp(argv[i],"-G")==0)) {
printgood = 1;
} else if ((strcmp(argv[i],"-1")==0)) {

View File

@ -1,115 +0,0 @@
diff -ru hunspell-1.2.8.orig/man/hunspell.1 hunspell-1.2.8/man/hunspell.1
--- hunspell-1.2.8.orig/man/hunspell.1 2008-06-12 09:50:43.000000000 +0100
+++ hunspell-1.2.8/man/hunspell.1 2009-05-01 09:05:15.000000000 +0100
@@ -309,9 +309,10 @@
.IP \fB\-p\ dict\fR
Set path of personal dictionary.
-Default dictionary depends from the locale settings.
-Without locale support, the default personal dictionary is
-the $HOME/.hunspell_default.
+The default dictionary depends on the locale settings. The
+following environment variables are searched: LC_ALL,
+LC_MESSAGES, and LANG. If none are set then the default personal
+dictionary is $HOME/.hunspell_default.
Setting
.I \-d
@@ -360,6 +361,11 @@
Equivalent to
.I \-p.
.SH FILES
+The default dictionary depends on the locale settings. The
+following environment variables are searched: LC_ALL,
+LC_MESSAGES, and LANG. If none are set then the following
+fallbacks are used:
+
.BI /usr/share/myspell/default.aff
Path of default affix file. See hunspell(4).
.PP
diff -ru hunspell-1.2.8.orig/src/tools/hunspell.cxx hunspell-1.2.8/src/tools/hunspell.cxx
--- hunspell-1.2.8.orig/src/tools/hunspell.cxx 2008-09-04 14:44:19.000000000 +0100
+++ hunspell-1.2.8/src/tools/hunspell.cxx 2009-05-01 09:15:33.000000000 +0100
@@ -168,7 +168,6 @@
int printgood = 0; // print only good words and lines
int showpath = 0; // show detected path of the dictionary
int checkurl = 0; // check URLs and mail addresses
-char * ui_lang = NULL; // locale for default dic_name
const char * ui_enc = NULL; // locale character encoding (default for I/O)
const char * io_enc = NULL; // I/O character encoding
@@ -1383,7 +1382,7 @@
#ifdef ENABLE_NLS
#ifdef HAVE_LOCALE_H
- ui_lang = setlocale(LC_ALL, "");
+ setlocale(LC_ALL, "");
textdomain("hunspell");
ui_enc = nl_langinfo(CODESET);
#endif
@@ -1557,13 +1556,26 @@
if (! dicname) {
if (! (dicname=getenv("DICTIONARY"))) {
- if ((dicname=ui_lang) || (dicname=getenv("LANG"))) {
- dicname = mystrdup(dicname);
- char * dot = strchr(dicname, '.');
- if (dot) *dot = '\0';
- char * at = strchr(dicname, '@');
- if (at) *at = '\0';
- } else {
+ /*
+ * Search in order of LC_ALL, LC_MESSAGES &
+ * LANG
+ */
+ const char *tests[] = { "LC_ALL", "LC_MESSAGES", "LANG" };
+ for (size_t i = 0; i < sizeof(tests) / sizeof(const char*); ++i) {
+ if ((dicname=getenv(tests[i])) && strcmp(dicname, "") != 0) {
+ dicname = mystrdup(dicname);
+ char * dot = strchr(dicname, '.');
+ if (dot) *dot = '\0';
+ char * at = strchr(dicname, '@');
+ if (at) *at = '\0';
+ break;
+ }
+ }
+
+ if ((strcmp(dicname, "C") == 0) || (strcmp(dicname, "POSIX") == 0))
+ dicname=mystrdup("en_US");
+
+ if (! dicname) {
dicname=mystrdup(DEFAULTDICNAME);
}
} else {
@@ -1577,6 +1589,12 @@
path = add(add(add(add(path, HOME), DIRSEP), USEROOODIR), PATHSEP);
path = add(path, OOODIR);
+ if (showpath) {
+ fprintf(stderr, gettext("SEARCH PATH:\n%s\n"), path);
+ fprintf(stderr, gettext("AVAILABLE DICTIONARIES (path is not mandatory for -d option):\n"));
+ search(path, NULL, NULL);
+ }
+
if (!privdicname) privdicname = mystrdup(getenv("WORDLIST"));
int diclen = strlen(dicname);
@@ -1586,9 +1604,6 @@
char * dic = search(path, dicname, ".dic");
if (aff && dic) {
if (showpath) {
- fprintf(stderr, gettext("SEARCH PATH:\n%s\n"), path);
- fprintf(stderr, gettext("AVAILABLE DICTIONARIES (path is not mandatory for -d option):\n"), path);
- search(path, NULL, NULL);
fprintf(stderr, gettext("LOADED DICTIONARY:\n%s\n%s\n"), aff, dic);
}
pMS[0] = new Hunspell(aff, dic, key);
@@ -1611,7 +1626,7 @@
} else if (dic) pMS[dmax-1]->add_dic(dic);
}
} else {
- fprintf(stderr,gettext("Can't open affix or dictionary files.\n"));
+ fprintf(stderr,gettext("Can't open affix or dictionary files for dictionary named \"%s\".\n"), dicname);
exit(1);
}

View File

@ -1,223 +0,0 @@
diff -ru hunspell-1.2.8.orig/src/hunspell/affixmgr.cxx hunspell-1.2.8/src/hunspell/affixmgr.cxx
--- hunspell-1.2.8.orig/src/hunspell/affixmgr.cxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/affixmgr.cxx 2009-06-24 15:30:35.000000000 +0100
@@ -1866,8 +1866,8 @@
if (wordnum < maxwordnum) {
rv = compound_check((st+i),strlen(st+i), wordnum+1,
numsyllable, maxwordnum, wnum + 1, words, 0, is_sug);
- if (rv && numcheckcpd && (scpd == 0 && cpdpat_check(word, i, rv_first, rv) ||
- scpd != 0 && !cpdpat_check(word, i, rv_first, rv))) rv = NULL;
+ if (rv && numcheckcpd && ((scpd == 0 && cpdpat_check(word, i, rv_first, rv)) ||
+ (scpd != 0 && !cpdpat_check(word, i, rv_first, rv)))) rv = NULL;
} else {
rv=NULL;
}
@@ -3234,7 +3234,7 @@
}
// return the value of suffix
-const int AffixMgr::have_contclass()
+int AffixMgr::have_contclass()
{
return havecontclass;
}
@@ -4276,7 +4276,7 @@
if (strip[i] == cond[j]) in = 1;
} while ((j < (condl - 1)) && (cond[j] != ']'));
if (j == (condl - 1) && (cond[j] != ']')) {
- HUNSPELL_WARNING(stderr, "error: line %d: missing ] in condition:\n%s\n", linenum);
+ HUNSPELL_WARNING(stderr, "error: line %d: missing ] in condition:\n%s\n", linenum, cond);
return 0;
}
if ((!neg && !in) || (neg && in)) {
@@ -4304,7 +4304,7 @@
if (strip[i] == cond[j]) in = 1;
} while ((j > 0) && (cond[j] != '['));
if ((j == 0) && (cond[j] != '[')) {
- HUNSPELL_WARNING(stderr, "error: error: %d: missing ] in condition:\n%s\n", linenum);
+ HUNSPELL_WARNING(stderr, "error: line: %d: missing ] in condition:\n%s\n", linenum, cond);
return 0;
}
neg = (cond[j+1] == '^') ? 1 : 0;
diff -ru hunspell-1.2.8.orig/src/hunspell/csutil.cxx hunspell-1.2.8/src/hunspell/csutil.cxx
--- hunspell-1.2.8.orig/src/hunspell/csutil.cxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/csutil.cxx 2009-06-24 15:30:35.000000000 +0100
@@ -5313,7 +5313,7 @@
if (utf_tbl) return 0;
utf_tbl = (unicode_info2 *) malloc(CONTSIZE * sizeof(unicode_info2));
if (utf_tbl) {
- int j;
+ size_t j;
for (j = 0; j < CONTSIZE; j++) {
utf_tbl[j].cletter = 0;
utf_tbl[j].clower = (unsigned short) j;
diff -ru hunspell-1.2.8.orig/src/hunspell/csutil.hxx hunspell-1.2.8/src/hunspell/csutil.hxx
--- hunspell-1.2.8.orig/src/hunspell/csutil.hxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/csutil.hxx 2009-06-24 15:30:32.000000000 +0100
@@ -46,10 +46,10 @@
// hash entry macros
#define HENTRY_DATA(h) (h->var ? ((h->var & H_OPT_ALIASM) ? \
- get_stored_pointer(&(h->word) + h->blen + 1) : &(h->word) + h->blen + 1) : NULL)
+ get_stored_pointer(&(h->word[0]) + h->blen + 1) : &(h->word[0]) + h->blen + 1) : NULL)
// NULL-free version for warning-free OOo build
#define HENTRY_DATA2(h) (h->var ? ((h->var & H_OPT_ALIASM) ? \
- get_stored_pointer(&(h->word) + h->blen + 1) : &(h->word) + h->blen + 1) : "")
+ get_stored_pointer(&(h->word[0]) + h->blen + 1) : &(h->word[0]) + h->blen + 1) : "")
#define HENTRY_FIND(h,p) (HENTRY_DATA(h) ? strstr(HENTRY_DATA(h), p) : NULL)
#define w_char_eq(a,b) (((a).l == (b).l) && ((a).h == (b).h))
diff -ru hunspell-1.2.8.orig/src/hunspell/hashmgr.cxx hunspell-1.2.8/src/hunspell/hashmgr.cxx
--- hunspell-1.2.8.orig/src/hunspell/hashmgr.cxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/hashmgr.cxx 2009-06-24 15:30:35.000000000 +0100
@@ -118,7 +118,7 @@
dp = tableptr[hash(word)];
if (!dp) return NULL;
for ( ; dp != NULL; dp = dp->next) {
- if (strcmp(word,&(dp->word)) == 0) return dp;
+ if (strcmp(word, dp->word) == 0) return dp;
}
}
return NULL;
@@ -134,7 +134,7 @@
struct hentry* hp =
(struct hentry *) malloc (sizeof(struct hentry) + wbl + descl);
if (!hp) return 1;
- char * hpw = &(hp->word);
+ char * hpw = hp->word;
strcpy(hpw, word);
if (ignorechars != NULL) {
if (utf8) {
@@ -178,7 +178,7 @@
return 0;
}
while (dp->next != NULL) {
- if ((!dp->next_homonym) && (strcmp(&(hp->word), &(dp->word)) == 0)) {
+ if ((!dp->next_homonym) && (strcmp(hp->word, dp->word) == 0)) {
// remove hidden onlyupcase homonym
if (!onlyupcase) {
if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
@@ -196,7 +196,7 @@
}
dp=dp->next;
}
- if (strcmp(&(hp->word), &(dp->word)) == 0) {
+ if (strcmp(hp->word, dp->word) == 0) {
// remove hidden onlyupcase homonym
if (!onlyupcase) {
if ((dp->astr) && TESTAFF(dp->astr, ONLYUPCASEFLAG, dp->alen)) {
diff -ru hunspell-1.2.8.orig/src/hunspell/htypes.hxx hunspell-1.2.8/src/hunspell/htypes.hxx
--- hunspell-1.2.8.orig/src/hunspell/htypes.hxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/htypes.hxx 2009-06-24 15:14:23.000000000 +0100
@@ -12,7 +12,7 @@
#define H_OPT_PHON (1 << 2)
// see also csutil.hxx
-#define HENTRY_WORD(h) &(h->word)
+#define HENTRY_WORD(h) (h->word)
// approx. number of user defined words
#define USERWORD 1000
@@ -26,7 +26,7 @@
struct hentry * next; // next word with same hash code
struct hentry * next_homonym; // next homonym word (with same hash code)
char var; // variable fields (only for special pronounciation yet)
- char word; // variable-length word (8-bit or UTF-8 encoding)
+ char word[1]; // variable-length word (8-bit or UTF-8 encoding)
};
#endif
diff -ru hunspell-1.2.8.orig/src/hunspell/hunspell.cxx hunspell-1.2.8/src/hunspell/hunspell.cxx
--- hunspell-1.2.8.orig/src/hunspell/hunspell.cxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/hunspell.cxx 2009-06-24 15:30:35.000000000 +0100
@@ -496,7 +496,6 @@
if (wordbreak) {
char * s;
char r;
- int corr = 0;
wl = strlen(cw);
int numbreak = pAMgr ? pAMgr->get_numbreak() : 0;
// check boundary patterns (^begin and end$)
@@ -515,7 +514,6 @@
}
// other patterns
for (int j = 0; j < numbreak; j++) {
- int result = 0;
int plen = strlen(wordbreak[j]);
s=(char *) strstr(cw, wordbreak[j]);
if (s && (s > cw) && (s < cw + wl - plen)) {
@@ -617,7 +615,7 @@
return NULL;
}
if (root) {
- *root = mystrdup(&(he->word));
+ *root = mystrdup(he->word);
if (*root && complexprefixes) {
if (utf8) reverseword_utf(*root); else reverseword(*root);
}
@@ -636,7 +634,7 @@
// end of LANG speficic region
if (he) {
if (root) {
- *root = mystrdup(&(he->word));
+ *root = mystrdup(he->word);
if (*root && complexprefixes) {
if (utf8) reverseword_utf(*root); else reverseword(*root);
}
diff -ru hunspell-1.2.8.orig/src/hunspell/Makefile.am hunspell-1.2.8/src/hunspell/Makefile.am
--- hunspell-1.2.8.orig/src/hunspell/Makefile.am 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/Makefile.am 2009-06-24 15:14:23.000000000 +0100
@@ -3,7 +3,7 @@
lib_LTLIBRARIES = libhunspell-1.2.la
libhunspell_1_2_includedir = $(includedir)/hunspell
libhunspell_1_2_la_SOURCES=affentry.cxx affixmgr.cxx csutil.cxx \
- dictmgr.cxx hashmgr.cxx hunspell.cxx utf_info.cxx \
+ dictmgr.cxx hashmgr.cxx hunspell.cxx \
suggestmgr.cxx license.myspell license.hunspell \
phonet.cxx filemgr.cxx hunzip.cxx replist.cxx
@@ -12,4 +12,6 @@
suggestmgr.hxx baseaffix.hxx hashmgr.hxx langnum.hxx \
phonet.hxx filemgr.hxx hunzip.hxx w_char.hxx replist.hxx
+libhunspell_1_2_la_DEPENDENCIES=utf_info.cxx
+
EXTRA_DIST=hunspell.dsp makefile.mk README
diff -ru hunspell-1.2.8.orig/src/hunspell/replist.cxx hunspell-1.2.8/src/hunspell/replist.cxx
--- hunspell-1.2.8.orig/src/hunspell/replist.cxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/replist.cxx 2009-06-24 15:30:35.000000000 +0100
@@ -79,7 +79,7 @@
int stl = 0;
int change = 0;
// for (int i = 0; i < pos; i++) fprintf(stderr, "%d. %s\n", i, dat[i]->pattern);
- for (int i = 0; i < strlen(word); i++) {
+ for (size_t i = 0; i < strlen(word); i++) {
int n = near(word + i);
int l = match(word + i, n);
if (l) {
diff -ru hunspell-1.2.8.orig/src/hunspell/suggestmgr.cxx hunspell-1.2.8/src/hunspell/suggestmgr.cxx
--- hunspell-1.2.8.orig/src/hunspell/suggestmgr.cxx 2009-06-24 15:00:32.000000000 +0100
+++ hunspell-1.2.8/src/hunspell/suggestmgr.cxx 2009-06-24 15:33:17.000000000 +0100
@@ -1924,8 +1924,8 @@
for (j = 0; j <= n; j++) c[j] = 0;
for (i = 1; i <= m; i++) {
for (j = 1; j <= n; j++) {
- if ((utf8) && (*((short *) su+i-1) == *((short *)su2+j-1))
- || (!utf8) && ((*(s+i-1)) == (*(s2+j-1)))) {
+ if ( ((utf8) && (*((short *) su+i-1) == *((short *)su2+j-1)))
+ || ((!utf8) && ((*(s+i-1)) == (*(s2+j-1))))) {
c[i*(n+1) + j] = c[(i-1)*(n+1) + j-1]+1;
b[i*(n+1) + j] = LCS_UPLEFT;
} else if (c[(i-1)*(n+1) + j] >= c[i*(n+1) + j-1]) {
diff -ru hunspell-1.2.8.orig/src/hunspell/affixmgr.hxx hunspell-1.2.8/src/hunspell/affixmgr.hxx
--- hunspell-1.2.8.orig/src/hunspell/affixmgr.hxx 2010-01-05 11:21:06.000000000 +0000
+++ hunspell-1.2.8/src/hunspell/affixmgr.hxx 2008-10-30 20:28:59.000000000 +0000
@@ -192,7 +192,7 @@
const char * get_suffix();
const char * get_derived();
const char * get_version();
- const int have_contclass();
+ int have_contclass();
int get_utf8();
int get_complexprefixes();
char * get_suffixed(char );

View File

@ -1,13 +0,0 @@
--- hunspell-1.2.8.orig/tests/test.sh 2009-07-23 19:19:57.000000000 +0100
+++ hunspell-1.2.8/tests/test.sh 2009-07-23 19:20:45.000000000 +0100
@@ -33,8 +33,8 @@
shopt -s expand_aliases
-alias hunspell='../src/tools/hunspell'
-alias analyze='../src/tools/analyze'
+alias hunspell='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la ../src/tools/hunspell'
+alias analyze='../libtool --mode=execute -dlopen ../src/hunspell/.libs/libhunspell*.la ../src/tools/analyze'
if [ "$VALGRIND" != "" ]; then
rm -f $TEMPDIR/test.pid*

View File

@ -1,28 +0,0 @@
diff -ru hunspell-1.2.8.orig/src/tools/hunspell.cxx hunspell-1.2.8/src/tools/hunspell.cxx
--- hunspell-1.2.8.orig/src/tools/hunspell.cxx 2009-12-08 13:54:20.000000000 +0000
+++ hunspell-1.2.8/src/tools/hunspell.cxx 2009-12-08 14:00:09.000000000 +0000
@@ -1016,7 +1016,6 @@
i->next = dicwords;
dicwords = i;
// save
- strcpy(buf,HOME);
if (HOME) strcpy(buf,HOME); else {
fprintf(stderr, gettext("error - missing HOME variable\n"));
break;
@@ -1147,7 +1146,6 @@
}
// save
- strcpy(buf,HOME);
if (HOME) strcpy(buf,HOME); else {
fprintf(stderr, gettext("error - missing HOME variable\n"));
continue;
@@ -1541,7 +1539,7 @@
path = add(path, PATHSEP); // <- check path in root directory
if (getenv("DICPATH")) path = add(add(path, getenv("DICPATH")), PATHSEP);
path = add(add(path, LIBDIR), PATHSEP);
- path = add(add(add(add(path, HOME), DIRSEP), USEROOODIR), PATHSEP);
+ if (HOME) path = add(add(add(add(path, HOME), DIRSEP), USEROOODIR), PATHSEP);
path = add(path, OOODIR);
if (showpath) {

View File

@ -1,25 +0,0 @@
diff -ru hunspell-1.2.8.orig/src/hunspell/suggestmgr.cxx hunspell-1.2.8/src/hunspell/suggestmgr.cxx
--- hunspell-1.2.8.orig/src/hunspell/suggestmgr.cxx 2010-01-18 09:25:59.000000000 +0000
+++ hunspell-1.2.8/src/hunspell/suggestmgr.cxx 2010-01-18 09:34:58.000000000 +0000
@@ -1742,11 +1742,10 @@
if (ns < 2) break;
}
} else {
- char t[MAXSWUTF8L];
- l1 = strlen(s1);
l2 = strlen(s2);
if (l2 == 0) return 0;
- strcpy(t, s2);
+ l1 = strlen(s1);
+ char *t = mystrdup(s2);
if (opt & NGRAM_LOWERING) mkallsmall(t, csconv);
for (int j = 1; j <= n; j++) {
ns = 0;
@@ -1759,6 +1758,7 @@
nscore = nscore + ns;
if (ns < 2) break;
}
+ free(t);
}
ns = 0;