projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Remove stray debugging code that got in with the last commit.
[u/mdw/putty]
/
mac
/
mtcpnet.c
diff --git
a/mac/mtcpnet.c
b/mac/mtcpnet.c
index
6cddc10
..
5c25665
100644
(file)
--- a/
mac/mtcpnet.c
+++ b/
mac/mtcpnet.c
@@
-276,6
+276,7
@@
SockAddr mactcp_namelookup(char const *host, char **canonicalname)
OSErr err;
volatile int done = FALSE;
char *realhost;
OSErr err;
volatile int done = FALSE;
char *realhost;
+ int realhostlen;
/* Clear the structure. */
memset(ret, 0, sizeof(struct SockAddr_tag));
/* Clear the structure. */
memset(ret, 0, sizeof(struct SockAddr_tag));
@@
-293,9
+294,13
@@
SockAddr mactcp_namelookup(char const *host, char **canonicalname)
continue;
ret->resolved = TRUE;
continue;
ret->resolved = TRUE;
- if (ret->hostinfo.rtnCode == noErr)
+ if (ret->hostinfo.rtnCode == noErr)
{
realhost = ret->hostinfo.cname;
realhost = ret->hostinfo.cname;
- else
+ /* MacTCP puts trailing dots on canonical names. */
+ realhostlen = strlen(realhost);
+ if (realhost[realhostlen - 1] == '.')
+ realhost[realhostlen - 1] = '\0';
+ } else
realhost = "";
*canonicalname = smalloc(1+strlen(realhost));
strcpy(*canonicalname, realhost);
realhost = "";
*canonicalname = smalloc(1+strlen(realhost));
strcpy(*canonicalname, realhost);