Skip to content

Commit 53e7b42

Browse files
author
Josh Cartwright
committed
drop use of 'function' keyword
It is not necessary (and can also be a compatibility problem). See #25 at http://mywiki.wooledge.org/BashPitfalls
1 parent 49e60fd commit 53e7b42

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bashttpd.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,17 +58,17 @@ fail_with() {
5858
exit 1
5959
}
6060

61-
function filter_url() {
61+
filter_url() {
6262
URL_PATH=$1
6363
URL_PATH=${URL_PATH//[^a-zA-Z0-9_~\-\.\/]/}
6464
}
6565

66-
function get_content_type() {
66+
get_content_type() {
6767
URL_PATH=$1
6868
CONTENT_TYPE=$( file -b --mime-type ${URL_PATH} )
6969
}
7070

71-
function get_content_body() {
71+
get_content_body() {
7272
URL_PATH=$1
7373
CONTENT_TYPE=$2
7474
if [[ ${CONTENT_TYPE} =~ "^text" ]]; then
@@ -78,7 +78,7 @@ function get_content_body() {
7878
fi
7979
}
8080

81-
function get_content_length() {
81+
get_content_length() {
8282
CONTENT_BODY="$1"
8383
CONTENT_LENGTH=$( echo ${CONTENT_BODY} | wc -c )
8484
}

0 commit comments

Comments
 (0)