]> git.ipfire.org Git - thirdparty/make.git/commitdiff
* src/main.c (decode_debug_flags): [SV 607777] Preserve -d options
authorDmitry Goncharov <dgoncharov@users.sf.net>
Tue, 7 Sep 2021 00:36:15 +0000 (20:36 -0400)
committerPaul Smith <psmith@gnu.org>
Tue, 7 Sep 2021 00:36:15 +0000 (20:36 -0400)
* tests/scripts/options/dash-d: Test that -d --trace keeps -d.

src/main.c
tests/scripts/options/dash-d [new file with mode: 0644]

index 03db83cc03dff491372a62808542c2a58d7fb288..f16125e25181aee20fe48e690d2bdd0220a4cb62 100644 (file)
@@ -724,7 +724,7 @@ decode_debug_flags (void)
     db_level = DB_ALL;
 
   if (trace_flag)
-    db_level = DB_PRINT | DB_WHY;
+    db_level |= DB_PRINT | DB_WHY;
 
   if (db_flags)
     for (pp=db_flags->list; *pp; ++pp)
diff --git a/tests/scripts/options/dash-d b/tests/scripts/options/dash-d
new file mode 100644 (file)
index 0000000..ec2e39a
--- /dev/null
@@ -0,0 +1,9 @@
+#                                                                    -*-perl-*-
+
+$description = "Test make -d option.\n";
+
+# sv 60777.
+# Test that debug output is printed when both -d and --trace are specified.
+run_make_test('all: ; :', '-d --trace', "/GNU Make/");
+
+1;