Skip to contentSkip to conversation

Fix extraous comma in printf

PATCH In review Michael Chang 3 participants 4 messages Sep 11, 2014 – Sep 21, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix extraous comma in printf

This patch is to get intended output from printf shell command, as the comma is not used as separator for it's arguments, they will eventually be outputted together with the variables.

Though it does not affect or break any function currently, I'd like to address this hidden problem and hope to get some attention of it.

Thanks.

---
 grub-core/osdep/unix/config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
grub-core/osdep/unix/config.c +2 -2
index f4b0bb4..65effa9 100644
@@ -105,8 +105,8 @@ grub_util_load_config (struct grub_util_config *cfg)
       *ptr++ = *iptr;
     }
 
-  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", "
-	  "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\"");
+  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" "
+	  "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"");
 
   argv[2] = script;
   argv[3] = '\0';
Signature · 1 line
1.7.3.4
#1 lore raw

Committed, thanks.

Quoted 28 lines · Michael Chang

This patch is to get intended output from printf shell command, as the comma is not used as separator for it's arguments, they will eventually be outputted together with the variables.

Though it does not affect or break any function currently, I'd like to address this hidden problem and hope to get some attention of it.

Thanks.

---
 grub-core/osdep/unix/config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
grub-core/osdep/unix/config.c +2 -2
index f4b0bb4..65effa9 100644
@@ -105,8 +105,8 @@ grub_util_load_config (struct grub_util_config *cfg)
       *ptr++ = *iptr;
     }
 
-  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", "
-	  "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\"");
+  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" "
+	  "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"");
 
   argv[2] = script;
   argv[3] = '\0';
#2 lore raw

В Sun, 21 Sep 2014 17:49:35 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 1 line

Committed, thanks.

You commit contains much more than this single line. Is it intentional?

Quoted 31 lines · Michael Chang
Quoted 28 lines

This patch is to get intended output from printf shell command, as the comma is not used as separator for it's arguments, they will eventually be outputted together with the variables.

Though it does not affect or break any function currently, I'd like to address this hidden problem and hope to get some attention of it.

Thanks.

---
 grub-core/osdep/unix/config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
grub-core/osdep/unix/config.c +2 -2
index f4b0bb4..65effa9 100644
@@ -105,8 +105,8 @@ grub_util_load_config (struct grub_util_config *cfg)
       *ptr++ = *iptr;
     }
 
-  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", "
-	  "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\"");
+  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" "
+	  "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"");
 
   argv[2] = script;
   argv[3] = '\0';
#3 lore raw
Quoted 7 lines · Andrei Borzenkov

В Sun, 21 Sep 2014 17:49:35 +0200
Vladimir 'φ-coder/phcoder' Serbinenko <[email protected]> пишет:

Quoted 1 line

Committed, thanks.

You commit contains much more than this single line. Is it intentional?

No, thank you for noticing this.

Quoted 39 lines
Quoted 21 lines · Michael Chang
Quoted 20 lines

This patch is to get intended output from printf shell command, as the comma is not used as separator for it's arguments, they will eventually be outputted together with the variables.

Though it does not affect or break any function currently, I'd like to address this hidden problem and hope to get some attention of it.

Thanks.

---
 grub-core/osdep/unix/config.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
grub-core/osdep/unix/config.c +0 -0
index f4b0bb4..65effa9 100644
@@ -105,8 +105,8 @@ grub_util_load_config (struct grub_util_config *cfg)
       *ptr++ = *iptr;
     }
 
Quoted 10 lines

grub-core/osdep/unix/config.c grub_util_load_config (struct grub_util_config *cfg) · line 112

Quoted 8 lines
grub-core/osdep/unix/config.c +2 -2
-  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\", "
-	  "\"$GRUB_ENABLE_CRYPTODISK\", \"$GRUB_DISTRIBUTOR\"");
+  strcpy (ptr, "'; printf \"GRUB_ENABLE_CRYPTODISK=%s\\nGRUB_DISTRIBUTOR=%s\\n\" "
+	  "\"$GRUB_ENABLE_CRYPTODISK\" \"$GRUB_DISTRIBUTOR\"");
 
   argv[2] = script;
   argv[3] = '\0';

_______________________________________________
Grub-devel mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/grub-devel