]> git.tuebingen.mpg.de Git - paraslash.git/commitdiff
Fix com_touch.
authorAndre Noll <maan@systemlinux.org>
Sun, 6 Jul 2008 18:51:04 +0000 (20:51 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 6 Jul 2008 18:51:04 +0000 (20:51 +0200)
The check whether no options were given was busted.

aft.c

diff --git a/aft.c b/aft.c
index a8fe08105912af0ee5235a255f13f400b1f1bf2f..e29c15a0d48afe17fa39f6c349f9fa1e8f7e7216 100644 (file)
--- a/aft.c
+++ b/aft.c
@@ -1925,7 +1925,7 @@ struct com_touch_options {
        /** New image id. */
        int32_t image_id;
        /** New amplification value. */
-       uint8_t amp;
+       int32_t amp;
        /** Command line flags (see \ref touch_flags). */
        unsigned flags;
 };
@@ -1947,7 +1947,7 @@ static int touch_audio_file(__a_unused struct osl_table *table,
        struct osl_object obj;
        struct afs_info old_afsi, new_afsi;
        int ret, no_options = tad->cto->num_played < 0 && tad->cto->last_played < 0 &&
-               tad->cto->lyrics_id < 0 && tad->cto->image_id < 0;
+               tad->cto->lyrics_id < 0 && tad->cto->image_id < 0 && tad->cto->amp < 0;
        struct afsi_change_event_data aced;
 
        ret = get_afsi_object_of_row(row, &obj);
@@ -2030,7 +2030,7 @@ int com_touch(int fd, int argc, char * const * const argv)
                .last_played = -1,
                .lyrics_id = -1,
                .image_id = -1,
-               .amp = 0,
+               .amp = -1,
        };
        struct osl_object query = {.data = &cto, .size = sizeof(cto)};
        int i, ret;