limit name length to 12 characters

found at https://github.com/akatrevorjay/edid-generator/issues/21#issuecomment-1025054600
This commit is contained in:
Krzysztof Nazarewski
2023-10-17 17:27:15 +02:00
parent b681133934
commit cdef9e92c7

View File

@@ -32,6 +32,7 @@ template-S() {
local name="${1//\"}" local name="${1//\"}"
[[ -z "$name" ]] && echo "Could not parse modeline: $@" >&2 && return 1 [[ -z "$name" ]] && echo "Could not parse modeline: $@" >&2 && return 1
[[ "${#name}" -gt 12 ]] && echo "Name cannot be longer than 12 characters: $name is ${#name} characters long" >&2 && return 1
local fn="${name}.S" local fn="${name}.S"
local -F pixel_clock_mhz=$2 local -F pixel_clock_mhz=$2
@@ -60,7 +61,7 @@ template-S() {
case $ratio in case $ratio in
compute) compute)
ratio=$(find-supported-ratio $hdisp $vdisp 'UNKNOWN') ratio=$(find-supported-ratio $hdisp $vdisp 'UNKNOWN')
printf 'Computed ratio: %s' $ratio printf 'Computed ratio: %s\n' $ratio
[[ $ratio != 'UNKNOWN' ]] || return 1 [[ $ratio != 'UNKNOWN' ]] || return 1
;; ;;
esac esac