Changeset 119


Ignore:
Timestamp:
10/13/02 16:16:49 (21 years ago)
Author:
piso
Message:

findMatchingTags(): support relative directories in tag path; avoid NPE if
directory is null.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/j/TagCommands.java

    r116 r119  
    33 *
    44 * Copyright (C) 1998-2002 Peter Graves
    5  * $Id: TagCommands.java,v 1.3 2002-10-12 13:07:49 piso Exp $
     5 * $Id: TagCommands.java,v 1.4 2002-10-13 16:16:49 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    138138            // No exact match in the current buffer. Look in the current
    139139            // directory.
    140             list =
    141                 TagCommands.findMatchingTagsInDirectory(expression,
    142                     buffer.getCurrentDirectory(), mode);
     140            final File currentDirectory = buffer.getCurrentDirectory();
     141            list = findMatchingTagsInDirectory(expression, currentDirectory,
     142                                              mode);
    143143            if (list == null) {
    144144                // Look at all the directories in the buffer's tag path.
     
    147147                    for (int i = 0; i < dirs.size(); i++) {
    148148                        String dir = (String) dirs.get(i);
    149                         File directory = File.getInstance(dir);
    150                         if (directory.equals(buffer.getCurrentDirectory()))
     149                        File directory =
     150                            File.getInstance(currentDirectory, dir);
     151                        if (directory == null)
     152                            continue;
     153                        if (directory.equals(currentDirectory))
    151154                            continue;
    152155                        List tagsInDir =
    153                             TagCommands.findMatchingTagsInDirectory(expression,
    154                                 directory, mode);
     156                            findMatchingTagsInDirectory(expression, directory,
     157                                                        mode);
    155158                        if (tagsInDir != null) {
    156159                            if (list == null)
Note: See TracChangeset for help on using the changeset viewer.