Lines Matching defs:name

19  * 3. Neither the name of the University nor the names of its contributors
47 * routines to handle pattern matching, name modification (regular expression
48 * substitution and interactive renames), and destination name modification for
49 * copy (-rw). Both file name and link names are adjusted as required in these
310 * into arcn->name and arcn->name has not been modified.
321 if ((pt->pstr = strdup(arcn->name)) == NULL) {
414 * check for a file name match unless we have DIR_MTCH set in
424 if ((arcn->name[pt->plen] == '/') &&
425 (strncmp(pt->pstr, arcn->name, pt->plen) == 0))
427 } else if (fn_match(pt->pstr, arcn->name, &pt->pend) == 0)
567 * modify a selected file name. first attempt to apply replacement string
572 * interactively, we store that mapping (old name to user input name) so
573 * if we spot any file links to the old file name in the future, we will
588 if (rmleadslash && arcn->name[0] == '/') {
589 if (arcn->name[1] == '\0') {
590 arcn->name[0] = '.';
592 (void)memmove(arcn->name, &arcn->name[1],
593 strlen(arcn->name));
618 * Modifying a hard link name makes sense, as we know the file it
630 * justify though. We claim that the symlink name is only likely
637 * we have replacement strings, modify the name and the link
638 * name if any.
640 if ((res = rep_name(arcn->name, &(arcn->nlen), 1)) != 0)
664 * Prompt the user for a replacement file name. A "." keeps the old name,
666 * pax to stop processing and exit. Otherwise the file name input, replaces
679 * prompt user for the replacement name for a file, keep trying until
681 * on them with the same name (from updates etc). We print verbose info
688 tty_prnt("Input new name, or a \".\" to keep the old name, ");
694 tty_prnt("Try again, illegal file name: ..\n");
698 tty_prnt("Try again, file name too long\n");
705 * empty file name, skips this file. a "." leaves it alone
712 tty_prnt("Processing continues, name unchanged.\n");
717 * ok the name changed. We may run into links that point at this
721 tty_prnt("Processing continues, name changed to: %s\n", tmpname);
722 res = add_name(arcn->name, arcn->nlen, tmpname);
723 arcn->nlen = l_strncpy(arcn->name, tmpname, sizeof(arcn->name) - 1);
724 arcn->name[arcn->nlen] = '\0';
732 * fix up the file name and the link name (if any) so this file will land
735 * 0 if ok, -1 if failure (name too long)
741 if (fix_path(arcn->name, &(arcn->nlen), dest_dir, dir_len) < 0)
746 * if the name they point was moved (or will be moved). It is best to
762 * 0 if ok, -1 if the final name is too long
787 paxwarn(1, "File name %s/%s, too long", dir_name, start);
800 * splice in the destination directory name
812 * when we find one with a successful substitution, we modify the name
813 * as specified. if required, we print the results. if the resulting name
818 * name is the file name we are going to apply the regular expressions to
820 * nlen is the length of this name (and is modified to hold the length of
824 * 0 if substitution was successful, 1 if we are to skip the file (the name
829 rep_name(char *name, int *nlen, int prnt)
840 char buf1[PAXPATHLEN+1]; /* where we work on the name */
843 * copy the name into buf1, where we will work on it. We need to keep
851 (void)strlcpy(buf1, name, sizeof(buf1));
892 paxwarn(1, "Replacement name error %s",
893 name);
939 paxwarn(1,"Replacement name too long %s >> %s",
940 name, nname);
950 name);
952 (void)fprintf(stderr,"%s >> %s\n", name, nname);
957 * otherwise copy the new name over the orig name and return
961 *nlen = l_strncpy(name, nname, PAXPATHLEN + 1);
962 name[PAXPATHLEN] = '\0';