+// turns the cygwin name format into a usable windos filename.
+char *translate_cygwin(char *fname)
+{
+ if (!strncmp(fname, "/cygdrive/", 10)) {
+ int oldlen = strlen(fname);
+ char *newprefix = (char *)malloc(oldlen); // at least long enough.
+ newprefix[0] = fname[10];
+ newprefix[1] = ':';
+ newprefix[2] = '\0';
+ strncat(newprefix, fname + 11, oldlen - 11 + 1); // one extra for null char.
+printf("translate cygwin: new filename is %s\n", newprefix);
+ return newprefix; // ignoring mem leak here. cannot be helped for quicky fix.
+ } else return fname;
+}
+