Monday, 2 November 2015

[Rpcemu] Patch for HostFS file name translation on Windows

--- hostfs.c.orig 2015-11-02 13:34:55 +0000
+++ hostfs.c 2015-11-02 13:35:22 +0000
@@ -309,6 +309,17 @@
case '/':
*host_path++ = '.';
break;
+#ifdef RPCEMU_WIN
+ case '?':
+ *host_path++ = '#';
+ break;
+ case '<':
+ *host_path++ = '$';
+ break;
+ case '>':
+ *host_path++ = '^';
+ break;
+#endif
default:
*host_path++ = *path;
break;
@@ -341,7 +352,18 @@
case 32:
*riscos_name++ = 160;
break;
- default:
+#ifdef RPCEMU_WIN
+ case '#':
+ *riscos_name++ = '?';
+ break;
+ case '$':
+ *riscos_name++ = '<';
+ break;
+ case '^':
+ *riscos_name++ = '>';
+ break;
+#endif
+ default:
*riscos_name++ = *object_name;
break;
}
I've attached a patch for hostfs.c (made using diff –u) to fix the problem
with
the "?". "<" and ">" characters when they are used in HostFS on Windows.
It translates them to "#", "$" and "^" in Windows which matches some
documentation I've seen on DOSFS.

I have a Google test to test them if you require, but it's easy to do it
by hand, at the CLI just try.

*create a?b
*create a<b
*create a>b

These will fail before the patch is applied.

Can some one apply this to the RPC Emu code please?

Regards,
Alan Buckley

No comments:

Post a Comment