+ if (!(c1 = (uchar*)f1->dirname)) {
+ state1 = fnc_BASE;
+ c1 = (uchar*)f1->basename;
+ }
+ if (!(c2 = (uchar*)f2->dirname)) {
+ state2 = fnc_BASE;
+ c2 = (uchar*)f2->basename;
+ }
+
+ while (1) {
+ if ((dif = (int)*c1 - (int)*c2) != 0)
+ break;
+ if (!*++c1) {
+ switch (state1) {
+ case fnc_DIR:
+ state1 = fnc_SLASH;
+ c1 = (uchar*)"/";
+ break;
+ case fnc_SLASH:
+ state1 = fnc_BASE;
+ c1 = (uchar*)f1->basename;
+ break;
+ case fnc_BASE:
+ break;
+ }
+ }
+ if (!*++c2) {
+ switch (state2) {
+ case fnc_DIR:
+ state2 = fnc_SLASH;
+ c2 = (uchar*)"/";
+ break;
+ case fnc_SLASH:
+ state2 = fnc_BASE;
+ c2 = (uchar*)f2->basename;
+ break;
+ case fnc_BASE:
+ if (!*c1)
+ return 0;
+ break;
+ }
+ }
+ }
+
+ return dif;
+}
+
+
+/* Return a copy of the full filename of a flist entry, using the indicated
+ * buffer.
+ */
+char *f_name_to(struct file_struct *f, char *fbuf, int bsize)
+{