Ilia Alshanetsky wrote:
> -     switch (count($parts)) {
> -             case 4:
> -                     $id = 'function.' . $parts[3];
> -                     $func_name = lookup_title($id);
> -                     break;
> -
> -             case 5:
> -                     if ($parts[3] == 'class') {
> -                             $id = 'class.' . $parts[4];
> -                             $func_name = str_replace('-', '_', $parts[4]);
> -                             $stag = "xref linkend=\"$id\"";
> -                             $etag = "xref";
> -                             break;
> -                     }
> -                     /* fall through */
> -
> -             default:
> -                     /* some weird node type we don't understand */
> -                     $id = $ref;
> -                     $func_name = 'Unknown ??';                      
> +     if (isset($parts[4]) && $parts[3] == 'class') {
> +             $id = 'class.' . $parts[4];
> +             $func_name = str_replace('-', '_', $parts[4]);
> +             $stag = "xref linkend=\"$id\"";
> +             $etag = "xref";
> +     } else if (isset($parts[3])) {
> +             $id = 'function.' . $parts[3];
> +             $func_name = lookup_title($id);
> +     } else {
> +             /* some weird node type we don't understand */
> +             $id = $ref;
> +             $func_name = 'Unknown ??';
>       }
 
This is overtuned, here's the patch.

Jakub Vrana
Index: livedoc_funcs.php
===================================================================
RCS file: /repository/livedocs/livedoc_funcs.php,v
retrieving revision 1.4
diff -u -r1.4 livedoc_funcs.php
--- livedoc_funcs.php   25 May 2004 20:15:03 -0000      1.4
+++ livedoc_funcs.php   26 May 2004 08:09:52 -0000
@@ -330,7 +330,7 @@
                $func_name = str_replace('-', '_', $parts[4]);
                $stag = "xref linkend=\"$id\"";
                $etag = "xref";
-       } else if (isset($parts[3])) {
+       } else if (isset($parts[3]) && !isset($parts[4])) {
                $id = 'function.' . $parts[3];
                $func_name = lookup_title($id);
        } else {

Reply via email to