Bugfix for linux port

git-svn-id: svn://kolibrios.org@7545 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
tsdima 2018-11-09 18:21:10 +00:00
parent 60e27afe74
commit 490fec6653
4 changed files with 17 additions and 48 deletions

View File

@ -222,45 +222,6 @@ int MakePE();
int MakeObj();
void CheckUndefClassProc();
/*
PAVEL YAKOV
char* strupr(char* s)
{
char* p = s;
while (*p = toupper(*p)) p++;
return s;
}
char* strlwr(char* s)
{
char* p = s;
while (*p = tolower(*p)) p++;
return s;
}
int strnicmp(const char* s1, const char* s2, int len)
{
unsigned char c1,c2;
if(!len)
return 0;
do{
c1 = *s1++;
c2 = *s2++;
if (!c1||!c2)
break;
if (c1 == c2)
continue;
c1 = tolower(c1);
c2 = tolower(c2);
if (c1!=c2)
break;
} while (--len);
return (int)c1 - (int)c2;
}
*/
/*
void PrintTegList(structteg *tteg)
{
@ -1175,6 +1136,9 @@ void * MALLOC (unsigned long size)
void *mem;
mem=malloc(size);
if(mem==NULL)OutMemory();
#ifdef _UNIX_
else memset(mem,0,size);
#endif
// if(((unsigned long)mem+size)>maxusedmem)maxusedmem=(unsigned long)mem+size;

View File

@ -92,18 +92,17 @@ int MultiByteToWideChar(unsigned int,unsigned int,char*,int,wchar_t *,int);
#endif
char* strupr(char* s);
char* strlwr(char* s);
int stricmp(const char*, const char*);
int strnicmp(const char*, const char*, int);
#ifdef _PORT_CPP_
long lseek (int, long, int);
char tolower(char c);
char toupper(char c);
char* strupr(char* s);
char* strlwr(char* s);
int stricmp(const char*, const char*);
int strnicmp(const char*, const char*, int);
char * getcwd (char *buffer, int size);
int stat (const char*, struct _stat*);

View File

@ -9081,7 +9081,7 @@ COM_MOD *bmod;
if(itok.type==tp_opperand)operand=tok;
else{
i++;
if(bufrm)free(bufrm);
if(bufrm){ free(bufrm); bufrm=NULL; }
if(strinf.bufstr)free(strinf.bufstr);
switch(operand){
case tk_div:
@ -9136,7 +9136,7 @@ COM_MOD *bmod;
cha2=ocha;
endoffile=0;
// printf("input=%08X inptr=%08X %s\n",input,inptr2,input+inptr2);
// if(bufrm)free(bufrm);
// if(bufrm) { free(bufrm); bufrm=NULL; }
// if(strinf.bufstr)free(strinf.bufstr);
bufrm=obuf;
strinf=ostr;
@ -9746,7 +9746,7 @@ newloop:
else{
if(tok!=tk_number&&tok!=tk_postnumber&&tok!=tk_undefofs){
if(j>1)j=0;
if(bufrm)free(bufrm);
if(bufrm){ free(bufrm); bufrm=NULL; }
if(strinf.bufstr)free(strinf.bufstr);
}
else if(j>1)j--;

View File

@ -178,6 +178,9 @@ int hold;
for(int i=0;i<=numfindpath;i++){
sprintf((char *)string2,"%s%s",findpath[(firstflag==0?i:numfindpath-i)],filename);
#ifndef _WIN32_
for(char* p=(char *)string2; *p; ++p) if(*p=='\\') *p='/';
#endif
if((hold=loadinputfile((char *)string2))!=-2)break;
if(firstflag==2||(firstflag==0&&(i+1)==numfindpath))break;
}
@ -8600,6 +8603,9 @@ long filesize;
stringexpected();
return(0);
}
#ifndef _WIN32_
for(char* p=(char *)string3; *p; ++p) if(*p=='\\') *p='/';
#endif
filehandle=open((char *)string3,O_BINARY|O_RDONLY);
if(filehandle==-1){
unableopenfile((char *)string3);