Permalink
Browse files

Correctly match empty strings

Stop `is_in_class` returning true on empty strings.
  • Loading branch information...
1 parent 30bda2e commit 31924fb6dcd7cd321720f0c8cedb4d9cd1b1bdc6 @kopischke committed Apr 9, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/lib/strings.sh
View
@@ -9,7 +9,7 @@ function is_7bit {
}
function is_blank {
- is_in_class '[:blank:]' "$1"
+ [[ -z "$1" ]] || is_in_class '[:blank:]' "$1"
}
function is_upper {
@@ -21,7 +21,7 @@ function is_lower {
}
function is_mixed {
- ! is_upper "$1" && ! is_lower "$1"
+ (( ${#1} > 1 )) && ! is_upper "$1" && ! is_lower "$1"
}
function is_title {

0 comments on commit 31924fb

Please sign in to comment.