Subversion Repositories wimsdev

Rev

Rev 13757 | Rev 14165 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 13757 Rev 13783
Line 1443... Line 1443...
1443
 
1443
 
1444
/* replace html symbols by their iso translation */
1444
/* replace html symbols by their iso translation */
1445
void calc_html2iso(char *p)
1445
void calc_html2iso(char *p)
1446
{
1446
{
1447
  int st, ns;
1447
  int st, ns;
1448
  unsigned char *s = (unsigned char *)p, *q=s;
1448
  unsigned char buffer[MAX_LINELEN], *s = buffer;
1449
  inithtmltrans();
1449
  inithtmltrans();
-
 
1450
  strcpy((char *)buffer, p);
1450
  while (*s)
1451
  while (*s)
1451
    if (*s == '&'){
1452
    if (*s == '&'){
1452
        unsigned char *p1 = ++s;
1453
        unsigned char *p1 = ++s;
1453
        for (st = 0; (ns = htmltrans[abs(st)][*s]); st = ns)
1454
        for (st = 0; (ns = htmltrans[abs(st)][*s]); st = ns)
1454
           s++;
1455
           s++;
1455
        if (st > 0 && *s == ';')
1456
        if (st > 0 && *s == ';')
1456
          {char *r=htmlsymbs[st][1]; strcpy((char *)q, r); s++; q+=strlen(r);}
1457
          {char *r=htmlsymbs[st][1]; strcpy((char *)p, r); s++; p+=strlen(r);}
1457
        else
1458
        else
1458
          {*q++='&'; s=p1;}
1459
          {*p++='&'; s=p1;}
1459
      }
1460
      }
1460
    else *q++=*s++;
1461
    else *p++=*s++;
1461
  *q = 0;
1462
  *p = 0;
1462
}
1463
}
1463
 
1464
 
1464
/* prepare a string to be inserted into a form input or textarea as is */
1465
/* prepare a string to be inserted into a form input or textarea as is */
1465
void calc_reinput(char *p)
1466
void calc_reinput(char *p)
1466
{
1467
{