diff options
| author | Richard M. Stallman | 1999-01-24 20:07:05 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1999-01-24 20:07:05 +0000 |
| commit | cf591cc18badd0af3ab7cb6bd915e1594342c78a (patch) | |
| tree | bbb07168ae4793dc549f01349a91e631ba6ec853 /src | |
| parent | e18e6130fad63fdf7de2367578826028f654314f (diff) | |
| download | emacs-cf591cc18badd0af3ab7cb6bd915e1594342c78a.tar.gz emacs-cf591cc18badd0af3ab7cb6bd915e1594342c78a.zip | |
(same_x_server): Detect treat ":0" and "unix:0"
as the same. Treat "myname:0" as the same as those two.
Diffstat (limited to 'src')
| -rw-r--r-- | src/xterm.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/xterm.c b/src/xterm.c index 53943fe9115..95d6d05dcb8 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -6951,6 +6951,34 @@ same_x_server (name1, name2) | |||
| 6951 | char *name1, *name2; | 6951 | char *name1, *name2; |
| 6952 | { | 6952 | { |
| 6953 | int seen_colon = 0; | 6953 | int seen_colon = 0; |
| 6954 | unsigned char *system_name = XSTRING (Vsystem_name)->data; | ||
| 6955 | int system_name_length = strlen (system_name); | ||
| 6956 | int length_until_period = 0; | ||
| 6957 | |||
| 6958 | while (system_name[length_until_period] != 0 | ||
| 6959 | && system_name[length_until_period] != '.') | ||
| 6960 | length_until_period++; | ||
| 6961 | |||
| 6962 | /* Treat `unix' like an empty host name. */ | ||
| 6963 | if (! strncmp (name1, "unix:", 5)) | ||
| 6964 | name1 += 4; | ||
| 6965 | if (! strncmp (name2, "unix:", 5)) | ||
| 6966 | name2 += 4; | ||
| 6967 | /* Treat this host's name like an empty host name. */ | ||
| 6968 | if (! strncmp (name1, system_name, system_name_length) | ||
| 6969 | && name1[system_name_length] == ':') | ||
| 6970 | name1 += system_name_length; | ||
| 6971 | if (! strncmp (name2, system_name, system_name_length) | ||
| 6972 | && name2[system_name_length] == ':') | ||
| 6973 | name2 += system_name_length; | ||
| 6974 | /* Treat this host's domainless name like an empty host name. */ | ||
| 6975 | if (! strncmp (name1, system_name, length_until_period) | ||
| 6976 | && name1[length_until_period] == ':') | ||
| 6977 | name1 += length_until_period; | ||
| 6978 | if (! strncmp (name2, system_name, length_until_period) | ||
| 6979 | && name2[length_until_period] == ':') | ||
| 6980 | name2 += length_until_period; | ||
| 6981 | |||
| 6954 | for (; *name1 != '\0' && *name1 == *name2; name1++, name2++) | 6982 | for (; *name1 != '\0' && *name1 == *name2; name1++, name2++) |
| 6955 | { | 6983 | { |
| 6956 | if (*name1 == ':') | 6984 | if (*name1 == ':') |