Hi Kevin,

Here's a patch to fix a segfault on 64-bit arches as reported in
http://bugs.debian.org/185142.  I'm not sure of the true root of the
problem, other than isspace seems to behave differently on 64-bit
arches, and this patch works around that.

--- aspell-0.50.3.orig/prog/aspell.cpp
+++ aspell-0.50.3/prog/aspell.cpp
@@ -392,12 +392,16 @@
 
 char * trim_wspace (char * str)
 {
+  if (strlen(str) <= 1)
+    return str;
+
   unsigned int last = strlen(str) - 1;
   while (isspace(str[0])) {
     ++str;
     --last;
   }
-  while (isspace(str[last])) {
+  while (last != 0 && isspace(str[last])) {
     str[last] = '\0';
     --last;
   }
-- 
I had no feelings about it.  It was aloof and licked itself too much.
Like my cat Mr. Trotsky.

Attachment: pgp00000.pgp
Description: PGP signature

_______________________________________________
Aspell-devel mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/aspell-devel

Reply via email to