Commit Graph

21 Commits

Author SHA1 Message Date
Allan Odgaard
da6afa03f0 Fix concurrency bug in path::make_dir
The function could fail if the directory was created after the function had tested that it didn’t exist, as the mkdir() would then fail (with “Already Exists”).
2012-09-30 23:06:58 +02:00
Allan Odgaard
a0c4af64bd Remove trailing whitespace
Only removed from non-empty lines.
2012-09-25 14:16:50 +02:00
Allan Odgaard
7df336664a Add set_basic_environment
This is in cases where we don’t want the “clean” environment setup by default.
2012-09-24 21:32:29 +02:00
Allan Odgaard
13f35bd5b1 Whitelist rather than blacklist inherited variables
Initially the environment was clean but it was found that some variables should be inherited, e.g. SSH_AUTH_SOCK.

Therefor a blacklist was introduced, but it seems futile trying to keep it updated with all the variables that may affect the behavior of commands executed from within TextMate, therefor we now use a whitelist.

Probably the whitelist should be user configurable as launchd uses environment variables to communicate dynamically allocated sockets (like SSH_AUTH_SOCK, but there are also some Apple-prefixed variables pointing to named sockets).

Issue #238.
2012-09-21 17:50:52 +02:00
Allan Odgaard
9f339bbae1 Fix thread related crash
Since the std::map hosting the basic environment was using a (function local) static initializer, it would be destroyed during exit — though there might be threads using the basic environment, and joining these might happen after destroying the basic environment.

This should explain the crash in network::launch_tbz.
2012-09-21 17:50:52 +02:00
Allan Odgaard
c7971c5f63 Use range-based for instead of std::for_each 2012-09-20 12:22:21 +02:00
Allan Odgaard
54bf2be75f Make variable const
Just to stress that map is immutable.
2012-09-18 17:33:01 +02:00
Allan Odgaard
aed4c1c27f No longer show dialog for readlink() failure
Only one readlink() failure reported (issue #389) which wouldn’t explain the crashes which the dialog (introduced in 68ed8293) was trying to track down.
2012-09-09 20:43:53 +02:00
Allan Odgaard
68ed829313 Show alert if readlink fails
I am seeing crash reports from resolve_links and I can’t think of any other reason for this crash, than readlink() returning a value which is neither -1 nor in the range [0..len].
2012-08-29 17:43:04 +02:00
Allan Odgaard
0e96a04d76 Remove compatibility checks
Since we now require 10.7 we don’t need all of this. Keeping it around is just noise that can lead to confusion about code paths.
2012-08-29 16:02:29 +02:00
Allan Odgaard
f96de9319e Fix/change path::with_tilde
We now leave a potential trailing slash in the result.

This fixes the issue of the missing slash in ⌘T — while I normally prefer the slash to be stripped, I think path::with_tilde should be an exception since effectively it is just replacing the path prefix, it shouldn’t do any real processing (although we do actually normalize the string).

Also fix a bug where we would use tilde for paths pointing to a user folder for a user with current user’s name as prefix.
2012-08-29 15:43:55 +02:00
Allan Odgaard
cbe91ff831 Assume compiler support for explicit keyword
Since we require a fairly recent clang for other features, there is no reason to test for this one.
2012-08-29 14:27:35 +02:00
Jacob Bandes-Storch
e3aa997b06 Use libc++: replace std::tr1 with std 2012-08-28 13:30:20 +02:00
Allan Odgaard
3415d775c5 Use symbolic name for FD_CLOEXEC
Unsure why I was using ‘1’ — perhaps the symbolic name was missing in the older SDK.
2012-08-24 16:52:45 +02:00
Allan Odgaard
4259a8f884 Add path::is_absolute.
This is actually not entirely trivial since we can have a path that starts with a slash but includes more ‘..’ components than there are actual directories in the path.
2012-08-13 22:53:16 +02:00
Allan Odgaard
a3b8be728d fixup! Turn private run_cmd (scm/utility.h) → io::exec
Forgot to update debug variable.
2012-08-13 18:05:56 +02:00
Allan Odgaard
512e5fdede Prune GIT variables from the inherited environment
Incase we do a git commit that launches TextMate, it will inherit a bunch of variables from git, including GIT_DIR, which will cause issues for the Git bundle.
2012-08-11 20:37:05 +02:00
Allan Odgaard
5f55fcb514 Turn private run_cmd (scm/utility.h) → io::exec 2012-08-11 19:39:18 +02:00
Allan Odgaard
e680130eaf Move oak::basic_environment to the io framework
Previously this was under the OakSystem framework which depends on the io framework meaning that the io framework itself was unable to obtain a basic environment, which is necessary for next commit.
2012-08-11 19:31:10 +02:00
Gerd Knops
8d523c0a66 Rework path::is_local to support disk images.
This enables SCM badges for disk images. The check is done using the new (10.7) kCFURLVolumeIsLocalKey.
2012-08-10 19:15:02 +02:00
Allan Odgaard
9894969e67 Initial commit 2012-08-09 16:25:56 +02:00