/* Load a 'macro' file */
else if (i == '1')
{
+ errr err;
+
/* Prompt */
#ifdef JP
prt("¥³¥Þ¥ó¥É: ¥æ¡¼¥¶¡¼ÀßÄê¥Õ¥¡¥¤¥ë¤Î¥í¡¼¥É", 16, 0);
if (!askfor_aux(tmp, 80)) continue;
/* Process the given filename */
- if (0 != process_pref_file(tmp))
+ err = process_pref_file(tmp);
+ if (-2 == err)
+ {
+#ifdef JP
+ msg_format("ɸ½à¤ÎÀßÄê¥Õ¥¡¥¤¥ë'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
+#else
+ msg_format("Loaded default '%s'.", tmp);
+#endif
+ }
+ else if (err)
{
/* Prompt */
#ifdef JP
- msg_print("¥Õ¥¡¥¤¥ë¤òÆɤ߹þ¤á¤Þ¤»¤ó¤Ç¤·¤¿¡ª");
+ msg_format("'%s'¤ÎÆɤ߹þ¤ß¤Ë¼ºÇÔ¤·¤Þ¤·¤¿¡ª", tmp);
#else
- msg_print("Could not load file!");
+ msg_format("Failed to load '%s'!");
+#endif
+ }
+ else
+ {
+#ifdef JP
+ msg_format("'%s'¤òÆɤ߹þ¤ß¤Þ¤·¤¿¡£", tmp);
+#else
+ msg_format("Loaded '%s'.", tmp);
#endif
-
}
}
int ob = option_info[i].o_bit;
if (option_info[i].o_var &&
- option_info[i].o_text &&
- streq(option_info[i].o_text, buf + 2) &&
- (!alive || option_info[i].o_page !=6))
+ option_info[i].o_text &&
+ streq(option_info[i].o_text, buf + 2))
{
+ if (alive && 6 == option_info[i].o_page)
+ {
+#ifdef JP
+ msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
+#else
+ msg_format("Startup options can not changed! '%s'", buf);
+#endif
+ msg_print(NULL);
+ return 0;
+ }
+
/* Clear */
option_flag[os] &= ~(1L << ob);
(*option_info[i].o_var) = FALSE;
}
/* don't know that option. ignore it.*/
- msg_format("Ignored wrong option %s.", buf+2);
+#ifdef JP
+ msg_format("¥ª¥×¥·¥ç¥ó¤Î̾Á°¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡§ %s", buf);
+#else
+ msg_format("Ignored invalid option: %s", buf);
+#endif
msg_print(NULL);
return 0;
}
int ob = option_info[i].o_bit;
if (option_info[i].o_var &&
- option_info[i].o_text &&
- streq(option_info[i].o_text, buf + 2) &&
- (!alive || option_info[i].o_page !=6))
+ option_info[i].o_text &&
+ streq(option_info[i].o_text, buf + 2))
{
+ if (alive && 6 == option_info[i].o_page)
+ {
+#ifdef JP
+ msg_format("½é´ü¥ª¥×¥·¥ç¥ó¤ÏÊѹ¹¤Ç¤¤Þ¤»¤ó! '%s'", buf);
+#else
+ msg_format("Startup options can not changed! '%s'", buf);
+#endif
+ msg_print(NULL);
+ return 0;
+ }
+
/* Set */
option_flag[os] |= (1L << ob);
(*option_info[i].o_var) = TRUE;
}
/* don't know that option. ignore it.*/
- msg_format("Ignored wrong option %s.", buf+2);
+#ifdef JP
+ msg_format("¥ª¥×¥·¥ç¥ó¤Î̾Á°¤¬Àµ¤·¤¯¤¢¤ê¤Þ¤»¤ó¡§ %s", buf);
+#else
+ msg_format("Ignored invalid option: %s", buf);
+#endif
msg_print(NULL);
return 0;
}
{
char buf[1024];
- errr err = 0;
+ errr err1, err2;
/* Build the filename */
path_build(buf, 1024, ANGBAND_DIR_PREF, name);
- /* Process the pref file */
- err = process_pref_file_aux(buf, FALSE);
+ /* Process the system pref file */
+ err1 = process_pref_file_aux(buf, FALSE);
/* Stop at parser errors, but not at non-existing file */
- if (err < 1)
- {
- /* Drop priv's */
- safe_setuid_drop();
+ if (err1 > 0) return err1;
- /* Build the filename */
- path_build(buf, 1024, ANGBAND_DIR_USER, name);
- /* Process the pref file */
- err = process_pref_file_aux(buf, FALSE);
+ /* Drop priv's */
+ safe_setuid_drop();
+
+ /* Build the filename */
+ path_build(buf, 1024, ANGBAND_DIR_USER, name);
+
+ /* Process the user pref file */
+ err2 = process_pref_file_aux(buf, FALSE);
- /* Grab priv's */
- safe_setuid_grab();
- }
+ /* Grab priv's */
+ safe_setuid_grab();
- /* Result */
- return (err);
+
+ /* User file does not exist, but read system pref file */
+ if (err2 < 0 && !err1)
+ return -2;
+
+ /* Result of user file processing */
+ return err2;
}