diff options
| author | fuzzyray <fuzzyray@gentoo.org> | 2007-09-13 02:53:42 +0000 |
|---|---|---|
| committer | fuzzyray <fuzzyray@gentoo.org> | 2007-09-13 02:53:42 +0000 |
| commit | 641a433fad0102b22be31424464b7114cf02c38d (patch) | |
| tree | 8eb1e6cb8d86be540a769be7dbc214bfa6a22afa | |
| parent | e336525495cb85d4d0a2676b3b176382a23e8c54 (diff) | |
| download | gentoolkit-641a433fad0102b22be31424464b7114cf02c38d.tar.gz | |
Fix eread to not accept invalid input for file selection. (Bug #189994)
svn path=/; revision=436
| -rw-r--r-- | trunk/ChangeLog | 2 | ||||
| -rwxr-xr-x | trunk/src/eread/eread | 55 |
2 files changed, 32 insertions, 25 deletions
diff --git a/trunk/ChangeLog b/trunk/ChangeLog index 4c939be..105cdb6 100644 --- a/trunk/ChangeLog +++ b/trunk/ChangeLog @@ -3,6 +3,8 @@ #192345) * revdep-rebuild: Correctly handle the case where an ebuild no longer exists for a package (Bug #188918) + * eread: Fix eread to not accept invalid input for file selection. + (Bug #189994) 2007-08-08: Paul Varner <fuzzyray@gentoo.org> * revdep-rebuild: Fix progress bar to only update when there is a diff --git a/trunk/src/eread/eread b/trunk/src/eread/eread index 2097460..c6d4de1 100755 --- a/trunk/src/eread/eread +++ b/trunk/src/eread/eread @@ -49,31 +49,36 @@ select_loop() { break ;; *) - ${PAGER} ${FILE} - read -p "Delete file? [y/N] " DELETE - case ${DELETE} in - q) - echo "Quitting" - QUIT="yes" - break - ;; - y|Y) - rm -f ${FILE} - SUCCESS=$? - if [[ ${SUCCESS} = 0 ]]; then - echo "Deleted ${FILE}" - else - echo "Unable to delete ${FILE}" - fi - ;; - # Empty string defaults to N (save file) - n|N|"") - echo "Saving ${FILE}" - ;; - *) - echo "Invalid response. Saving ${FILE}" - ;; - esac + if [ -f "$FILE" ]; then + ${PAGER} ${FILE} + read -p "Delete file? [y/N] " DELETE + case ${DELETE} in + q) + echo "Quitting" + QUIT="yes" + break + ;; + y|Y) + rm -f ${FILE} + SUCCESS=$? + if [[ ${SUCCESS} = 0 ]]; then + echo "Deleted ${FILE}" + else + echo "Unable to delete ${FILE}" + fi + ;; + # Empty string defaults to N (save file) + n|N|"") + echo "Saving ${FILE}" + ;; + *) + echo "Invalid response. Saving ${FILE}" + ;; + esac + else + echo + echo "Invalid response." + fi ;; esac break |
