src/parasol/para/para.c 1.109
1.109 2010/01/12 18:48:12 markd
remove trailing / and /. to fix common problem with -batch option when doing name completion
Index: src/parasol/para/para.c
===================================================================
RCS file: /projects/compbio/cvsroot/kent/src/parasol/para/para.c,v
retrieving revision 1.108
retrieving revision 1.109
diff -b -B -U 4 -r1.108 -r1.109
--- src/parasol/para/para.c 17 Dec 2009 23:54:51 -0000 1.108
+++ src/parasol/para/para.c 12 Jan 2010 18:48:12 -0000 1.109
@@ -2112,8 +2112,15 @@
safecat(path, sizeof(path), opt);
}
else
safecpy(path, sizeof(path), opt);
+// remove trailing "/" or "/." from name. While the whole path should be normalized,
+// this at least removes a common difference when using file name completion.
+if (endsWith(path, "/."))
+ path[strlen(path)-2] = '\0';
+if (endsWith(path, "/"))
+ path[strlen(path)-1] = '\0';
+
return cloneString(path);
}
int main(int argc, char *argv[])