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-02-16gnu: Remove unneeded module imports....* gnu/packages/abiword.scm, * gnu/packages/ada.scm, * gnu/packages/agda.scm, * gnu/packages/backup.scm, * gnu/packages/barrier.scm, * gnu/packages/bioinformatics.scm, * gnu/packages/bootstrap.scm, * gnu/packages/bqn.scm, * gnu/packages/c.scm, * gnu/packages/chemistry.scm, * gnu/packages/coq.scm, * gnu/packages/cross-base.scm, * gnu/packages/databases.scm, * gnu/packages/emacs-xyz.scm, * gnu/packages/enlightenment.scm, * gnu/packages/games.scm, * gnu/packages/geo.scm, * gnu/packages/ghostscript.scm, * gnu/packages/gl.scm, * gnu/packages/golang.scm, * gnu/packages/jami.scm, * gnu/packages/java-maths.scm, * gnu/packages/kde-frameworks.scm, * gnu/packages/kde-plasma.scm, * gnu/packages/language.scm, * gnu/packages/libreoffice.scm, * gnu/packages/linphone.scm, * gnu/packages/lisp.scm, * gnu/packages/llvm.scm, * gnu/packages/machine-learning.scm, * gnu/packages/minetest.scm, * gnu/packages/monitoring.scm, * gnu/packages/nfs.scm, * gnu/packages/ocr.scm, * gnu/packages/opencl.scm, * gnu/packages/pdf.scm, * gnu/packages/python-xyz.scm, * gnu/packages/racket.scm, * gnu/packages/rust.scm, * gnu/packages/syncthing.scm, * gnu/packages/syndication.scm, * gnu/packages/telegram.scm, * gnu/packages/vulkan.scm, * gnu/packages/web-browsers.scm, * gnu/packages/web.scm, * gnu/packages/webkit.scm: Remove some unecessary module imports. Efraim Flashner