- if ((environment = getenv("XENVIRONMENT")) == NULL) {
- size_t len;
- environment = GetIniFile(filename, NULL);
- len = strlen(environment);
-#if !defined(SVR4) || defined(__sgi)
- (void)gethostname(environment + len, 1024 - len);
-#else
- (void)sysinfo(SI_HOSTNAME, environment + len, 1024 - len);
-#endif
+ if ((environment = wxGetenv(wxT("XENVIRONMENT"))) == NULL)
+ {
+ environment = GetIniFile(filename, (const wxChar *) NULL);
+ size_t len = wxStrlen(environment);
+
+ wxChar hostbuf[1024];
+ (void)wxGetHostName(hostbuf, WXSIZEOF(hostbuf) - len);
+
+ wxStrcat(environment, hostbuf);