[msitools: 1/4] msibuild: fix -s argument handling




commit 2124965c5a3aa5ae1c3464a4447826205a69bc00
Author: Marc-André Lureau <marcandre lureau redhat com>
Date:   Mon Jan 11 01:27:15 2021 +0400

    msibuild: fix -s argument handling
    
    Setting summary with multiple arguments didn't work.
    Fixes:
    https://gitlab.gnome.org/GNOME/msitools/-/issues/30

 tests/tools.bats | 10 ++++++++++
 tools/msibuild.c |  2 +-
 2 files changed, 11 insertions(+), 1 deletion(-)
---
diff --git a/tests/tools.bats b/tests/tools.bats
index 9359ce1..1d50c1c 100644
--- a/tests/tools.bats
+++ b/tests/tools.bats
@@ -62,6 +62,16 @@ load common
   [ "$(echo "$output" | grep "^Revision")" = "$exp" ]
 }
 
+@test "msibuild - Set summary" {
+  run "$msibuild" out.msi -s 'Project name'
+  run "$msibuild" out.msi -s 'Project name3' 'Somebody' ';1042' '24265297-EC57-4E72-B5E9-000000000000'
+  run "$msiinfo" suminfo out.msi
+  echo "$output" | grep "Subject: Project name3"
+  echo "$output" | grep "Author: Somebody"
+  echo "$output" | grep "Template: ;1042"
+  echo "$output" | grep "Revision number (UUID): 24265297-EC57-4E72-B5E9-000000000000"
+}
+
 @test "msibuild - add stream" {
   echo "This is test.txt" > test.txt
   run "$msibuild" out.msi -a Binary.testtxt test.txt
diff --git a/tools/msibuild.c b/tools/msibuild.c
index b7dbb09..ef7c875 100644
--- a/tools/msibuild.c
+++ b/tools/msibuild.c
@@ -298,7 +298,7 @@ int main(int argc, char *argv[])
                                   n > 3 ? argv[3] : NULL,
                                   n > 4 ? argv[4] : NULL, &error))
                 goto end;
-            argc -= 3, argv += 3;
+            argc -= n + 1, argv += n + 1;
             break;
         case 'i':
             do {


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