/* Various processing of names.
- Copyright 1988, 1992, 1994, 1996-2001, 2003-2007, 2009, 2013 Free
- Software Foundation, Inc.
+ Copyright 1988, 1992, 1994, 1996-2001, 2003-2007, 2009, 2013-2014
+ Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
#include <hash.h>
#include <quotearg.h>
#include <wordsplit.h>
+#include <argp.h>
#include "common.h"
\f
ent->v.file.term = 0;
/* fall through */
case file_list_success:
+ if (unquote_option)
+ unquote_string (name_buffer);
if (handle_option (name_buffer) == 0)
{
name_list_adjust ();
case NELT_FMASK:
matching_flags = ep->v.matching_flags;
+ recursion_option = matching_flags & FNM_LEADING_DIR;
name_list_advance ();
continue;
case NELT_CHDIR:
if (change_dirs)
{
- copy_name (ep);
- if (chdir (name_buffer) < 0)
- chdir_fatal (name_buffer);
+ chdir_do (chdir_arg (xstrdup (ep->v.name)));
name_list_advance ();
break;
}
- /* fall trhough */
+ /* fall through */
case NELT_NAME:
copy_name (ep);
if (unquote_option)
namelist = merge_sort (namelist, num_names, compare_names);
num_names = 0;
- nametab = hash_initialize (0, 0,
- name_hash,
- name_compare, NULL);
+ nametab = hash_initialize (0, 0, name_hash, name_compare, NULL);
for (name = namelist; name; name = next_name)
{
next_name = name->next;
- name->caname = normalize_filename (name->name);
+ name->caname = normalize_filename (name->change_dir, name->name);
if (prev_name)
{
struct name *p = hash_lookup (nametab, name);