Index: parser.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/api/parser.inc,v
retrieving revision 1.24.2.15
diff -u -r1.24.2.15 parser.inc
--- parser.inc	23 Jan 2008 02:49:56 -0000	1.24.2.15
+++ parser.inc	27 Apr 2008 13:40:00 -0000
@@ -245,7 +245,9 @@
       // Find referenced functions.
       $function_call_matches = array();
       $docblock['function calls'] = array();
-      preg_match_all('!<span class="php-function-or-constant">([a-zA-Z0-9_]+)</span>\(!', substr($docblock['code'], strlen('<div class="php"><code><span class="php-keyword">function</span> <span class="php-function-or-constant">')), $function_call_matches, PREG_SET_ORDER);
+      preg_match_all('!<span class="php-function-or-constant">([a-zA-Z0-9_]+)</span>\(!', $docblock['code'], $function_call_matches, PREG_SET_ORDER);
+      // Remove the first match, that is always the function declaration itself
+      array_shift($function_call_matches);
       foreach ($function_call_matches as $function_call_match) {
         $docblock['function calls'][$function_call_match[1]] = $function_call_match[1];
       }
