OSDN Git Service

毒針を装備している時は必ず攻撃回数を1にするようにした。(乱れ雪月花で増えない)
[hengband/hengband.git] / src / main.c
index 4d47d01..d115fb0 100644 (file)
@@ -29,6 +29,9 @@ static void quit_hook(cptr s)
 {
        int j;
 
+       /* Unused */
+       (void)s;
+
        /* Scan windows */
        for (j = 8 - 1; j >= 0; j--)
        {
@@ -73,9 +76,6 @@ static void create_user_dir(void)
        char dirpath[1024];
        char subdirpath[1024];
 
-       /* Drop privs */
-       safe_setuid_drop();
-
        /* Get an absolute path from the filename */
        path_parse(dirpath, 1024, PRIVATE_USER_PATH);
 
@@ -83,13 +83,10 @@ static void create_user_dir(void)
        mkdir(dirpath, 0700);
 
        /* Build the path to the variant-specific sub-directory */
-       path_build(subdirpath, 1024, dirpath, VERSION_NAME);
+       path_build(subdirpath, sizeof(subdirpath), dirpath, VERSION_NAME);
 
        /* Create the directory */
        mkdir(subdirpath, 0700);
-
-       /* Grab privs */
-       safe_setuid_grab();
 }
 
 #endif /* PRIVATE_USER_PATH */
@@ -164,7 +161,7 @@ static void change_path(cptr info)
        cptr s;
 
        /* Find equal sign */
-       s = strchr(info, '=');
+       s = my_strchr(info, '=');
 
        /* Verify equal sign */
        if (!s) quit_fmt("Try '-d<what>=<path>' not '-d%s'", info);
@@ -364,6 +361,10 @@ int main(int argc, char *argv[])
 #endif
 
 
+       /* Drop permissions */
+       safe_setuid_drop();
+
+
 #ifdef SET_UID
 
        /* Initialize the "time" checker */
@@ -546,6 +547,51 @@ int main(int argc, char *argv[])
                                puts("  -u<who>  Use your <who> savefile");
                                puts("  -m<sys>  Force 'main-<sys>.c' usage");
                                puts("  -d<def>  Define a 'lib' dir sub-path");
+                               puts("");
+
+#ifdef USE_X11
+                               puts("  -mx11    To use X11");
+                               puts("  --       Sub options");
+                               puts("  -- -d    Set display name");
+                               puts("  -- -o    Request old 8x8 tile graphics");
+                               puts("  -- -a    Request Adam Bolt 16x16 tile graphics");
+                               puts("  -- -b    Request Bigtile graphics mode");
+                               puts("  -- -s    Turn off smoothscaling graphics");
+                               puts("  -- -n#   Number of terms to use");
+                               puts("");
+#endif /* USE_X11 */
+
+#ifdef USE_GCU
+                               puts("  -mgcu    To use GCU (GNU Curses)");
+#endif /* USE_GCU */
+
+#ifdef USE_CAP
+                               puts("  -mcap    To use CAP (\"Termcap\" calls)");
+#endif /* USE_CAP */
+
+#ifdef USE_DOS
+                               puts("  -mdos    To use DOS (Graphics)");
+#endif /* USE_DOS */
+
+#ifdef USE_IBM
+                               puts("  -mibm    To use IBM (BIOS text mode)");
+#endif /* USE_IBM */
+
+#ifdef USE_SLA
+                               puts("  -msla    To use SLA (SLANG)");
+#endif /* USE_SLA */
+
+#ifdef USE_LSL
+                               puts("  -mlsl    To use LSL (Linux-SVGALIB)");
+#endif /* USE_LSL */
+
+#ifdef USE_AMI
+                               puts("  -mami    To use AMI (Amiga)");
+#endif /* USE_AMI */
+
+#ifdef USE_VME
+                               puts("  -mvme    To use VME (VAX/ESA)");
+#endif /* USE_VME */
 
                                /* Actually abort the process */
                                quit(NULL);
@@ -570,9 +616,6 @@ int main(int argc, char *argv[])
        quit_aux = quit_hook;
 
 
-       /* Drop privs (so X11 will work correctly) */
-       safe_setuid_drop();
-
 
 #ifdef USE_XAW
        /* Attempt to use the "main-xaw.c" support */
@@ -724,10 +767,6 @@ int main(int argc, char *argv[])
 #endif
 
 
-       /* Grab privs (dropped above for X11) */
-       safe_setuid_grab();
-
-
        /* Make sure we have a display! */
        if (!done) quit("Unable to prepare any 'display module'!");