Skip to content

Commit b93ad29

Browse files
committed
Fix too big for character error
1 parent fbcda90 commit b93ad29

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

range.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -81,18 +81,18 @@ function parse_end() {
8181
return 1
8282
fi
8383

84-
if (( "${from}" > "${to}")); then
84+
if [ "${from}" -gt "${to}" ]; then
8585
echo "arg from can not be greater than arg to" >&2
8686
return 1
8787
fi
8888

8989
declare -i len_from; let len_from="${#from}"
9090
declare -i len_to; let len_to="${#to}"
9191

92-
if [ ${len_from} -eq 1 ]; then
92+
if [ "${len_from}" -eq 1 ]; then
9393
local result=(${from} ${to})
9494

95-
echo ${result[@]}; return
95+
echo "${result[@]}"; return
9696
fi
9797

9898
local join_from=$(repeat "0" ${len_from})
@@ -101,7 +101,7 @@ function parse_end() {
101101
if [ "${join_to}" -eq "9${to:1}" ]; then
102102
local result=(${from} ${to})
103103

104-
echo ${result[@]}; return
104+
echo "${result[@]}"; return
105105
fi
106106

107107
if (( "${from:0:1}" < "${to:0:1}" )); then
@@ -117,7 +117,7 @@ function parse_end() {
117117
local break_point2=$(create_break_point ${e})
118118
local result=(${from} ${break_point2} ${injection})
119119

120-
echo ${result[@]}; return
120+
echo "${result[@]}"; return
121121
fi
122122
fi
123123

@@ -138,7 +138,7 @@ function parse_end() {
138138
local break_point2=$(create_break_point $(($e + 1)))
139139
local result=(${injection} ${break_point2} ${to})
140140

141-
echo ${result[@]}; return
141+
echo "${result[@]}"; return
142142
fi
143143

144144
if (( "${from:0:1}" < "${to:0:1}" )); then
@@ -161,7 +161,7 @@ function parse_end() {
161161
fi
162162
local result=(${injection1} ${injection2})
163163

164-
echo ${result[@]}; return
164+
echo "${result[@]}"; return
165165
fi
166166

167167
local o=$(parse_end "${from:1}" "${to:1}")
@@ -314,7 +314,7 @@ function combine() {
314314
return 1
315315
fi
316316

317-
if (( "${from}" > "${to}")); then
317+
if [ "${from}" -gt "${to}" ]; then
318318
echo "arg from can not be greater than arg to" >&2
319319
return 1
320320
fi
@@ -342,9 +342,9 @@ function combine() {
342342
done
343343

344344
local range=$(parse_into_regex "${end_range}")
345-
parse_into_pattern "${range}" $3 $4 $5
345+
parse_into_pattern "${range}" "$3" "$4" "$5"
346346
}
347347

348-
if [ ! -z $1 ] && [ ! -z $2 ]; then
349-
combine $1 $2 $3 $4 $5
348+
if [ -n "$1" ] && [ -n "$2" ]; then
349+
combine "$1" "$2" "$3" "$4" "$5"
350350
fi

0 commit comments

Comments
 (0)