File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -199,21 +199,10 @@ - (id) _initWithKey: (NSString*)key
199199 hints.ai_flags = AI_CANONNAME;
200200 hints.ai_family = AF_UNSPEC;
201201
202- if ([key isEqualToString: myHostName () ])
202+ if ([key isEqualToString: localHostName ])
203203 {
204- [addresses addObject: @" 127.0.0.1" ];
205- #if defined(AF_INET6)
206- [addresses addObject: @" ::1" ];
207- #endif
208- [names addObject: @" localhost" ];
209- }
210- else if ([key isEqualToString: localHostName]
211- || [key isEqualToString: @" localhost" ])
212- {
213- #if defined(AF_INET6)
214- [addresses addObject: @" ::1" ];
215- #endif
216- ptr = " 127.0.0.1" ;
204+ [addresses unionSet: [hostClass _localAddresses ]];
205+ ptr = " localhost" ;
217206 }
218207
219208 err = getaddrinfo (ptr, 0 , &hints, &entry);
Original file line number Diff line number Diff line change 66
77int main ()
88{
9- NSAutoreleasePool *arp = [NSAutoreleasePool new ];
10- test_NSObject (@" NSHost" ,[NSArray arrayWithObject: [NSHost currentHost ]]);
9+ NSAutoreleasePool *arp = [NSAutoreleasePool new ];
10+ NSHost *h = [NSHost currentHost ];
11+
12+ test_NSObject (@" NSHost" , [NSArray arrayWithObject: h]);
13+ NSLog (@" %@ " , h);
1114 [arp release ]; arp = nil ;
1215 return 0 ;
1316}
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ int main()
1818 localh = [NSHost localHost ];
1919 PASS (localh != nil && [localh isKindOfClass: [NSHost class ]],
2020 " NSHost understands +localHost" );
21+ NSLog (@" localHost: %@ " , localh);
2122#else
2223 localh = current;
2324#endif
You can’t perform that action at this time.
0 commit comments