[at-spi2-core] at-spi-bus-launcher: fix parsing command line arguments



commit 99876d4584411d0343bae019a25d45ab6a3a4428
Author: Alexander Volkov <support rusbitech ru>
Date:   Mon Apr 18 17:54:47 2016 +0300

    at-spi-bus-launcher: fix parsing command line arguments
    
    Fix parsing --a11y=... and --screen-reader=...
    sscanf returns the number of input items successfully matched,
    and for one argument it is 1, but not 2.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=765220

 bus/at-spi-bus-launcher.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/bus/at-spi-bus-launcher.c b/bus/at-spi-bus-launcher.c
index 7ea8283..54aa07f 100644
--- a/bus/at-spi-bus-launcher.c
+++ b/bus/at-spi-bus-launcher.c
@@ -723,10 +723,10 @@ main (int    argc,
     {
       if (!strcmp (argv[i], "--launch-immediately"))
         _global_app->launch_immediately = TRUE;
-      else if (sscanf (argv[i], "--a11y=%d", &_global_app->a11y_enabled) == 2)
+      else if (sscanf (argv[i], "--a11y=%d", &_global_app->a11y_enabled) == 1)
         a11y_set = TRUE;
       else if (sscanf (argv[i], "--screen-reader=%d",
-                       &_global_app->screen_reader_enabled) == 2)
+                       &_global_app->screen_reader_enabled) == 1)
         screen_reader_set = TRUE;
     else
       g_error ("usage: %s [--launch-immediately] [--a11y=0|1] [--screen-reader=0|1]", argv[0]);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]