File: quit.c

package info (click to toggle)
ytree 1.65-4
  • links: PTS
  • area: main
  • in suites: potato
  • size: 556 kB
  • ctags: 774
  • sloc: ansic: 10,790; makefile: 118
file content (37 lines) | stat: -rw-r--r-- 665 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
/***************************************************************************
 *
 * $Header: /home/werner/ytree/RCS/quit.c,v 1.11 1998/11/11 19:02:48 werner Rel $
 *
 * Verlassen von ytree
 *
 * 
 ***************************************************************************/


#include "ytree.h"





void Quit(void)
{
  int term;
  char path[PATH_LENGTH + 1];
  char *p;

  term = InputChoise( "quit ytree (Y/N) ?", "YNQq\r\033" );

  if( term == 'Y' || term == 'Q' || term == 'q' )
  {
    if (( p = getenv("HOME") ))
    {
      sprintf(path, "%s%c%s", p, FILE_SEPARATOR_CHAR, HISTORY_FILENAME);
      SaveHistory(path);
    }
    endwin();
    exit( 0 );
  }
}