public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/libbash:master commit in: src/, scripts/
@ 2011-05-15 11:19 Petteri Räty
  0 siblings, 0 replies; only message in thread
From: Petteri Räty @ 2011-05-15 11:19 UTC (permalink / raw
  To: gentoo-commits

commit:     bb58c14b00426c923eceb04c9a8d287a8074eea0
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Sun May 15 10:14:59 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Sun May 15 10:22:14 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=bb58c14b

Builtins: support null command

Support the : command that does nothing. As it always returns true we
can use the true builtin for this purpose.

---
 scripts/command_execution.bash        |    1 +
 scripts/command_execution.bash.result |    1 +
 src/cppbash_builtin.cpp               |    1 +
 3 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/scripts/command_execution.bash b/scripts/command_execution.bash
index 821d061..9e1901c 100644
--- a/scripts/command_execution.bash
+++ b/scripts/command_execution.bash
@@ -13,4 +13,5 @@ false && echo "wrong"
 false || echo "right"
 true || echo "wrong"
 echo "end"
+: ${DEFAULTED:="yes"}
 FOO="abc" echo "command environment"

diff --git a/scripts/command_execution.bash.result b/scripts/command_execution.bash.result
index 8bd7226..7ee093d 100644
--- a/scripts/command_execution.bash.result
+++ b/scripts/command_execution.bash.result
@@ -4,5 +4,6 @@ right
 right
 end
 command environment
+DEFAULTED=yes
 FOO001=hello
 FOO002=Hello World

diff --git a/src/cppbash_builtin.cpp b/src/cppbash_builtin.cpp
index 71d3153..aee18c9 100644
--- a/src/cppbash_builtin.cpp
+++ b/src/cppbash_builtin.cpp
@@ -39,6 +39,7 @@ cppbash_builtin::builtins_type& cppbash_builtin::builtins() {
       {"echo", boost::factory<echo_builtin*>()},
       {"source", boost::factory<source_builtin*>()},
       {"inherit", boost::factory<inherit_builtin*>()},
+      {":", boost::factory<true_builtin*>()},
       {"true", boost::factory<true_builtin*>()},
       {"false", boost::factory<false_builtin*>()},
       {"return", boost::factory<return_builtin*>()}



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-05-15 11:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-15 11:19 [gentoo-commits] proj/libbash:master commit in: src/, scripts/ Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox