Fix was applied in wrong function

This commit is contained in:
Patrick Van der Veken 2017-12-19 15:44:18 +01:00
parent beaffddbdf
commit 0159043d36

View File

@ -200,15 +200,15 @@ return 0
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# @(#) FUNCTION: data_newline2hash() # @(#) FUNCTION: data_newline2hash()
# DOES: replace newlines with a hash # DOES: replace newlines with a hash
# EXPECTS: [string] with newlines # EXPECTS: [string] with newlines (UNIX)
# OUTPUTS: [string] with hashes # OUTPUTS: [string] with hashes (UNIX)
# RETURNS: 0 # RETURNS: 0
# REQUIRES: n/a # REQUIRES: n/a
function data_newline2hash function data_newline2hash
{ {
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set "${DEBUG_OPTS}" (( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set "${DEBUG_OPTS}"
print "${1}" | tr '\n' '#' 2>/dev/null | tr '\r' '#' 2>/dev/null print "${1}" | tr '\r' '#' 2>/dev/null
return 0 return 0
} }
@ -248,15 +248,15 @@ return 0
# ----------------------------------------------------------------------------- # -----------------------------------------------------------------------------
# @(#) FUNCTION: data_strip_newline() # @(#) FUNCTION: data_strip_newline()
# DOES: remove newlines # DOES: remove newlines
# EXPECTS: [string] with newlines (UNIX) # EXPECTS: [string] with newlines
# OUTPUTS: [string] without newlines (UNIX) # OUTPUTS: [string] without newlines
# RETURNS: 0 # RETURNS: 0
# REQUIRES: n/a # REQUIRES: n/a
function data_strip_newline function data_strip_newline
{ {
(( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set "${DEBUG_OPTS}" (( ARG_DEBUG != 0 && ARG_DEBUG_LEVEL > 0 )) && set "${DEBUG_OPTS}"
print "${1}" | tr -d '\r' 2>/dev/null print "${1}" | tr -d '\n' 2>/dev/null | tr -d '\r' 2>/dev/null
return 0 return 0
} }