File: cmdexit.c

package info (click to toggle)
xshipwars 1.32-5
  • links: PTS
  • area: main
  • in suites: potato
  • size: 17,176 kB
  • ctags: 6,357
  • sloc: ansic: 157,152; makefile: 226; sh: 75
file content (41 lines) | stat: -rw-r--r-- 810 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include "xsw.h"
 
 
 
int CmdExit(char *arg)
{
	char *strptr;

	/* Check for exit option. */
	if(arg != NULL)
	{
	    /* No save on exit. */
	    strptr = strstr(arg, "nosave");
	    if(strptr != NULL)
	    {
		option.save_on_exit = 0;
	    }
            /* No save on exit. */
            strptr = strstr(arg, "no_save");
            if(strptr != NULL)
            {
                option.save_on_exit = 0;
            }

	    /* Yes comfermation (first letter must be a `y'). */
	    if(strcasepfx(arg, "y") ||
               strcasepfx(arg, "exit") ||
               strcasepfx(arg, "quit")
	    )
	    {
                /*   Switch runlevel to 1 to notify rest of program to
                 *   begin shutdown prcoess.
                 */
                runlevel = 1;
	    }
	}


        return(0);
}