[Bug 145502] Compile error on Solaris 8 - kdepimlibs/kmime/kmime_util.cpp uses strcasestr which doesn't exist
Volker Krause
vkrause at kde.org
Thu May 17 15:53:57 BST 2007
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=145502
vkrause kde org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |FIXED
------- Additional Comments From vkrause kde org 2007-05-17 16:53 -------
SVN commit 665647 by vkrause:
Build on systems without strcasestr().
The non-strcasestr code is not optimized at all and about 15x slower.
BUG: 145502
M +15 -14 CMakeLists.txt
M +2 -0 config-kmime.h.cmake
M +6 -0 kmime_util.cpp
--- trunk/KDE/kdepimlibs/kmime/CMakeLists.txt #665646:665647
@ -5,28 +5,29 @
)
include(CheckTimezone)
+check_function_exists(strcasestr HAVE_STRCASESTR)
configure_file (config-kmime.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config-kmime.h)
########### next target ###############
set(kmime_LIB_SRCS
- kmime_charfreq.cpp
- kmime_util.cpp
- kmime_mdn.cpp
- kmime_codecs.cpp
- kmime_codec_base64.cpp
- kmime_codec_uuencode.cpp
- kmime_codec_qp.cpp
- kmime_codec_identity.cpp
- kmime_parsers.cpp
- kmime_header_parsing.cpp
+ kmime_charfreq.cpp
+ kmime_util.cpp
+ kmime_mdn.cpp
+ kmime_codecs.cpp
+ kmime_codec_base64.cpp
+ kmime_codec_uuencode.cpp
+ kmime_codec_qp.cpp
+ kmime_codec_identity.cpp
+ kmime_parsers.cpp
+ kmime_header_parsing.cpp
kmime_content.cpp
kmime_contentindex.cpp
- kmime_headers.cpp
- kmime_message.cpp
- kmime_newsarticle.cpp
+ kmime_headers.cpp
+ kmime_message.cpp
+ kmime_newsarticle.cpp
kmime_dateformatter.cpp
- boolflags.cpp
+ boolflags.cpp
kautodeletehash.cpp )
kde4_automoc(${kmime_LIB_SRCS})
--- trunk/KDE/kdepimlibs/kmime/config-kmime.h.cmake #665646:665647
@ -4,3 +4,5 @
/* Define if you have a tm_gmtoff member in struct tm */
#cmakedefine HAVE_TM_GMTOFF 1
+/* Define if strcasestr is available */
+#cmakedefine HAVE_STRCASESTR 1
--- trunk/KDE/kdepimlibs/kmime/kmime_util.cpp #665646:665647
@ -38,6 +38,8 @
#include "kmime_util.h"
#include "kmime_header_parsing.h"
+#include "config-kmime.h"
+
using namespace KMime;
namespace KMime {
@ -350,11 +352,15 @
pos1 = 0;
} else {
n.prepend('\n');
+#ifdef HAVE_STRCASESTR
const char* p = strcasestr( src.constData(), n.constData() );
if ( !p )
pos1 = -1;
else
pos1 = p - src.constData();
+#else
+ pos1 = src.toLower().indexOf( n.toLower() );
+#endif
}
if ( pos1 > -1) { //there is a header with the given name
More information about the Kdepim-bugs
mailing list