2003-03-29
2003-03-29 21:23:11 by Martin Stjernholm <mast@lysator.liu.se>
-
a275d219e86bf8918c3fc8b4963b467b429d5796
(20 lines)
(+16/-4)
[
Show
| Annotate
]
Branch: 7.9
Parse out the line number correctly from the dmalloc location in
find_program_name.
Rev: src/program.c:1.491
2:
|| This file is part of Pike. For copyright information see COPYRIGHT.
|| Pike is distributed under GPL, LGPL and MPL. See the file COPYING
|| for more information.
- || $Id: program.c,v 1.490 2003/03/27 02:20:24 mast Exp $
+ || $Id: program.c,v 1.491 2003/03/29 21:23:11 mast Exp $
*/
#include "global.h"
- RCSID("$Id: program.c,v 1.490 2003/03/27 02:20:24 mast Exp $");
+ RCSID("$Id: program.c,v 1.491 2003/03/29 21:23:11 mast Exp $");
#include "program.h"
#include "object.h"
#include "dynamic_buffer.h"
1504: Inside #if defined(PIKE_DEBUG) and #if defined(DEBUG_MALLOC)
#ifdef DEBUG_MALLOC
{
char *tmp=dmalloc_find_name(p);
+ if (tmp) {
+ char *p = strchr (tmp, ':');
+ if (p) {
+ char *pp;
+ while ((pp = strchr (p + 1, ':'))) p = pp;
+ *line = atoi (p + 1);
+ return make_shared_binary_string (tmp, p - tmp);
+ }
+ else {
*line=0;
- if(tmp) return make_shared_string(tmp);
+ return make_shared_string(tmp);
}
-
+ }
+ }
#endif
return get_program_line(p, line);