summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXDebug.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXDebug.c')
-rw-r--r--macosx/tkMacOSXDebug.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/macosx/tkMacOSXDebug.c b/macosx/tkMacOSXDebug.c
index 02c51a9..a0e1fe0 100644
--- a/macosx/tkMacOSXDebug.c
+++ b/macosx/tkMacOSXDebug.c
@@ -5,7 +5,7 @@
* regions, etc...
*
* Copyright 2001, Apple Computer, Inc.
- * Copyright (c) 2006 Daniel A. Steffen <das@users.sourceforge.net>
+ * Copyright (c) 2006-2007 Daniel A. Steffen <das@users.sourceforge.net>
*
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
@@ -54,7 +54,7 @@
* software in accordance with the terms specified in this
* license.
*
- * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.2.2.9 2006/10/31 22:33:38 das Exp $
+ * RCS: @(#) $Id: tkMacOSXDebug.c,v 1.2.2.10 2007/03/07 23:48:13 das Exp $
*/
#include "tkMacOSXInt.h"
@@ -494,7 +494,11 @@ TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol)
if (!addr) {
const struct mach_header *mh = NULL;
uint32_t i, n = _dyld_image_count();
+ size_t module_len;
+ if (module && *module) {
+ module_len = strlen(module);
+ }
for (i = 0; i < n; i++) {
if (module && *module) {
/* Find image with given module name */
@@ -505,7 +509,7 @@ TkMacOSXGetNamedDebugSymbol(const char* module, const char* symbol)
continue;
}
name = strrchr(path, '/') + 1;
- if (strncmp(name, module, strlen(name)) != 0) {
+ if (strncmp(name, module, module_len) != 0) {
continue;
}
}