From c3ace6a16119598cf5d63bc9443addbdb409f4cc Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 23 Mar 2014 18:48:16 +0000 Subject: [PATCH] WebView: fix F5, filesize git-svn-id: svn://kolibrios.org@4688 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/cmm/TWB/TWB.c | 9 -------- programs/cmm/TWB/parce_tag.h | 2 +- programs/cmm/browser/WebView.c | 4 +--- programs/cmm/lib/strings.h | 42 ++++++++++++++++++++++++++++------ 4 files changed, 37 insertions(+), 20 deletions(-) diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c index e1ab88544f..1ef586938c 100644 --- a/programs/cmm/TWB/TWB.c +++ b/programs/cmm/TWB/TWB.c @@ -100,15 +100,6 @@ void BufEncode(int set_new_encoding) cur_encoding = set_new_encoding; if (o_bufpointer==0) { - bufpointer_realsize = strlen(bufpointer); - if (bufpointer_realsize > bufsize) - { - debug("bufsize: "); - debugi(bufsize); - debug("bufpointer_realsize: "); - debugi(bufpointer_realsize); - bufsize = bufpointer_realsize; - } o_bufpointer = malloc(bufsize); strcpy(o_bufpointer, bufpointer); } diff --git a/programs/cmm/TWB/parce_tag.h b/programs/cmm/TWB/parce_tag.h index 8843c896e5..6909b06abb 100644 --- a/programs/cmm/TWB/parce_tag.h +++ b/programs/cmm/TWB/parce_tag.h @@ -1,6 +1,6 @@ unsigned int GetNextParam() { - byte kavichki = false; + byte kavichki=0; int i = strlen(#tagparam) - 1; if (!tagparam) return 0; diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index cd16b5ea49..900b72059c 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -382,9 +382,7 @@ void Scan(int id) } return; case 054: //F5 - IF(address_box.flags & 0b10) WB1.Parse(); - return; - + IF(address_box.flags & 0b10) return; case REFRESH: if (http_transfer > 0) { diff --git a/programs/cmm/lib/strings.h b/programs/cmm/lib/strings.h index 6055c867b7..4b14c13b9e 100644 --- a/programs/cmm/lib/strings.h +++ b/programs/cmm/lib/strings.h @@ -272,7 +272,7 @@ unsigned int strcpyb(dword search_in, copyin, startstr, endstr) } -/*void strcat(char *to, char *from) //òîæå ðàáîòàåò +/*void strcat(char *to, char *from) //òîæå ðàáîòàåò { while(*to) to++; while(*from) @@ -313,8 +313,8 @@ inline fastcall strupr( ESI) do{ AL=DSBYTE[ESI]; IF(AL>='a')IF(AL<='z')DSBYTE[ESI]=AL&0x5f; - IF (AL>=160) && (AL<=175) DSBYTE[ESI] = AL - 32; //à-ï - IF (AL>=224) && (AL<=239) DSBYTE[ESI] = AL - 80; //à-ï + IF (AL>=160) && (AL<=175) DSBYTE[ESI] = AL - 32; //à-ï + IF (AL>=224) && (AL<=239) DSBYTE[ESI] = AL - 80; //à-ï ESI++; }while(AL!=0); } @@ -335,17 +335,45 @@ inline fastcall strttl( EDX) { AL=DSBYTE[EDX]; IF(AL>='a')&&(AL<='z')DSBYTE[EDX]=AL&0x5f; - IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //à-ï - IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //à-ï + IF (AL>=160) && (AL<=175) DSBYTE[EDX] = AL - 32; //à-ï + IF (AL>=224) && (AL<=239) DSBYTE[EDX] = AL - 80; //à-ï do{ EDX++; AL=DSBYTE[EDX]; IF(AL>='A')&&(AL<='Z'){DSBYTE[EDX]=AL|0x20; CONTINUE;} - IF(AL>='€')&&(AL<='')DSBYTE[EDX]=AL|0x20; // -¯ - IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80; //à-ï + IF(AL>='€')&&(AL<='Â')DSBYTE[EDX]=AL|0x20; // -¯ + IF (AL>=144) && (AL<=159) DSBYTE[EDX] = AL + 80; //à-ï }while(AL!=0); } +void trim(char *s) +{ + // удалÑем пробелы и табы Ñ Ð½Ð°Ñ‡Ð°Ð»Ð° Ñтроки: + int i=0,j; + while((s[i]==' ')||(s[i]=='\t')||(s[i]=='\r')||(s[i]=='\n')) + { + i++; + } + if(i>0) + { + for(j=0;j