+ char *result = strdup ([os cStringUsingEncoding:NSUTF8StringEncoding]);
+
+ // Kludge: if the string is surrounded with single-quotes, remove them.
+ // This happens when the .xml file says things like arg="-foo 'bar baz'"
+ if (result[0] == '\'' && result[strlen(result)-1] == '\'') {
+ result[strlen(result)-1] = 0;
+ strcpy (result, result+1);
+ }
+
+ // Kludge: assume that any string that begins with "~" and has a "/"
+ // anywhere in it should be expanded as if it is a pathname.
+ if (result[0] == '~' && strchr (result, '/')) {
+ os = [NSString stringWithCString:result encoding:NSUTF8StringEncoding];
+ free (result);
+ result = strdup ([[os stringByExpandingTildeInPath]
+ cStringUsingEncoding:NSUTF8StringEncoding]);
+ }
+
+ return result;