Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

std::os - Add join_paths, make setenv non-utf8 capable #15280

Closed
wants to merge 1 commit into from

Commits on Jun 30, 2014

  1. Add os::join_paths, make setenv non-utf8 capable

    This commit changes `os` in three ways:
    
    * It adds a `join_paths` function that is the converse to `split_paths`,
      easing manipulation of the `PATH` environment variable according to
      platform conventions.
    
    * **Breaking change**: It changes `split_paths` to no longer drop empty paths, since they are
      meaningful to some shells (where they are synonymous with the current
      working directory).
    
    * It changes `setenv` to take a `BytesContainer` rather than a `&str`
      value, since environment variables may have non-utf8 values on some
      platforms. Since `&str` is a `BytesContainer`, this is *not* a
      breaking change.
    
    Along the way, it also refactors the `split_paths` function so that
    `cfg` switches are applied internally (and the function header is given
    only once). This fixes a bug: the doc comment had an example for only
    one platform.
    
    [breaking-change]
    aturon committed Jun 30, 2014
    Configuration menu
    Copy the full SHA
    940a39a View commit details
    Browse the repository at this point in the history