From 2396e90056706ef897acab3aaa081289c7336483 Mon Sep 17 00:00:00 2001 From: LEPILLER Julien Date: Fri, 19 Apr 2019 11:48:39 +0200 Subject: [PATCH] Allow variable parameters --- mecab/src/param.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/mecab/src/param.cpp b/mecab/src/param.cpp index 65328a2..006b1b5 100644 --- a/mecab/src/param.cpp +++ b/mecab/src/param.cpp @@ -79,8 +79,12 @@ bool Param::load(const char *filename) { size_t s1, s2; for (s1 = pos+1; s1 < line.size() && isspace(line[s1]); s1++); for (s2 = pos-1; static_cast(s2) >= 0 && isspace(line[s2]); s2--); - const std::string value = line.substr(s1, line.size() - s1); + std::string value = line.substr(s1, line.size() - s1); const std::string key = line.substr(0, s2 + 1); + + if(value.find('$') == 0) { + value = std::getenv(value.substr(1).c_str()); + } set(key.c_str(), value, false); } -- 2.20.1
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)Author
2023-01-30linux-container: 'container-excursion' forks to join the PID namespace....Fixes <https://issues.guix.gnu.org/61156>. * gnu/build/linux-container.scm (container-excursion): Add extra call to 'primitive-fork' and invoke THUNK in the child process. * tests/containers.scm ("container-excursion"): Remove extra 'primitive-fork' call, now unnecessary. ("container-excursion*, /proc"): New test. Ludovic Courtès
2023-01-30container: Correctly report exit status....* gnu/build/linux-container.scm (container-excursion): Return the raw status value. * tests/containers.scm ("container-excursion, same namespaces"): Add 'status:exit-val' call. * guix/scripts/container/exec.scm (guix-container-exec): Correctly handle the different cases. Ludovic Courtès
2022-09-24linux-container: Mark socket pair as SOCK_CLOEXEC....* gnu/build/linux-container.scm (run-container): Pass SOCK_CLOEXEC to 'socketpair'. Ludovic Courtès
2022-09-20linux-container: 'container-excursion*' marks its FDs as FD_CLOEXEC....Fixes <https://issues.guix.gnu.org/57827>. Reported by Mathieu Othacehe <othacehe@gnu.org>. Fixes a regression introduced with the Shepherd 0.9.2 upgrade in 1ba0e38267c9ff8bb476285091be6e297bbf136e, whereby IN and OUT would no longer be closed when 'fork+exec-command/container' would call 'exec-command*' as part of the THUNK passed to 'container-excursion*'. This is because the Shepherd 0.9.2 assumes file descriptors are properly marked as O_CLOEXEC and, consequently, 'exec-command' no longer run the close(2) loop prior to 'exec'. * gnu/build/linux-container.scm (container-excursion*): Add calls to 'fcntl'. Ludovic Courtès
2022-05-01linux-container: Add #:child-is-pid1? parameter to 'call-with-container'....* gnu/build/linux-container.scm (wait-child-process) (status->exit-status): New procedures. (call-with-container): Add #:child-is-pid1? parameter and honor it. [thunk*]: New variable. Pass it to 'run-container'. Ludovic Courtès
2022-05-01linux-container: Ensure signal-handling asyncs get a chance to run....Previously we could enter the blocking 'waitpid' call and miss an opportunity to run the signal handler async. * gnu/build/linux-container.scm (call-with-container) [periodically-schedule-asyncs]: New procedure. [install-signal-handlers]: Call it. Ludovic Courtès
2022-05-01linux-container: 'call-with-container' relays SIGTERM and SIGINT....* gnu/build/linux-container.scm (call-with-container): Add #:relayed-signals. [install-signal-handlers]: New procedure. Call it. Ludovic Courtès
2022-01-05linux-container: Handle CLONE_NEWCGROUP and use it by default....Adds low-level support for launching Linux containers with cgroup namespaces. * gnu/build/linux-container.scm (%namespaces): Add 'cgroup. (namespaces->bit-mask): Handle it. * guix/build/syscalls.scm (CLONE_NEWCGROUP): New variable. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Ryan Sundberg