Skip to content
Snippets Groups Projects
Commit 57966f40 authored by Christian Engwer's avatar Christian Engwer
Browse files

[dunecontrol]

- fix check_module_name
- make it faster by using a pure bash-pattern-matching

[[Imported from SVN: r6824]]
parent 613e6d11
No related branches found
No related tags found
No related merge requests found
...@@ -417,13 +417,8 @@ fix_and_assign() { ...@@ -417,13 +417,8 @@ fix_and_assign() {
# $1 module name # $1 module name
# #
check_modname() { check_modname() {
if sh -c "$ID=huhu" > /dev/null 2>&1; then # magic pattern match, see http://www.linuxmisc.com/9-unix-questions/67d307ca51f16ed4.htm
return 1 [ -n "${1##*[!A-Za-z0-9_]*}" ] && [ -n "${1##[!A-Za-z_]*}" ]
fi
# if ! echo "$1" | $GREP '^[a-zA-Z0-9_]\{1,\}$' >/dev/null; then
# return 1
# fi
return 0
} }
# #
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment