summaryrefslogtreecommitdiff
path: root/gethost.c
diff options
context:
space:
mode:
Diffstat (limited to 'gethost.c')
-rw-r--r--gethost.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/gethost.c b/gethost.c
index 3bfdb39..6b36340 100644
--- a/gethost.c
+++ b/gethost.c
@@ -280,7 +280,22 @@ struct addrlist *get_address_info (
src = buf;
len = strlen (buf);
}
- } else {
+ } else if(prefix == 0 && (strncmp (fulldpyname, "/tmp/launch", 11) == 0)) {
+ /* Use the bundle id (part preceding : in the basename) as our src id */
+ char *c;
+ strlcpy(buf, strrchr(fulldpyname, '/') + 1, sizeof(buf));
+ c = strchr(buf, ':');
+
+ /* In the legacy case with no bundle id, use the full path */
+ if(c == buf) {
+ src = fulldpyname;
+ } else {
+ *c = '\0';
+ src = buf;
+ }
+
+ len = strlen(src);
+ } else {
src = fulldpyname;
len = prefix;
}