Differences From Artifact [8bb94e9bd1]:
- File src/OFApplication.m — part of check-in [374e1a1bfa] at 2021-01-02 22:04:26 on branch trunk — Update copyright (user: js, size: 15808) [annotate] [blame] [check-ins using] [more...]
To Artifact [84a11f1539]:
- File
src/OFApplication.m
— part of check-in
[a0fd103a0b]
at
2021-03-07 02:36:04
on branch trunk
— Style change: Allow more than 1 argument per line
This is only migrating some places, others will be migrated as they are
touched. (user: js, size: 15740) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
256 257 258 259 260 261 262 | "Warning: Invalid environment " "variable: %s\n", tmp.UTF8String); continue; } key = [tmp substringToIndex: pos]; value = [tmp substringFromIndex: pos + 1]; | < | < | 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 | "Warning: Invalid environment " "variable: %s\n", tmp.UTF8String); continue; } key = [tmp substringToIndex: pos]; value = [tmp substringFromIndex: pos + 1]; [_environment setObject: value forKey: key]; objc_autoreleasePoolPop(pool); } FreeEnvironmentStringsW(env0); } else { char *env, *env0; |
︙ | ︙ | |||
300 301 302 303 304 305 306 | "Warning: Invalid environment " "variable: %s\n", tmp.UTF8String); continue; } key = [tmp substringToIndex: pos]; value = [tmp substringFromIndex: pos + 1]; | < | < | 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 | "Warning: Invalid environment " "variable: %s\n", tmp.UTF8String); continue; } key = [tmp substringToIndex: pos]; value = [tmp substringFromIndex: pos + 1]; [_environment setObject: value forKey: key]; objc_autoreleasePoolPop(pool); } FreeEnvironmentStringsA(env0); } #elif defined(OF_AMIGAOS) |
︙ | ︙ | |||
336 337 338 339 340 341 342 | continue; file = [OFFile fileWithPath: path mode: @"r"]; value = [file readLineWithEncoding: encoding]; if (value != nil) | | < | 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 | continue; file = [OFFile fileWithPath: path mode: @"r"]; value = [file readLineWithEncoding: encoding]; if (value != nil) [_environment setObject: value forKey: name]; objc_autoreleasePoolPop(pool2); } /* Local variables override global variables */ proc = (struct Process *)FindTask(NULL); firstLocalVar = (struct LocalVar *)proc->pr_LocalVars.mlh_Head; |
︙ | ︙ | |||
370 371 372 373 374 375 376 | key = [OFString stringWithCString: iter->lv_Node.ln_Name encoding: encoding]; value = [OFString stringWithCString: (const char *)iter->lv_Value encoding: encoding length: length]; | < | < | 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 | key = [OFString stringWithCString: iter->lv_Node.ln_Name encoding: encoding]; value = [OFString stringWithCString: (const char *)iter->lv_Value encoding: encoding length: length]; [_environment setObject: value forKey: key]; } objc_autoreleasePoolPop(pool); #elif !defined(OF_IOS) # ifndef OF_MACOS char **env = environ; # else |
︙ | ︙ | |||
405 406 407 408 409 410 411 | key = [OFString stringWithCString: *env encoding: encoding length: sep - *env]; value = [OFString stringWithCString: sep + 1 encoding: encoding]; | < | < | < | < | < | < | < | 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 | key = [OFString stringWithCString: *env encoding: encoding length: sep - *env]; value = [OFString stringWithCString: sep + 1 encoding: encoding]; [_environment setObject: value forKey: key]; objc_autoreleasePoolPop(pool); } } #else /* * iOS does not provide environ and Apple does not allow using * _NSGetEnviron on iOS. Therefore, we just get a few common * variables from the environment which applications might * expect. */ void *pool = objc_autoreleasePoolPush(); char *env; if ((env = getenv("HOME")) != NULL) { OFString *home = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: false] autorelease]; [_environment setObject: home forKey: @"HOME"]; } if ((env = getenv("PATH")) != NULL) { OFString *path = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: false] autorelease]; [_environment setObject: path forKey: @"PATH"]; } if ((env = getenv("SHELL")) != NULL) { OFString *shell = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: false] autorelease]; [_environment setObject: shell forKey: @"SHELL"]; } if ((env = getenv("TMPDIR")) != NULL) { OFString *tmpdir = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: false] autorelease]; [_environment setObject: tmpdir forKey: @"TMPDIR"]; } if ((env = getenv("USER")) != NULL) { OFString *user = [[[OFString alloc] initWithUTF8StringNoCopy: env freeWhenDone: false] autorelease]; [_environment setObject: user forKey: @"USER"]; } objc_autoreleasePoolPop(pool); #endif [_environment makeImmutable]; } @catch (id e) { |
︙ | ︙ |