all repos — fluxbox @ a98bbe8e03233ce3388bf72b7ae19823dbc9fc09

custom fork of the fluxbox windowmanager

temp fix for strcasestr
fluxgen fluxgen
commit

a98bbe8e03233ce3388bf72b7ae19823dbc9fc09

parent

c6752ce211b140aa0817b1716db073dd05891cbf

1 files changed, 19 insertions(+), 2 deletions(-)

jump to
M src/FbTk/XmbFontImp.ccsrc/FbTk/XmbFontImp.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: XmbFontImp.cc,v 1.1 2002/11/26 16:01:28 fluxgen Exp $ +// $Id: XmbFontImp.cc,v 1.2 2002/11/26 20:04:15 fluxgen Exp $ #include "XmbFontImp.hh"

@@ -44,6 +44,23 @@ using namespace std;

namespace { +#ifndef HAVE_STRCASESTR +// +// Tries to find a string in another and +// ignoring the case of the characters +// Returns 0 on success else pointer to str. +const char *strcasestr(const char *str, const char *ptn) { + const char *s2, *p2; + for( ; *str; str++) { + for(s2=str, p2=ptn; ; s2++,p2++) { + if (!*p2) return str; // check if we reached the end of ptn, if so, return str + if (toupper(*s2) != toupper(*p2)) break; // check if the chars match(ignoring case) + } + } + return 0; +} +#endif //HAVE_STRCASESTR + const char *getFontSize(const char *pattern, int *size) { const char *p; const char *p2=0;

@@ -80,7 +97,7 @@ va_start(va, bufsiz);

buf[bufsiz-1] = 0; buf[bufsiz-2] = '*'; while((v = va_arg(va, char *)) != 0) { - p = strcasestr(pattern, v); + p = ::strcasestr(pattern, v); if (p) { std::strncpy(buf, p+1, bufsiz-2); p2 = strchr(buf, '-');