ObjFW  Diff

Differences From Artifact [aa15389045]:

To Artifact [92fa7c4194]:


68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#endif

#ifndef OF_WII
static OFString *
domainFromHostname(void)
{
	char hostname[256];
	OFString *domain;

	if (gethostname(hostname, 256) != 0)
		return nil;

	domain = [OFString stringWithCString: hostname
				    encoding: [OFLocale encoding]];








|







68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#endif

#ifndef OF_WII
static OFString *
domainFromHostname(void)
{
	char hostname[256];
	OFString *domain, *ret;

	if (gethostname(hostname, 256) != 0)
		return nil;

	domain = [OFString stringWithCString: hostname
				    encoding: [OFLocale encoding]];

91
92
93
94
95
96
97
98
99
100


101
102
103
104
105
106
107
	} @catch (OFInvalidFormatException *e) {
		/* Not an IP address -> we can use it if it contains a dot. */
		size_t pos = [domain rangeOfString: @"."].location;

		if (pos == OF_NOT_FOUND)
			return nil;

		return [domain substringWithRange:
		    of_range(pos + 1, domain.length - pos - 1)];
	}


}
#endif

@implementation OFDNSResolverSettings
- (void)dealloc
{
	[_staticHosts release];







|


>
>







91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
	} @catch (OFInvalidFormatException *e) {
		/* Not an IP address -> we can use it if it contains a dot. */
		size_t pos = [domain rangeOfString: @"."].location;

		if (pos == OF_NOT_FOUND)
			return nil;

		ret = [domain substringWithRange:
		    of_range(pos + 1, domain.length - pos - 1)];
	}

	return ret;
}
#endif

@implementation OFDNSResolverSettings
- (void)dealloc
{
	[_staticHosts release];