mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
parent
2f56ccafe0
commit
d5a4e534ae
1 changed files with 27 additions and 13 deletions
|
@ -15,6 +15,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
|
@ -37,7 +38,7 @@ int AnalyzeFile();
|
||||||
/*====[Globals]====*/
|
/*====[Globals]====*/
|
||||||
FILE* manfile;
|
FILE* manfile;
|
||||||
char OpenFlag=0;
|
char OpenFlag=0;
|
||||||
char manpath[MAXLINE]="c:\\man\\";
|
char manpath[MAX_PATH];
|
||||||
/*=================*/
|
/*=================*/
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -49,21 +50,34 @@ SetCl(WORD cl)
|
||||||
int
|
int
|
||||||
OpenF(char* name)
|
OpenF(char* name)
|
||||||
{
|
{
|
||||||
int retval=0;
|
int ret = 0;
|
||||||
char *manpath_local=(char*)malloc(sizeof(char)*MAXLINE);
|
char *cp;
|
||||||
|
|
||||||
strcpy(manpath_local, manpath); //save mandir value
|
/* C:\man\\... */
|
||||||
|
cp = getenv("SystemDrive");
|
||||||
if((manfile=fopen((strcat(manpath_local,name)),"r"))!=NULL)
|
if (cp && *cp)
|
||||||
{
|
{
|
||||||
OpenFlag=1;
|
strcpy(manpath, cp);
|
||||||
AnalyzeFile();
|
strcat(manpath, "\\man\\");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
retval=-1;
|
{
|
||||||
|
strcpy(manpath, "C:\\man\\");
|
||||||
|
}
|
||||||
|
strcat(manpath, name);
|
||||||
|
|
||||||
free(manpath_local);
|
manfile = fopen(manpath, "r");
|
||||||
return retval;
|
if (manfile != NULL)
|
||||||
|
{
|
||||||
|
OpenFlag = 1;
|
||||||
|
AnalyzeFile();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ret = -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int
|
||||||
|
|
Loading…
Reference in a new issue