From 28cd628c13cb25955bcde24ca7d529bed27164a2 Mon Sep 17 00:00:00 2001 From: Akianonymus Date: Mon, 9 Nov 2020 12:57:52 +0530 Subject: [PATCH] gupload: _cleanup_config: Don't try to parse empty lines will lead to _cleanup of whole config if access token expiry is missing --- bash/release/gupload | 2 +- bash/upload.bash | 2 +- sh/release/gupload | 2 +- sh/upload.sh | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bash/release/gupload b/bash/release/gupload index e79f928..0a930e7 100755 --- a/bash/release/gupload +++ b/bash/release/gupload @@ -1016,7 +1016,7 @@ _cleanup_config() { ! [ -f "${config}" ] && return 0 - while read -r line; do + while read -r line && [[ -n ${line} ]]; do expiry_value_name="${line%%=*}" token_value_name="${expiry_value_name%%_EXPIRY}" diff --git a/bash/upload.bash b/bash/upload.bash index 2c759db..30b30dc 100755 --- a/bash/upload.bash +++ b/bash/upload.bash @@ -76,7 +76,7 @@ _cleanup_config() { ! [ -f "${config}" ] && return 0 - while read -r line; do + while read -r line && [[ -n ${line} ]]; do expiry_value_name="${line%%=*}" token_value_name="${expiry_value_name%%_EXPIRY}" diff --git a/sh/release/gupload b/sh/release/gupload index 6f59aac..55e06eb 100755 --- a/sh/release/gupload +++ b/sh/release/gupload @@ -1003,7 +1003,7 @@ _cleanup_config() { ! [ -f "${config}" ] && return 0 - while read -r line <&4; do + while read -r line <&4 && [ -n "${line}" ]; do expiry_value_name="${line%%=*}" token_value_name="${expiry_value_name%%_EXPIRY}" diff --git a/sh/upload.sh b/sh/upload.sh index 5a2604f..dc90299 100755 --- a/sh/upload.sh +++ b/sh/upload.sh @@ -77,7 +77,7 @@ _cleanup_config() { ! [ -f "${config}" ] && return 0 - while read -r line <&4; do + while read -r line <&4 && [ -n "${line}" ]; do expiry_value_name="${line%%=*}" token_value_name="${expiry_value_name%%_EXPIRY}"