$OpenBSD: patch-ccmain_pgedit_cpp,v 1.2 2009/08/24 07:12:40 ajacoutot Exp $

Fix crash -- cf. http://www.win.tue.nl/~aeb/linux/ocr/tesseract.html

--- ccmain/pgedit.cpp.orig	Wed Jun  3 00:54:27 2009
+++ ccmain/pgedit.cpp	Sun Aug 23 20:25:45 2009
@@ -753,6 +753,9 @@ void pgeditor_read_file(                   // of seria
 
                                  // ptr to last dot
   filename_extension = strrchr(name.string(), '.');
+  if (filename_extension == NULL)
+    filename_extension = "";     // prevent segfaults
+
   #ifdef __UNIX__
   /*    TEXTROW*                tessrows;
       TBLOB*                  tessblobs;
