Russian Apache mailing list archive (apache-rus@lists.lexa.ru)
[Date Prev ][Date Next ][Thread Prev ][Thread Next ][Date Index ][Thread Index ]
Re: APACHE, APAche, Apache, apache
Алекс:
void
rev_convert_by_table_num(unsigned char *buf, int num,unsigned char *tab)
{
char buffer[3];
unsigned inchar;
while(num>=3){
if(*buf=='%' && isxdigit(buf[1]) && isxdigit(buf[2])){
buffer[0]=buf[1];
buffer[1]=buf[2];
buffer[2]=0;
sscanf(buffer,"%02X",&inchar);
inchar=(unsigned)tab[inchar];
sprintf(buffer,"%02X",inchar);
buf[1]=buffer[0];buf[2]=buffer[1];
num-=2;
buf+=2;
}
--num;
++buf;
}
}
на:
void
rev_convert_by_table_num(unsigned char *buf, int num,unsigned char *tab)
{
char buffer[3];
unsigned inchar,inchar1;
while(num>=3){
if(*buf=='%' && isxdigit(buf[1]) && isxdigit(buf[2])){
buffer[0]=buf[1];
buffer[1]=buf[2];
buffer[2]=0;
sscanf(buffer,"%02X",&inchar);
inchar1=(unsigned)tab[inchar];
if(inchar1!=inchar)
{
sprintf(buffer,"%02X",inchar1);
buf[1]=buffer[0];buf[2]=buffer[1];
}
num-=2;
buf+=2;
}
--num;
++buf;
}
}
Тогда и с upload'om меньше проблем.... :)
o Artem art@radio-msu.net
/O> Podstreshny MSU Moscow Russia
|\ Good luck! http://www.radio-msu.net/~art/
Спонсоры сайта:
"Russian Apache" includes software developed
by the Apache Group for use in the Apache HTTP server project
(http://www.apache.org/) See
Apache LICENSE .
Copyright (C) 1995-2001 The Apache Group. All rights reserved.
Copyright (C) 1996 Dm. Kryukov; Copyright (C)
1997-2009 Alex Tutubalin . Design (C) 1998 Max Smolev.