/* Various processing of names.
Copyright (C) 1988, 1992, 1994, 1996, 1997, 1998, 1999, 2000, 2001,
- 2003 Free Software Foundation, Inc.
+ 2003, 2004 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
/* Given UNAME, set the corresponding UID and return 1, or else, return 0. */
int
-uname_to_uid (char *uname, uid_t *uidp)
+uname_to_uid (char const *uname, uid_t *uidp)
{
struct passwd *passwd;
/* Given GNAME, set the corresponding GID and return 1, or else, return 0. */
int
-gname_to_gid (char *gname, gid_t *gidp)
+gname_to_gid (char const *gname, gid_t *gidp)
{
struct group *group;
/* Set up to gather file names for tar. They can either come from a
file or were saved from decoding arguments. */
void
-name_init (int argc, char *const *argv)
+name_init (void)
{
name_buffer = xmalloc (NAME_FIELD_SIZE + 2);
name_buffer_length = NAME_FIELD_SIZE;
ERROR ((0, 0, _("%s: Required occurrence not found in archive"),
quotearg_colon (cursor->name)));
}
-
+
/* Don't bother freeing the name list; we're about to exit. */
namelist = 0;
nametail = &namelist;
size_t allocated_length = (name_length >= NAME_FIELD_SIZE
? name_length + NAME_FIELD_SIZE
: NAME_FIELD_SIZE);
- char *name_buffer = xmalloc (allocated_length + 1);
+ char *namebuf = xmalloc (allocated_length + 1);
/* FIXME: + 2 above? */
char *string;
size_t string_length;
int change_dir = name->change_dir;
name->dir_contents = buffer;
- strcpy (name_buffer, path);
- if (! ISSLASH (name_buffer[name_length - 1]))
+ strcpy (namebuf, path);
+ if (! ISSLASH (namebuf[name_length - 1]))
{
- name_buffer[name_length++] = '/';
- name_buffer[name_length] = '\0';
+ namebuf[name_length++] = '/';
+ namebuf[name_length] = '\0';
}
for (string = buffer; *string; string += string_length + 1)
}
while (allocated_length <= name_length + string_length);
- name_buffer = xrealloc (name_buffer, allocated_length + 1);
+ namebuf = xrealloc (namebuf, allocated_length + 1);
}
- strcpy (name_buffer + name_length, string + 1);
- add_hierarchy_to_namelist (addname (name_buffer, change_dir),
+ strcpy (namebuf + name_length, string + 1);
+ add_hierarchy_to_namelist (addname (namebuf, change_dir),
device);
}
}
- free (name_buffer);
+ free (namebuf);
}
}
\f
if (deref_stat (dereference_option, name->name, &statbuf) != 0)
{
- if (ignore_failed_read_option)
- stat_warn (name->name);
- else
- stat_error (name->name);
+ stat_diag (name->name);
continue;
}
if (S_ISDIR (statbuf.st_mode))
for (p = file_name + prefix_len; *p; )
{
- if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
+ if (p[0] == '.' && p[1] == '.' && (ISSLASH (p[2]) || !p[2]))
prefix_len = p + 2 - file_name;
do