Loading ...
Sorry, an error occurred while loading the content.

Findfile patch

Expand Messages
  • Ralf Schandl
    Hello, here is a first patch for the findfile problems: 1) The chrash reported by Michael Geddes is (hopfully) fixed. He pointed me to the location of the
    Message 1 of 2 , Jul 28 4:00 AM
    • 0 Attachment
      Hello,

      here is a first patch for the findfile problems:

      1) The chrash reported by Michael Geddes is (hopfully) fixed. He pointed
      me to the location of the SIGSEG, as I couldn't reproduce it on Linux
      or AIX -- Strange. Thanks Michael!
      2) less allocs -> faster
      3) handles multiple already-visited-lists
      This list keeps the directories already searched.
      For the search for tags files we might change the filename during the
      search (tags,TAGS) and so we have to search the same directories
      again. But we should use the same already-visited-list for the first
      and third file if we have something like this:
      (tags,TAGS,./tags).

      Not handled here is the problem with:

      cd ..
      cd \tmp
      cd \\machine\share

      on WIN32.

      Perhapse we should handle '\tmp' and '\\machine\share' as absolute
      pathes. For the '..' I have no idea what is going on, it works on Linux
      and AIX.

      Next week I will get access to a WinNT box with some 'Visual Studio'
      stuff, so I can test it there. Is there some special thing I have to do
      to compile/debug vim there?

      Ralf

      --
      Ralf Schandl schandl@...
      IBM Deutschland Informationssysteme GmbH Tel: +49-69-6645-3208
      Lyoner Str. 13, 60528 Frankfurt Fax: +49-69-6645-3224

      Here comes the patch:

      *** misc2.c.orig Sun Jul 23 16:14:31 2000
      --- misc2.c Thu Jul 27 23:08:13 2000
      ***************
      *** 9,15 ****
      /*
      * misc2.c: Various functions.
      */
      -
      #include "vim.h"

      #ifdef HAVE_FCNTL_H
      --- 9,14 ----
      ***************
      *** 2962,2974 ****
      /* TODO: make some #ifdef for this */
      /*--------[ file searching ]-------------------------------------------------*/
      /*
      ! * File searching functions for 'path' and 'tags' options.
      * External visible functions:
      * vim_findfile_init() initialize search context
      * vim_findfile_free_visited() free list of visited files/dirs
      * vim_findfile() find a file in the search context
      *
      * All static functions and variables start with 'ff_'
      */
      typedef struct ff_stack
      {
      --- 2961,2988 ----
      /* TODO: make some #ifdef for this */
      /*--------[ file searching ]-------------------------------------------------*/
      /*
      ! * File searching functions for 'path', 'tags' and cdpath options.
      * External visible functions:
      * vim_findfile_init() initialize search context
      * vim_findfile_free_visited() free list of visited files/dirs
      * vim_findfile() find a file in the search context
      *
      * All static functions and variables start with 'ff_'
      + *
      + * Usage:
      + * You always have to call vim_findfile_init() to initialize your search
      + * context. Then you call vim_findfile() to do the search. vim_findfile() will
      + * return the name of the found file or NULL if nothing is found.
      + * To find all files that match the conditions call vim_findfile() again until
      + * it returns NULL.
      + *
      + * More informations can be found in the comment of the function
      + * vim_findfile_init().
      + *
      + */
      +
      + /*
      + * type for the directory search stack
      */
      typedef struct ff_stack
      {
      ***************
      *** 3001,3006 ****
      --- 3015,3023 ----
      int ff_star_star_empty;
      } ff_stack_t;

      + /*
      + * type for already visited directories or files.
      + */
      typedef struct ff_visited
      {
      struct ff_visited *ffv_next;
      ***************
      *** 3025,3030 ****
      --- 3042,3067 ----
      } ff_visited_t;

      /*
      + * We can several visited list during the search. This is expecially needed for
      + * the tags option. If tags is set to (replace + with *)
      + * "./++/tags,./++/TAGS,inc/++/tags"
      + * we need to search the directories for 'tags' and then search the same
      + * directories for 'TAGS' again, but we shouldn't search them if we use the
      + * third part of the tags option. So we need to store the old visited-list and
      + * must be able to restore it later.
      + */
      + typedef struct ff_visited_list_hdr
      + {
      + struct ff_visited_list_hdr *ffvl_next;
      +
      + /* the filename the attached visited list is for */
      + char_u *ffvl_filename;
      +
      + ff_visited_t *ffvl_visited_list;
      +
      + } ff_visited_list_hdr_t;
      +
      + /*
      * '**' can be expanded to several directory levels.
      * Set the default maximium depth.
      */
      ***************
      *** 3042,3060 ****
      * ff_level: how many levels of dirs to search downwards
      * ff_stopdirs_v: array of stop directories for upward search
      */
      ! static ff_stack_t *ff_stack_ptr = NULL;
      ! static ff_visited_t *ff_visited_list = NULL;
      ! static char_u *ff_file_to_search = NULL;
      ! static char_u *ff_start_dir = NULL;
      ! static char_u *ff_fix_path = NULL;
      #ifdef FEAT_PATH_EXTRA
      ! static char_u *ff_wc_path = NULL;
      ! static int ff_level;
      #endif
      #ifdef FEAT_PATH_EXTRA
      ! static char_u **ff_stopdirs_v = NULL;
      #endif
      ! static int ff_need_dir = FALSE;

      /* locally needed functions */
      #ifdef FEAT_PATH_EXTRA
      --- 3079,3099 ----
      * ff_level: how many levels of dirs to search downwards
      * ff_stopdirs_v: array of stop directories for upward search
      */
      ! static ff_stack_t *ff_stack_ptr = NULL;
      ! static ff_visited_list_hdr_t *ff_visited_list = NULL;
      ! static ff_visited_list_hdr_t *ff_visited_lists_list = NULL;
      ! static char_u *ff_file_to_search = NULL;
      ! static char_u *ff_start_dir = NULL;
      ! static char_u *ff_fix_path = NULL;
      #ifdef FEAT_PATH_EXTRA
      ! static char_u *ff_wc_path = NULL;
      ! static int ff_level;
      #endif
      #ifdef FEAT_PATH_EXTRA
      ! static char_u **ff_stopdirs_v = NULL;
      #endif
      ! static int ff_need_dir = FALSE;
      ! static char_u *ff_expand_buffer = NULL;

      /* locally needed functions */
      #ifdef FEAT_PATH_EXTRA
      ***************
      *** 3062,3067 ****
      --- 3101,3109 ----
      #else
      static int ff_check_visited __ARGS((ff_visited_t **, char_u *));
      #endif
      + static void ff_free_visited_list __ARGS((ff_visited_t *));
      + static ff_visited_list_hdr_t* ff_get_visited_list __ARGS((char_u*));
      +
      static void ff_push __ARGS((ff_stack_t *));
      static ff_stack_t * ff_pop __ARGS((void));
      static void ff_clear __ARGS((void));
      ***************
      *** 3137,3143 ****
      * Attention:
      * You call vim_findfile_init() and afterwards several times vim_findfile().
      * If someone else is calling vim_findfile_init() in between your search
      ! * context will be lost and you will search his file.
      *
      * If you run into such a problem, you need to change vim_findfile_init() to
      * return a pointer to a search context and you need a function to destroy this
      --- 3179,3185 ----
      * Attention:
      * You call vim_findfile_init() and afterwards several times vim_findfile().
      * If someone else is calling vim_findfile_init() in between your search
      ! * context will be lost and you will search for his file.
      *
      * If you run into such a problem, you need to change vim_findfile_init() to
      * return a pointer to a search context and you need a function to destroy this
      ***************
      *** 3157,3163 ****
      #ifdef FEAT_PATH_EXTRA
      char_u *wc_part;
      #endif
      - char_u *expand_buf;
      ff_stack_t *sptr;

      /* clear the stack */
      --- 3199,3204 ----
      ***************
      *** 3166,3171 ****
      --- 3207,3227 ----
      /* clear already visited files if wanted */
      if (free_visited == TRUE)
      vim_findfile_free_visited();
      + else
      + {
      + ff_visited_list = ff_get_visited_list(filename);
      + if(NULL == ff_visited_list)
      + return FAIL;
      + }
      +
      + if(ff_expand_buffer)
      + ff_expand_buffer[0] = 0;
      + else
      + {
      + ff_expand_buffer = (char_u*)alloc(MAXPATHL);
      + if(NULL == ff_expand_buffer)
      + return FAIL;
      + }


      /* Store information on starting dir now if path is relative.
      ***************
      *** 3185,3198 ****
      }
      else if (!mch_isFullName(path))
      {
      ! char_u *p = alloc(MAXPATHL);

      - if (p != NULL)
      - {
      - if (mch_dirname(p, MAXPATHL) == OK)
      - ff_start_dir = vim_strsave(p);
      - vim_free(p);
      - }
      if (ff_start_dir == NULL)
      return FAIL;
      }
      --- 3241,3249 ----
      }
      else if (!mch_isFullName(path))
      {
      ! if(OK == mch_dirname(ff_expand_buffer, MAXPATHL))
      ! ff_start_dir = vim_strsave(ff_expand_buffer);

      if (ff_start_dir == NULL)
      return FAIL;
      }
      ***************
      *** 3252,3261 ****
      }
      #endif

      - expand_buf = alloc(MAXPATHL);
      - if (expand_buf == NULL)
      - return FAIL;
      -
      #ifdef FEAT_PATH_EXTRA
      ff_level = level;

      --- 3303,3308 ----
      ***************
      *** 3284,3316 ****
      {
      if (STRNCMP(wc_part, "**", 2) == 0)
      {
      ! expand_buf[len++] = *wc_part++;
      ! expand_buf[len++] = *wc_part++;

      level = strtol((char *)wc_part, (char **)&errpt, 10);
      if (errpt != wc_part && level > 0 && level < 255)
      ! expand_buf[len++] = level;
      else if (errpt != wc_part && level == 0)
      /* restrict is 0 -> remove already added '**' */
      len -= 2;
      else
      ! expand_buf[len++] = FF_MAX_STAR_STAR_EXPAND;
      wc_part = errpt;
      if (*wc_part != PATHSEP && *wc_part != NUL)
      {
      EMSG2(_("Invalid path: '**[number]' must be at the end of the path or be followed by '%s'. See :help path."), PATHSEPSTR);
      - vim_free(expand_buf);
      return FAIL;
      }
      }
      else
      ! expand_buf[len++] = *wc_part++;
      }
      ! expand_buf[len] = NUL;
      ! ff_wc_path = vim_strsave(expand_buf);
      if (ff_wc_path == NULL)
      {
      - vim_free(expand_buf);
      return FAIL;
      }
      }
      --- 3331,3361 ----
      {
      if (STRNCMP(wc_part, "**", 2) == 0)
      {
      ! ff_expand_buffer[len++] = *wc_part++;
      ! ff_expand_buffer[len++] = *wc_part++;

      level = strtol((char *)wc_part, (char **)&errpt, 10);
      if (errpt != wc_part && level > 0 && level < 255)
      ! ff_expand_buffer[len++] = level;
      else if (errpt != wc_part && level == 0)
      /* restrict is 0 -> remove already added '**' */
      len -= 2;
      else
      ! ff_expand_buffer[len++] = FF_MAX_STAR_STAR_EXPAND;
      wc_part = errpt;
      if (*wc_part != PATHSEP && *wc_part != NUL)
      {
      EMSG2(_("Invalid path: '**[number]' must be at the end of the path or be followed by '%s'. See :help path."), PATHSEPSTR);
      return FAIL;
      }
      }
      else
      ! ff_expand_buffer[len++] = *wc_part++;
      }
      ! ff_expand_buffer[len] = NUL;
      ! ff_wc_path = vim_strsave(ff_expand_buffer);
      if (ff_wc_path == NULL)
      {
      return FAIL;
      }
      }
      ***************
      *** 3329,3347 ****
      }

      /* create an absolute path */
      ! STRCPY(expand_buf, ff_start_dir);
      ! add_pathsep(expand_buf);
      ! STRCAT(expand_buf, ff_fix_path);
      ! add_pathsep(expand_buf);

      ! sptr = ff_create_stack_element(expand_buf,
      #ifdef FEAT_PATH_EXTRA
      ff_wc_path,
      #endif
      level, 0);

      - vim_free(expand_buf);
      -
      if (sptr == NULL)
      return FAIL;

      --- 3374,3390 ----
      }

      /* create an absolute path */
      ! STRCPY(ff_expand_buffer, ff_start_dir);
      ! add_pathsep(ff_expand_buffer);
      ! STRCAT(ff_expand_buffer, ff_fix_path);
      ! add_pathsep(ff_expand_buffer);

      ! sptr = ff_create_stack_element(ff_expand_buffer,
      #ifdef FEAT_PATH_EXTRA
      ff_wc_path,
      #endif
      level, 0);

      if (sptr == NULL)
      return FAIL;

      ***************
      *** 3410,3420 ****
      int len;
      #endif
      int i;
      ! char_u *p, *buf;
      #ifdef FEAT_SEARCHPATH
      char_u *suf;
      #endif

      if ((file_path = alloc((int)MAXPATHL)) == NULL)
      return NULL;

      --- 3453,3479 ----
      int len;
      #endif
      int i;
      ! char_u *p;
      #ifdef FEAT_SEARCHPATH
      char_u *suf;
      #endif

      + /*
      + * If ff_file_to_search is NULL, no vim_findfile_init() was called, or its
      + * return code was not checked. Anyway, there is nothing to search for.
      + */
      + if(ff_file_to_search == NULL)
      + {
      + emsg_silent = 0;
      + msg_silent = 0;
      + EMSG(_("Internal error: vim_findfile called without vim_findfile_init"));
      + return NULL;
      + }
      +
      + /*
      + * filepath is used as buffer for various actions and as the storage to
      + * return a found filename.
      + */
      if ((file_path = alloc((int)MAXPATHL)) == NULL)
      return NULL;

      ***************
      *** 3460,3466 ****
      * first time (hence ctx->ff_filearray == NULL)
      */
      if (ctx->ff_filearray == NULL
      ! && ff_check_visited(&ff_visited_list, ctx->ff_fix_path
      #ifdef FEAT_PATH_EXTRA
      , ctx->ff_wc_path
      #endif
      --- 3519,3526 ----
      * first time (hence ctx->ff_filearray == NULL)
      */
      if (ctx->ff_filearray == NULL
      ! && ff_check_visited(&ff_visited_list->ffvl_visited_list,
      ! ctx->ff_fix_path
      #ifdef FEAT_PATH_EXTRA
      , ctx->ff_wc_path
      #endif
      ***************
      *** 3616,3622 ****
      if (mch_getperm(file_path) >= 0
      && (!ff_need_dir || mch_isdir(file_path))
      #ifndef FF_VERBOSE
      ! && (ff_check_visited(&ff_visited_list,
      file_path
      #ifdef FEAT_PATH_EXTRA
      , NULL
      --- 3676,3683 ----
      if (mch_getperm(file_path) >= 0
      && (!ff_need_dir || mch_isdir(file_path))
      #ifndef FF_VERBOSE
      ! && (ff_check_visited(
      ! &ff_visited_list->ffvl_visited_list,
      file_path
      #ifdef FEAT_PATH_EXTRA
      , NULL
      ***************
      *** 3626,3637 ****
      )
      {
      #ifdef FF_VERBOSE
      ! if (ff_check_visited(&ff_visited_list,
      ! file_path
      #ifdef FEAT_PATH_EXTRA
      ! , NULL
      #endif
      ! ) == FAIL)
      {
      if (p_verbose >= 5)
      {
      --- 3687,3699 ----
      )
      {
      #ifdef FF_VERBOSE
      ! if (ff_check_visited(
      ! &ff_visited_list->ffvl_visited_list,
      ! file_path
      #ifdef FEAT_PATH_EXTRA
      ! , NULL
      #endif
      ! ) == FAIL)
      {
      if (p_verbose >= 5)
      {
      ***************
      *** 3651,3667 ****
      ff_push(ctx);

      simplify_filename(file_path);
      ! buf = alloc(MAXPATHL);
      ! if (buf != NULL
      ! && mch_dirname(buf, MAXPATHL) == OK)
      {
      ! p = shorten_fname(file_path, buf);
      if (p != NULL)
      mch_memmove(file_path, p,
      STRLEN(p) + 1);
      }
      - vim_free(buf);
      -
      #ifdef FF_VERBOSE
      if (p_verbose >= 5)
      {
      --- 3713,3725 ----
      ff_push(ctx);

      simplify_filename(file_path);
      ! if (mch_dirname(ff_expand_buffer, MAXPATHL) == OK)
      {
      ! p = shorten_fname(file_path, ff_expand_buffer);
      if (p != NULL)
      mch_memmove(file_path, p,
      STRLEN(p) + 1);
      }
      #ifdef FF_VERBOSE
      if (p_verbose >= 5)
      {
      ***************
      *** 3781,3797 ****
      void
      vim_findfile_free_visited()
      {
      ff_visited_t *vp;

      ! while (ff_visited_list != NULL)
      {
      ! vp = ff_visited_list->ffv_next;
      ! vim_free(ff_visited_list);
      ! ff_visited_list = vp;
      }
      ! ff_visited_list = NULL;
      }


      /*
      * maintains the list of already visited files and dirs
      --- 3839,3974 ----
      void
      vim_findfile_free_visited()
      {
      + ff_visited_list_hdr_t *vp;
      +
      + while(NULL != ff_visited_lists_list)
      + {
      + vp = ff_visited_lists_list->ffvl_next;
      + ff_free_visited_list(ff_visited_lists_list->ffvl_visited_list);
      + vim_free(ff_visited_lists_list->ffvl_filename);
      + vim_free(ff_visited_lists_list);
      + ff_visited_lists_list = vp;
      + }
      + ff_visited_lists_list = NULL;
      + }
      +
      + static void
      + ff_free_visited_list(ff_visited_t *vl)
      + {
      ff_visited_t *vp;

      ! while (vl != NULL)
      ! {
      ! vp = vl->ffv_next;
      ! vim_free(vl);
      ! vl = vp;
      ! }
      ! vl = NULL;
      ! }
      !
      ! static ff_visited_list_hdr_t*
      ! ff_get_visited_list(filename)
      ! char_u *filename;
      ! {
      ! ff_visited_list_hdr_t *retptr = NULL;
      !
      ! /* check if a visited list for the given filename exists */
      ! if(NULL != ff_visited_lists_list)
      ! {
      ! retptr = ff_visited_lists_list;
      ! while(NULL != retptr)
      ! {
      ! if(0 == STRCMP(filename, retptr->ffvl_filename))
      ! {
      ! #ifdef FF_VERBOSE
      ! if (p_verbose >= 5)
      ! {
      ! /* always scroll up, don't overwrite */
      ! msg_scroll = TRUE;
      ! smsg((char_u *)"ff_get_visited_list: FOUND list for %s",
      ! filename);
      ! /* don't overwrite this either */
      ! msg_puts((char_u *)"\n");
      ! cmdline_row = msg_row;
      ! }
      ! #endif
      ! return retptr;
      ! }
      ! retptr = retptr->ffvl_next;
      ! }
      ! }
      !
      ! #ifdef FF_VERBOSE
      ! if (p_verbose >= 5)
      ! {
      ! /* always scroll up, don't overwrite */
      ! msg_scroll = TRUE;
      ! smsg((char_u *)"ff_get_visited_list: new list for %s",
      ! filename);
      ! /* don't overwrite this either */
      ! msg_puts((char_u *)"\n");
      ! cmdline_row = msg_row;
      ! }
      ! #endif
      !
      ! /*
      ! * if we reach this we didn't find a list and we have to allocate new list
      ! */
      ! retptr = (ff_visited_list_hdr_t*)alloc(sizeof(*retptr));
      ! if(NULL == retptr)
      ! return NULL;
      !
      ! retptr->ffvl_visited_list = NULL;
      ! retptr->ffvl_filename = vim_strsave(filename);
      ! if(NULL == retptr->ffvl_filename)
      {
      ! vim_free(retptr);
      ! return NULL;
      }
      ! retptr->ffvl_next = ff_visited_lists_list;
      ! ff_visited_lists_list = retptr;
      !
      ! return retptr;
      }

      + /*
      + * check if two wildcard pathes are equal. Returns TRUE or FALSE.
      + * They are equal if:
      + * - both pathes are NULL
      + * - they have the same length
      + * - char by char comparison is OK
      + * - the only differences are in the counters behind a '**', so
      + * '**\20' is equal to '**\24'
      + */
      + static int
      + ff_wc_equal(char_u *s1, char_u * s2)
      + {
      + int i;
      +
      + if(s1 == s2)
      + return TRUE;
      +
      + if(s1 == NULL || s2 == NULL)
      + return FALSE;
      +
      + if(STRLEN(s1) != STRLEN(s2))
      + return FAIL;
      +
      + for(i=0; s1[i] != NUL && s2[i] != NUL; i++)
      + {
      + if(s1[i] != s2[i])
      + {
      + if(i >= 2)
      + if(s1[i-1] == '*' && s1[i-2] == '*')
      + continue;
      + else
      + return FAIL;
      + else
      + return FAIL;
      + }
      + }
      + return TRUE;
      + }

      /*
      * maintains the list of already visited files and dirs
      ***************
      *** 3817,3836 ****
      ff_visited_t *vp;
      #ifdef UNIX
      struct stat st;
      - #else
      - char_u *expand_buf;
      - #endif
      -
      - #ifndef UNIX
      - expand_buf = alloc(MAXPATHL);
      - if (expand_buf == NULL)
      - return OK;
      #endif

      #if defined(UNIX)
      if (mch_stat((char *)fname, &st) < 0)
      #else
      ! if (mch_FullName(fname, expand_buf, MAXPATHL, TRUE) == FAIL)
      #endif
      return FAIL;

      --- 3994,4005 ----
      ff_visited_t *vp;
      #ifdef UNIX
      struct stat st;
      #endif

      #if defined(UNIX)
      if (mch_stat((char *)fname, &st) < 0)
      #else
      ! if (mch_FullName(fname, ff_expand_buffer, MAXPATHL, TRUE) == FAIL)
      #endif
      return FAIL;

      ***************
      *** 3841,3862 ****
      if (vp->ffv_st.st_dev == st.st_dev
      && vp->ffv_st.st_ino == st.st_ino)
      #else
      ! if (fnamecmp(vp->ffv_fname, expand_buf) == 0)
      #endif
      {
      #ifdef FEAT_PATH_EXTRA
      ! /* system independent comparisons:
      ! * p->ffv_wc_path == wc_path is true if both are NULL
      ! * The wildcard change in two ways during search:
      ! * 1) the count field behind a '**' is changed
      ! * 2) the length changes because '*' or '**' was expanded and
      ! * removed.
      ! * We are only intrested in length changes. ( For us '**24' is
      ! * equivalent to '**20'.)
      ! */
      ! if (vp->ffv_wc_path == wc_path
      ! || (wc_path != NULL
      ! && STRLEN(vp->ffv_wc_path) == STRLEN(wc_path)))
      #endif
      break;
      }
      --- 4010,4021 ----
      if (vp->ffv_st.st_dev == st.st_dev
      && vp->ffv_st.st_ino == st.st_ino)
      #else
      ! if (fnamecmp(vp->ffv_fname, ff_expand_buffer) == 0)
      #endif
      {
      #ifdef FEAT_PATH_EXTRA
      ! /* are the wildcard parts equal */
      ! if(TRUE == ff_wc_equal(vp->ffv_wc_path, wc_path))
      #endif
      break;
      }
      ***************
      *** 3865,3873 ****
      if (vp != NULL)
      {
      /* already visited */
      - #ifndef UNIX
      - vim_free(expand_buf);
      - #endif
      return FAIL;
      }

      --- 4024,4029 ----
      ***************
      *** 3878,3884 ****
      vp = (ff_visited_t *)alloc((unsigned)sizeof(ff_visited_t));
      #else
      vp = (ff_visited_t *)alloc((unsigned)(sizeof(ff_visited_t)
      ! + STRLEN(expand_buf)));
      #endif

      if (vp != NULL)
      --- 4034,4040 ----
      vp = (ff_visited_t *)alloc((unsigned)sizeof(ff_visited_t));
      #else
      vp = (ff_visited_t *)alloc((unsigned)(sizeof(ff_visited_t)
      ! + STRLEN(ff_expand_buffer)));
      #endif

      if (vp != NULL)
      ***************
      *** 3886,3892 ****
      #ifdef UNIX
      vp->ffv_st = st;
      #else
      ! STRCPY(vp->ffv_fname, expand_buf);
      #endif
      #ifdef FEAT_PATH_EXTRA
      if (wc_path != NULL)
      --- 4042,4048 ----
      #ifdef UNIX
      vp->ffv_st = st;
      #else
      ! STRCPY(vp->ffv_fname, ff_expand_buffer);
      #endif
      #ifdef FEAT_PATH_EXTRA
      if (wc_path != NULL)
      ***************
      *** 3899,3908 ****
      *visited_list = vp;
      }

      - #ifndef UNIX
      - vim_free(expand_buf);
      - #endif
      -
      return OK;
      }

      --- 4055,4060 ----
      ***************
      *** 4183,4188 ****
      --- 4335,4344 ----
      }

      if (mch_isFullName(file_to_find))
      + #if 0
      + ||
      + (file_to_find[0] == '.' && (file_to_find[1] == PATHSEP || file_to_find[1] == '.')))
      + #endif
      {
      /*
      * Absolute path, no need to use "path_option".
    Your message has been successfully submitted and would be delivered to recipients shortly.