search for: open_alternate_base_fuzzy

Displaying 1 result from an estimated 1 matches for "open_alternate_base_fuzzy".

2005 Jan 05
1
rsync filename heuristics
...must match */ > + if (namelen <= extlen || strcmp(name+namelen-extlen, ext) != 0) > + return 0; > + > + /* Now score depends on similarity of prefix */ > + for (; *name==*basename && *name; name++, basename++) > + score++; > + return score; > +} > + > +int open_alternate_base_fuzzy(const char *fname) > +{ > + DIR *d; > + struct dirent *di; > + char *basename, *dirname; > + char mangled_name[MAXPATHLEN]; > + char bestname[MAXPATHLEN]; > + unsigned int bestscore = 0; > + const char *ext; > + > + /* FIXME: can we assume fname fits here? */ > + st...