Use less efficient arg processing for vala 0.11 compatibility
authorKevin Wasserman <krwasserman@hotmail.com>
Tue, 8 Oct 2013 20:29:11 +0000 (16:29 -0400)
committerKevin Wasserman <krwasserman@hotmail.com>
Tue, 8 Oct 2013 20:29:11 +0000 (16:29 -0400)
src/moonshot-webp-parser.vala

index 701042e..aa89660 100644 (file)
@@ -10,11 +10,11 @@ namespace WebProvisioning
     int force_flat_file_store = 0;
     bool bad_switch = false;
     for (arg_index = 1; arg_index < args.length; arg_index++) {
-      int index = 0;
-      unichar c = 0;
       string arg = args[arg_index];
-      if (arg.get_next_char(ref index, out c)) {
-        if ((c=='-') && arg.get_next_char(ref index, out c)) {
+      unichar c = arg.get_char();
+      if (c=='-') {
+          arg = arg.next_char();
+          c = arg.get_char();
           switch (c) {
             case 'f':
               force_flat_file_store = 1;
@@ -23,8 +23,8 @@ namespace WebProvisioning
               bad_switch = true;
               break;
           }
-        } else
-          break; // arg is not a switch; presume it's the file
+      } else {
+        break; // arg is not a switch; presume it's the file
       }
     }
     if (bad_switch || (arg_index != args.length - 1))