| OLD | NEW |
| 1 #include "license.hunspell" | 1 #include "license.hunspell" |
| 2 #include "license.myspell" | 2 #include "license.myspell" |
| 3 | 3 |
| 4 #include <stdlib.h> | 4 #include <stdlib.h> |
| 5 #include <string.h> | 5 #include <string.h> |
| 6 #include <stdio.h> | 6 #include <stdio.h> |
| 7 | 7 |
| 8 #include "hunspell.hxx" | 8 #include "hunspell.hxx" |
| 9 #include "hunspell.h" | 9 #include "hunspell.h" |
| 10 #ifndef HUNSPELL_CHROME_CLIENT | 10 #ifndef HUNSPELL_CHROME_CLIENT |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 *p = '\0'; | 130 *p = '\0'; |
| 131 return 0; | 131 return 0; |
| 132 } | 132 } |
| 133 | 133 |
| 134 strncpy(dest, (char *) q, nl); | 134 strncpy(dest, (char *) q, nl); |
| 135 *(dest + nl) = '\0'; | 135 *(dest + nl) = '\0'; |
| 136 nl = strlen(dest); | 136 nl = strlen(dest); |
| 137 if (utf8) { | 137 if (utf8) { |
| 138 *nc = u8_u16(dest_utf, MAXWORDLEN, dest); | 138 *nc = u8_u16(dest_utf, MAXWORDLEN, dest); |
| 139 // don't check too long words | 139 // don't check too long words |
| 140 // TODO(rouslan): Remove the interim change below when this patch lands: | 140 if (*nc >= MAXWORDLEN) return 0; |
| 141 // http://sf.net/tracker/?func=detail&aid=3595024&group_id=143754&atid=756
395. | |
| 142 if (*nc >= MAXWORDLEN - 1) return 0; | |
| 143 if (*nc == -1) { // big Unicode character (non BMP area) | 141 if (*nc == -1) { // big Unicode character (non BMP area) |
| 144 *pcaptype = NOCAP; | 142 *pcaptype = NOCAP; |
| 145 return nl; | 143 return nl; |
| 146 } | 144 } |
| 147 *pcaptype = get_captype_utf8(dest_utf, *nc, langnum); | 145 *pcaptype = get_captype_utf8(dest_utf, *nc, langnum); |
| 148 } else { | 146 } else { |
| 149 *pcaptype = get_captype(dest, nl, csconv); | 147 *pcaptype = get_captype(dest, nl, csconv); |
| 150 *nc = nl; | 148 *nc = nl; |
| 151 } | 149 } |
| 152 return nl; | 150 return nl; |
| (...skipping 1896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2049 | 2047 |
| 2050 /* remove word from the run-time dictionary */ | 2048 /* remove word from the run-time dictionary */ |
| 2051 | 2049 |
| 2052 int Hunspell_remove(Hunhandle *pHunspell, const char * word) { | 2050 int Hunspell_remove(Hunhandle *pHunspell, const char * word) { |
| 2053 return ((Hunspell*)pHunspell)->remove(word); | 2051 return ((Hunspell*)pHunspell)->remove(word); |
| 2054 } | 2052 } |
| 2055 | 2053 |
| 2056 void Hunspell_free_list(Hunhandle *, char *** slst, int n) { | 2054 void Hunspell_free_list(Hunhandle *, char *** slst, int n) { |
| 2057 freelist(slst, n); | 2055 freelist(slst, n); |
| 2058 } | 2056 } |
| OLD | NEW |