DtMail attempts to detect whether the non-standard strcasestr() is
available, and defines it if it is not. Unfortunately, the detection
code is imperfect. Fortunately, we can make it a class method to avoid
collision even if it does exist.
I offer a choice of two patches here. The first patch removes Sun from
the detection code, allowing compilation on OpenSolaris, but retaining
the system strcasestr() on some systems. The second patch removes the
detection code entirely, always using the in-house implementation.
-mrt
>From cac51d2356ef67130bd972027bfb8a181a6af0d4 Mon Sep 17 00:00:00 2001
From: "Matthew R. Trower" <d...@blackshard.net>
Date: Tue, 19 Jun 2018 15:25:20 -0500
Subject: [PATCH] Resolve inconsistent strcasestr availability on Sun
---
cde/programs/dtmail/dtmail/FindDialog.C | 4 ++--
cde/programs/dtmail/dtmail/FindDialog.h | 5 +++++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/cde/programs/dtmail/dtmail/FindDialog.C b/cde/programs/dtmail/dtmail/FindDialog.C
index 1f489b5b..cef88a7d 100644
--- a/cde/programs/dtmail/dtmail/FindDialog.C
+++ b/cde/programs/dtmail/dtmail/FindDialog.C
@@ -729,13 +729,13 @@ FindDialog::compareMessage(DtMailMessageHandle handle)
return(found);
}
-#if !defined(CSRG_BASED) && !defined(__linux__) && !defined(sun)
+#if !defined(CSRG_BASED) && !defined(__linux__)
//
// See if string 'toFind' is anyware in string 'str'.
// A case-insensitive version of strstr().
//
static const char *
-strcasestr(const char *str, const char *toFind)
+FindDialog::strcasestr(const char *str, const char *toFind)
{
const char *result = NULL; // Default to not found.
diff --git a/cde/programs/dtmail/dtmail/FindDialog.h b/cde/programs/dtmail/dtmail/FindDialog.h
index b3dc141d..2b99d44b 100644
--- a/cde/programs/dtmail/dtmail/FindDialog.h
+++ b/cde/programs/dtmail/dtmail/FindDialog.h
@@ -102,6 +102,11 @@ private:
Boolean compareMessage(DtMailMessageHandle handle);
+ #if !defined(CSRG_BASED) && !defined(__linux__)
+ static const char * strcasestr(const char *str,
+ const char *toFind);
+ #endif
+
Boolean compareHeader(DtMailEnv & error,
DtMailValueSeq & seq,
const char * cmpToString);
--
2.16.2
>From a82b881410cb781367a243fc8b29d20eec43760b Mon Sep 17 00:00:00 2001
From: "Matthew R. Trower" <d...@blackshard.net>
Date: Tue, 19 Jun 2018 15:25:20 -0500
Subject: [PATCH] Always use custom strcasestr
---
cde/programs/dtmail/dtmail/FindDialog.C | 4 +---
cde/programs/dtmail/dtmail/FindDialog.h | 3 +++
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/cde/programs/dtmail/dtmail/FindDialog.C b/cde/programs/dtmail/dtmail/FindDialog.C
index 1f489b5b..f948b844 100644
--- a/cde/programs/dtmail/dtmail/FindDialog.C
+++ b/cde/programs/dtmail/dtmail/FindDialog.C
@@ -729,13 +729,12 @@ FindDialog::compareMessage(DtMailMessageHandle handle)
return(found);
}
-#if !defined(CSRG_BASED) && !defined(__linux__) && !defined(sun)
//
// See if string 'toFind' is anyware in string 'str'.
// A case-insensitive version of strstr().
//
static const char *
-strcasestr(const char *str, const char *toFind)
+FindDialog::strcasestr(const char *str, const char *toFind)
{
const char *result = NULL; // Default to not found.
@@ -764,7 +763,6 @@ strcasestr(const char *str, const char *toFind)
}
return(result);
}
-#endif
Boolean
FindDialog::compareHeader(DtMailEnv & error,
diff --git a/cde/programs/dtmail/dtmail/FindDialog.h b/cde/programs/dtmail/dtmail/FindDialog.h
index b3dc141d..c01706b0 100644
--- a/cde/programs/dtmail/dtmail/FindDialog.h
+++ b/cde/programs/dtmail/dtmail/FindDialog.h
@@ -102,6 +102,9 @@ private:
Boolean compareMessage(DtMailMessageHandle handle);
+ static const char * strcasestr(const char *str,
+ const char *toFind);
+
Boolean compareHeader(DtMailEnv & error,
DtMailValueSeq & seq,
const char * cmpToString);
--
2.16.2
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
cdesktopenv-devel mailing list
cdesktopenv-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cdesktopenv-devel