[MPlayer-dev-eng] octal and hex surprise and perplex

Alan Curry pacman at theworld.com
Fri Jun 9 20:50:38 CEST 2006


I wrote:
>My little hint is easier and didn't anger anyone, so I'll go ahead and commit
>it (as a translatable string).

Just to make sure I'm not overlooking some rules about translatable strings,
here's one more preview:

Index: help/help_mp-en.h
===================================================================
--- help/help_mp-en.h	(revision 18651)
+++ help/help_mp-en.h	(working copy)
@@ -507,6 +507,9 @@
 #define MSGTR_UnknownProfile "Unknown profile '%s'.\n"
 #define MSGTR_Profile "Profile %s: %s\n"
 
+// m_option.c
+#define MSGTR_LeadingZeroOctalHint "Don't start a number with zero unless you intend it to be octal\n"
+
 // m_property.c
 #define MSGTR_PropertyListHeader "\n Name                 Type            Min        Max\n\n"
 #define MSGTR_TotalProperties "\nTotal: %d properties\n"
Index: m_option.c
===================================================================
--- m_option.c	(revision 18651)
+++ m_option.c	(working copy)
@@ -15,6 +15,7 @@
 #include "m_option.h"
 //#include "m_config.h"
 #include "mp_msg.h"
+#include "help_mp.h"
 #include "libmpdemux/url.h"
 
 // Don't free for 'production' atm
@@ -146,6 +147,10 @@
   tmp_int = strtol(param, &endptr, 0);
   if (*endptr) {
     mp_msg(MSGT_CFGPARSER, MSGL_ERR, "The %s option must be an integer: %s\n",name, param);
+    /* Extra hint for the mortals, who may not know about octal */
+    if(*param=='0' && (*endptr=='8' || *endptr=='9')) {
+      mp_msg(MSGT_CFGPARSER, MSGL_HINT, MSGTR_LeadingZeroOctalHint);
+    }
     return M_OPT_INVALID;
   }
 



More information about the MPlayer-dev-eng mailing list