summaryrefslogtreecommitdiff
path: root/flower
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2014-06-01 16:30:04 +0200
committerDavid Kastrup <dak@gnu.org>2014-06-05 12:35:23 +0200
commit6b2653e61912ebdf4391bcbee98fa87c30092523 (patch)
tree515b7dbf668e2ef46dbd8208b3b621137fdd1642 /flower
parentaec3038c12fcbe66f695e947dc606a2c7dc9ada8 (diff)
Issue 3925: lilypond -d leads to weird output
C++ string manipulation is a fragile bolt-on onto the type system. "-" + 'd' evaluates to a pointer 100 bytes after a constant string "-" in the data section. This fixes this bug, and also changes the fixed message from lilypond: option `-d, `--define-default'' requires an argument to lilypond: option `-d, --define-default' requires an argument In general, it does not appear to make sense quoting the long options while not quoting the short options.
Diffstat (limited to 'flower')
-rw-r--r--flower/getopt-long.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/flower/getopt-long.cc b/flower/getopt-long.cc
index 458c2374ca..0d6da2c60e 100644
--- a/flower/getopt-long.cc
+++ b/flower/getopt-long.cc
@@ -103,11 +103,11 @@ Long_option_init::to_string () const
{
string str;
if (shortname_char_)
- str += "-" + shortname_char_;
+ str += string ("-") + shortname_char_;
if (shortname_char_ && longname_str0_)
str += ", ";
if (longname_str0_)
- str += string ("`--") + longname_str0_ + "'";
+ str += string ("--") + longname_str0_;
return str;
}