]> git.donarmstrong.com Git - lilypond.git/blobdiff - flower/getopt-long.cc
release: 1.3.91
[lilypond.git] / flower / getopt-long.cc
index 6945a6a5b91c8f579afea32b7b3a20d7702e9b4a..22d5c05600a2b2d5474f63fbce107a8470ce4d3b 100644 (file)
@@ -4,19 +4,23 @@
    this is (Copyleft) 1996, Han-Wen Nienhuys, <hanwen@cs.uu.nl>
  */
 
+#include <string.h>
 #include <stdio.h>
 #include <iostream.h>
 #include <assert.h>
+#include <stdlib.h>
+
 #include "config.h"
 #include "getopt-long.hh"
 #include "international.hh"
 #include "string-convert.hh"
 
+
 #if !HAVE_GETTEXT
 inline char*
 gettext (char const* s)
 {
-  return s;
+  return (char*)s;
 }
 #else
 #include <libintl.h>
@@ -138,22 +142,24 @@ Getopt_long::report (Errorcod c)
   switch (c)
     {
     case E_ARGEXPECT:
-      str += _f ("option `%s\' requires an argument",
+      str += _f ("option `%s' requires an argument",
        found_option_l_->str ());
       break;
     case  E_NOARGEXPECT:
-      str += _f ("option `%s\' doesn't allow an argument",
+      str += _f ("option `%s' doesn't allow an argument",
        found_option_l_->str ());
       break;
     case E_UNKNOWNOPTION:
-      str += _f ("unrecognized option: `%s\'",
+      str += _f ("unrecognized option: `%s'",
       String (argument_index_i_ 
-             ? String ("-" + _f("%c",arg_value_ch_a_a_[array_index_i_][argument_index_i_]))
+             ? String ("-" + String_convert::form_str ("%c", 
+               arg_value_ch_a_a_[array_index_i_][argument_index_i_]))
              : String (arg_value_ch_a_a_[array_index_i_])));
       break;
     case E_ILLEGALARG:
-      str += _f ("invalid argument `%s\' to option `%s'",
+      str += _f ("invalid argument `%s' to option `%s'",
         optional_argument_ch_C_, found_option_l_->str ());
+      break;
     default:
       assert (false);
     }