File: findpath.c

package info (click to toggle)
gltron 0.70final-9
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 5,208 kB
  • ctags: 5,051
  • sloc: ansic: 19,181; sh: 3,443; cpp: 973; makefile: 269
file content (47 lines) | stat: -rw-r--r-- 1,482 bytes parent folder | download | duplicates (9)
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
42
43
44
45
46
47
/*
    Loki_Update - A tool for updating Loki products over the Internet
    Copyright (C) 2000  Loki Software, Inc.

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation; either version 2 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

    info@lokigames.com
*/

/* I modified this file a little, removing unneeded features and making the
   thing compile ( Andreas Umbach <marvin@dataway.ch> ) */

#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifndef macintosh
#ifndef WIN32
#    include <unistd.h>
#endif
#endif

#ifndef PATH_MAX
#define PATH_MAX 8192
#endif

#if !defined(WIN32) && !defined(macintosh) && !defined(__APPLE__)
void goto_installpath(const char *argv0)
{
    if (chdir("/usr/share/games/gltron") < 0) {
        fprintf(stderr, "Couldn't change to install directory\n");
        exit(1); /* OK: critical, installation corrupt */
    }
}
#endif