From ce39f910f587e75bd70786d796fa5b57e7dfd5a1 Mon Sep 17 00:00:00 2001 From: Jephte CLAIN Date: Thu, 28 Aug 2014 10:31:05 +0400 Subject: [PATCH] =?UTF-8?q?petite=20modification=20pour=20=C3=A9viter=20d'?= =?UTF-8?q?appeler=20un=20processus=20externe=20dans=20les=20cas=20les=20p?= =?UTF-8?q?lus=20courants?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/ulib/.ulibver | 2 +- lib/ulib/compat | 13 +++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/lib/ulib/.ulibver b/lib/ulib/.ulibver index c605ea6..9c1e68d 100644 --- a/lib/ulib/.ulibver +++ b/lib/ulib/.ulibver @@ -1 +1 @@ -001003000 +001004000 diff --git a/lib/ulib/compat b/lib/ulib/compat index f7251ab..5d2d87e 100644 --- a/lib/ulib/compat +++ b/lib/ulib/compat @@ -20,17 +20,26 @@ if check_sysinfos -s macosx; then function tolower() { tr A-Z a-z <<<"$*"; } function toupper() { tr a-z A-Z <<<"$*"; } function is_yes() { + case "$1" in + o|oui|y|yes|v|vrai|t|true|on) return 0;; + O|OUI|Y|YES|V|VRAI|T|TRUE|ON) return 0;; + esac + isnum "$1" && [ "$1" -ne 0 ] && return 0 + # pour les perfs, n'utiliser tolower que ici case "$(tolower "$1")" in o|oui|y|yes|v|vrai|t|true|on) return 0;; esac - isnum "$1" && [ "$1" -ne 0 ] && return 0 return 1 } function is_no() { + case "$1" in + n|non|no|f|faux|false|off) return 0;; + N|NON|NO|F|FAUX|FALSE|OFF) return 0;; + esac + isnum "$1" && [ "$1" -eq 0 ] && return 0 case "$(tolower "$1")" in n|non|no|f|faux|false|off) return 0;; esac - isnum "$1" && [ "$1" -eq 0 ] && return 0 return 1 }