Re: Dumb moniker questions (was Re: Bonobo dependencies ...)
- From: Vladimir Vukicevic <vladimir helixcode com>
- To: Miguel de Icaza <miguel helixcode com>
- Cc: Eric Kidd <eric kidd pobox com>, gnome-components-list gnome org
- Subject: Re: Dumb moniker questions (was Re: Bonobo dependencies ...)
- Date: Fri, 1 Dec 2000 23:44:14 -0500
On Fri, Dec 01, 2000 at 10:33:56PM -0500, Miguel de Icaza wrote:
> > 5) How do I access a file named 'myfile!ab#foo', or something similarly
> > perverse?
>
> You use escaping (currently a bug in the code), but basically it needs
> about 6 lines of changes.
>
> myfile\!ab\#foo
Would it really be this simple? I have a hack in my local
bonobo_moniker_util_seek_std_separator to do escaping:
Index: bonobo-moniker-util.c
===================================================================
RCS file: /cvs/gnome/bonobo/bonobo/bonobo-moniker-util.c,v
retrieving revision 1.9
diff -u -r1.9 bonobo-moniker-util.c
--- bonobo-moniker-util.c 2000/11/02 06:41:12 1.9
+++ bonobo-moniker-util.c 2000/12/02 04:17:45
@@ -1,3 +1,4 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
/**
* bonobo-moniker-util.c
*
@@ -207,10 +208,13 @@
}
}
-#warning We need escaping support here
-
for (; str [i]; i++) {
-
+ if (str [i] == '\\') {
+ if (!str [i+1])
+ break; /* \ at end of string? */
+ i++;
+ continue; /* catch the next i++ */
+ }
if (str [i] == '!' ||
str [i] == '#')
break;
However; most monikers do set_name in the parse_display_name, and then
get_name in the resolve handler; the monikers then tend to use get_name
as the actual name (i.e. file). One way to do this would be to have
set_name take the name with the escapes, and have get_name return
a string after escaping -- however, this would mean that all
monikers would have to use set/get name. Plus, they would have to
free the result of get_name (or have another member in the moniker
struct), and maybe introduce a get_escaped_name to return the orignally
set name. Or maybe the other way around -- have get/set name continue
working as is, and then have a way to get an unescaped name.
Thoughts?
- Vlad
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]