Remove possible '/' from display name when building socket filename
MacOS X seems to have slashes in the display name, which prevent the socket file from being created. So, replace such characters that may not appear in a filename with an underscore.
This commit is contained in:
parent
9426104f0b
commit
01fea3e747
@ -281,8 +281,12 @@ gint socket_init(gint argc, gchar **argv)
|
|||||||
/* these lines are taken from dcopc.c in kdelibs */
|
/* these lines are taken from dcopc.c in kdelibs */
|
||||||
if ((p = strrchr(display_name, '.')) > strrchr(display_name, ':') && p != NULL)
|
if ((p = strrchr(display_name, '.')) > strrchr(display_name, ':') && p != NULL)
|
||||||
*p = '\0';
|
*p = '\0';
|
||||||
while ((p = strchr(display_name, ':')) != NULL)
|
/* remove characters that may not be acceptable in a filename */
|
||||||
|
for (p = display_name; *p; p++)
|
||||||
|
{
|
||||||
|
if (*p == ':' || *p == '/')
|
||||||
*p = '_';
|
*p = '_';
|
||||||
|
}
|
||||||
|
|
||||||
if (socket_info.file_name == NULL)
|
if (socket_info.file_name == NULL)
|
||||||
socket_info.file_name = g_strdup_printf("%s%cgeany_socket_%s_%s",
|
socket_info.file_name = g_strdup_printf("%s%cgeany_socket_%s_%s",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user