mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-24 06:12:27 +00:00
Fix small matters and improve sysconf()
- Fix mkdeps.com out of memory error - Remove static memory from __get_cpu_count() - Add support for passing hyphen to cat in cocmd - Change more ZipOS errors from ENOTSUP to EROFS - Specify mem_unit in sysinfo() output on BSD OSes
This commit is contained in:
parent
eebc24b9cd
commit
3a9cac4892
55 changed files with 411 additions and 262 deletions
|
@ -79,7 +79,7 @@ TEST(popen, semicolon) {
|
|||
|
||||
TEST(popen, singleQuotes) {
|
||||
setenv("there", "a b c", true);
|
||||
ASSERT_NE(NULL, (f = popen("echo -l 'hello $there' yo", "r")));
|
||||
ASSERT_NE(NULL, (f = popen("echo 'hello $there'; echo yo", "r")));
|
||||
ASSERT_STREQ("hello $there\n", fgets(buf, sizeof(buf), f));
|
||||
ASSERT_STREQ("yo\n", fgets(buf, sizeof(buf), f));
|
||||
ASSERT_EQ(0, pclose(f));
|
||||
|
@ -88,7 +88,7 @@ TEST(popen, singleQuotes) {
|
|||
|
||||
TEST(popen, doubleQuotes) {
|
||||
setenv("hello", "a b c", true);
|
||||
ASSERT_NE(NULL, (f = popen("echo -l \"$hello there\"", "r")));
|
||||
ASSERT_NE(NULL, (f = popen("echo \"$hello there\"", "r")));
|
||||
ASSERT_STREQ("a b c there\n", fgets(buf, sizeof(buf), f));
|
||||
ASSERT_EQ(0, pclose(f));
|
||||
CheckForFdLeaks();
|
||||
|
@ -96,7 +96,7 @@ TEST(popen, doubleQuotes) {
|
|||
|
||||
TEST(popen, quoteless) {
|
||||
setenv("there", "a b c", true);
|
||||
ASSERT_NE(NULL, (f = popen("echo -l hello a$there yo", "r")));
|
||||
ASSERT_NE(NULL, (f = popen("echo hello; echo a$there; echo yo", "r")));
|
||||
ASSERT_STREQ("hello\n", fgets(buf, sizeof(buf), f));
|
||||
ASSERT_STREQ("aa b c\n", fgets(buf, sizeof(buf), f)); // mixed feelings
|
||||
ASSERT_STREQ("yo\n", fgets(buf, sizeof(buf), f));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue