Parcourir la source

Improve tzselect confirmation message

* tzselect.ksh: When there’s only one region in a country,
don’t output the line’s comments when confirming the selection,
as the comments are now intended only for countries with
multiple regions.
Paul Eggert il y a 3 ans
Parent
commit
f606a09d65
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      tzselect.ksh

+ 2 - 4
tzselect.ksh

@@ -490,9 +490,7 @@ while
 		*"$newline"*)
 			echo >&2 'Please select one of the following timezones.'
 			doselect $regions
-			region=$select_result;;
-		*)
-			region=$regions
+			region=$select_result
 		esac
 
 		# Determine TZ from country and region.
@@ -512,7 +510,7 @@ while
 				}
 			}
 			/^#/ { next }
-			$1 ~ cc && $4 == region { print $3 }
+			$1 ~ cc && ($4 == region || !region) { print $3 }
 		' <"$TZ_ZONE_TABLE"`
 		esac