10 |
|
*/ |
11 |
|
|
12 |
|
#include <ctype.h> |
13 |
< |
#include <stdio.h> |
13 |
> |
#ifndef _WIN32 |
14 |
> |
#include <unistd.h> |
15 |
> |
#endif |
16 |
|
|
17 |
|
#include "standard.h" |
18 |
|
#include "platform.h" |
43 |
|
|
44 |
|
int stdinused = 0; /* stdin has been used by -f option? */ |
45 |
|
|
46 |
< |
char mainfn[MAXPATH]; /* main file name */ |
46 |
> |
char mainfn[PATH_MAX]; /* main file name */ |
47 |
|
FILE *mainfp = NULL; /* main file pointer */ |
48 |
|
|
49 |
|
#define progname (xav[0]) |
890 |
|
openmain(iname) /* open input, changing directory for file */ |
891 |
|
char *iname; |
892 |
|
{ |
893 |
< |
static char origdir[MAXPATH]; |
894 |
< |
static char curfn[MAXPATH]; |
893 |
> |
static char origdir[PATH_MAX]; |
894 |
> |
static char curfn[PATH_MAX]; |
895 |
|
static int diffdir; |
896 |
|
register char *fpath; |
897 |
|
|
917 |
|
return; |
918 |
|
} |
919 |
|
if (mainfp == NULL) { /* first call, initialize */ |
920 |
< |
getwd(origdir); |
920 |
> |
getcwd(origdir, sizeof(origdir)); |
921 |
|
} else if (!strcmp(iname, curfn)) { /* just need to rewind? */ |
922 |
|
rewind(mainfp); |
923 |
|
return; |