Skip to content

Commit

Permalink
Merge branch 'gz-utils2' into package_xml
Browse files Browse the repository at this point in the history
  • Loading branch information
azeey authored Apr 17, 2024
2 parents cfc237c + f928192 commit 2d33fac
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
21 changes: 21 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ gz_export_header(
public_headers_no_gen = glob([
"include/gz/utils/*.hh",
"include/gz/utils/detail/*.hh",
"include/gz/utils/detail/*.h",
])

gz_include_header(
Expand Down Expand Up @@ -110,3 +111,23 @@ cc_test(
"@gtest//:gtest_main",
],
)

cc_binary(
name = "subprocess_main",
srcs = ["test/integration/subprocess/subprocess_main.cc"],
deps = [
GZ_ROOT + "utils/cli",
]
)

cc_test(
name = "subprocess_TEST",
srcs = ["test/integration/subprocess_TEST.cc"],
deps = [
":utils",
":subprocess_main",
"@gtest",
"@gtest//:gtest_main",
],
local_defines = ['SUBPROCESS_EXECUTABLE_PATH=\\"utils/subprocess_main\\"'],
)
4 changes: 2 additions & 2 deletions include/gz/utils/detail/subprocess.h
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ subprocess_weak int subprocess_terminate(struct subprocess_s *const process);
///
/// The only safe way to read from the standard output of a process during it's
/// execution is to use the `subprocess_option_enable_async` option in
/// conjuction with this method.
/// conjunction with this method.
subprocess_weak unsigned
subprocess_read_stdout(struct subprocess_s *const process, char *const buffer,
unsigned size);
Expand All @@ -201,7 +201,7 @@ subprocess_read_stdout(struct subprocess_s *const process, char *const buffer,
///
/// The only safe way to read from the standard error of a process during it's
/// execution is to use the `subprocess_option_enable_async` option in
/// conjuction with this method.
/// conjunction with this method.
subprocess_weak unsigned
subprocess_read_stderr(struct subprocess_s *const process, char *const buffer,
unsigned size);
Expand Down
5 changes: 4 additions & 1 deletion src/Environment.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <algorithm>
#include <cstdlib>
#include <string>
#include <utility>
#include <vector>

#ifdef _WIN32
Expand Down Expand Up @@ -189,7 +190,9 @@ EnvironmentStrings envMapToStrings(const EnvironmentMap &_envMap)
std::sort(sorted.begin(), sorted.end());
for (auto [key, value] : sorted)
{
ret.push_back(key + "=" + value);
key += '=';
key += value;
ret.push_back(key);
}
return ret;
}
Expand Down

0 comments on commit 2d33fac

Please sign in to comment.