(namelist_match): Remove third argument
(name_match): Change return type to bool
(name_scan): Remove second argument
name->matching_flags = matching_flags;
name->change_dir = change_dir;
name->dir_contents = NULL;
name->matching_flags = matching_flags;
name->change_dir = change_dir;
name->dir_contents = NULL;
*nametail = name;
nametail = &name->next;
*nametail = name;
nametail = &name->next;
/* Find a match for FILE_NAME (whose string length is LENGTH) in the name
list. */
static struct name *
/* Find a match for FILE_NAME (whose string length is LENGTH) in the name
list. */
static struct name *
-namelist_match (char const *file_name, size_t length, bool exact)
+namelist_match (char const *file_name, size_t length)
/* Return true if and only if name FILE_NAME (from an archive) matches any
name from the namelist. */
/* Return true if and only if name FILE_NAME (from an archive) matches any
name from the namelist. */
name_match (const char *file_name)
{
size_t length = strlen (file_name);
name_match (const char *file_name)
{
size_t length = strlen (file_name);
struct name *cursor = namelist;
if (!cursor)
struct name *cursor = namelist;
if (!cursor)
if (cursor->name[0] == 0)
{
chdir_do (cursor->change_dir);
namelist = 0;
nametail = &namelist;
if (cursor->name[0] == 0)
{
chdir_do (cursor->change_dir);
namelist = 0;
nametail = &namelist;
- cursor = namelist_match (file_name, length, false);
+ cursor = namelist_match (file_name, length);
if (cursor)
{
if (!(ISSLASH (file_name[cursor->length]) && recursion_option)
if (cursor)
{
if (!(ISSLASH (file_name[cursor->length]) && recursion_option)
{
name_gather (); /* read one more */
if (namelist->found_count)
{
name_gather (); /* read one more */
if (namelist->found_count)
}
strcpy (namebuf + name_length, string + 1);
np = addname (namebuf, change_dir);
}
strcpy (namebuf + name_length, string + 1);
np = addname (namebuf, change_dir);
add_hierarchy_to_namelist (np, device);
}
}
add_hierarchy_to_namelist (np, device);
}
}
1. It returns a pointer to the name it matched, and doesn't set FOUND
in structure. The caller will have to do that if it wants to.
2. If the namelist is empty, it returns null, unlike name_match, which
1. It returns a pointer to the name it matched, and doesn't set FOUND
in structure. The caller will have to do that if it wants to.
2. If the namelist is empty, it returns null, unlike name_match, which
- returns TRUE.
- 3. The second argument (EXACT) controls matching algorithm. If it
- is TRUE, the exact matching is used. However, regular expressions are
- always matched as such, no matter what the value of EXACT is. */
-name_scan (const char *file_name, bool exact)
+name_scan (const char *file_name)
{
size_t length = strlen (file_name);
while (1)
{
{
size_t length = strlen (file_name);
while (1)
{
- struct name *cursor = namelist_match (file_name, length, exact);
+ struct name *cursor = namelist_match (file_name, length);
if (cursor)
return cursor;
if (cursor)
return cursor;