Changeset 1838
- Timestamp:
- 10/17/06 22:58:02 (2 years ago)
- Files:
-
- trunk/swish-e/Makefile.am (modified) (1 diff)
- trunk/swish-e/src/docprop.c (modified) (1 diff)
- trunk/swish-e/src/entities.c (modified) (1 diff)
- trunk/swish-e/src/extprog.c (modified) (1 diff)
- trunk/swish-e/src/filter.c (modified) (3 diffs)
- trunk/swish-e/src/rank.c (modified) (2 diffs)
- trunk/swish-e/src/search.c (modified) (11 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/swish-e/Makefile.am
r1765 r1838 41 41 perl/README \ 42 42 perl/Makefile.PL \ 43 perl/Makefile.mingw \ 43 44 perl/API.pm \ 44 45 perl/API.xs \ trunk/swish-e/src/docprop.c
r1778 r1838 186 186 unsigned long l; 187 187 }; 188 unsigned long convPropValue2ULong( char *propValue)188 unsigned long convPropValue2ULong(unsigned char *propValue) 189 189 { 190 190 union _conv_ u; trunk/swish-e/src/entities.c
r1736 r1838 648 648 int charEntityDecode(unsigned char *s, unsigned char **end) 649 649 { 650 unsigned char *s1, 651 *t; 652 char *e_end; 650 unsigned char *s1, *t, *e_end; 653 651 unsigned char s_cmp[MAX_ENTITY_LEN + 1]; 654 652 int len; trunk/swish-e/src/extprog.c
r1825 r1838 215 215 216 216 217 / /***JMRUIZ efree(rd_buffer);217 /* **JMRUIZ efree(rd_buffer); */ 218 218 fclose( out ); 219 219 trunk/swish-e/src/filter.c
r1826 r1838 44 44 #include "error.h" 45 45 #include "filter.h" 46 #include <stdlib.h> 46 47 47 48 … … 347 348 348 349 sprintf(filtercmd, "%s %s", prog, cmd_opts); 350 351 if (getenv("SWISH_DEBUG")) 352 fprintf(stderr, "FilterCmd: %s\n", filtercmd); 349 353 350 354 fp = popen(filtercmd, F_READ_TEXT); /* Open stream */ … … 493 497 void stringQuote(char *str) 494 498 { 495 char *copy ;499 char *copy,*orig; 496 500 497 501 copy = (char *) emalloc(strlen(str)+1); 502 orig = copy; 498 503 strcpy(copy, str); 499 504 500 for ( ;*copy; ) { 501 if (!isalnum(*copy) && (*copy != '/') ) { 502 *str++ = '\\'; 503 } 504 *str++ = *copy++; 505 for ( ;*copy; ) 506 { 507 /* 508 if (! isalnum(*copy) 509 && (*copy != '/') 510 && (*copy != '_') 511 && (*copy != '-') 512 && (*copy != '.') 513 514 ) 515 */ 516 if ( (*copy == '\'') || (*copy == '"') ) 517 { 518 *str++ = '\\'; 519 } 520 *str++ = *copy++; 505 521 } 506 522 *str = 0; 507 523 508 efree( copy);509 } 524 efree(orig); 525 } trunk/swish-e/src/rank.c
r1783 r1838 358 358 getrankDEF( RESULT *r ) 359 359 { 360 int *posdata;360 unsigned int *posdata; 361 361 int meta_bias; 362 362 IndexFILE *indexf; … … 516 516 { 517 517 518 int *posdata;518 unsigned int *posdata; 519 519 int meta_bias; 520 520 IndexFILE *indexf; trunk/swish-e/src/search.c
r1825 r1838 1462 1462 ** faster proccess */ 1463 1463 1464 for(i = j = 0, p = q = posdata; i < frequency; i++, p++)1464 for(i = j = 0, p = q = (int)posdata; i < frequency; i++, p++) 1465 1465 { 1466 1466 if(GET_STRUCTURE(*p) & structure) … … 1505 1505 int rLen; 1506 1506 int tLen; 1507 char *q;1507 unsigned char *q; 1508 1508 RESULT_LIST *l_rp, *l_rp2; 1509 1509 sw_off_t wordID; … … 1570 1570 1571 1571 /* Second: Look for question mark somewhere in the word */ 1572 strcpy(remains, "");1572 strcpy(remains, (unsigned char)""); 1573 1573 rLen = 0; 1574 1574 tLen = strlen(word); … … 1592 1592 { 1593 1593 strcpy(remains, q); // including the first "?" 1594 rLen = strlen( remains);1594 rLen = strlen((char)remains); 1595 1595 *q = '\0'; 1596 1596 } … … 1614 1614 else /* There is a wildcard. So use the sequential approach */ 1615 1615 { 1616 char *resultword;1616 unsigned char *resultword; 1617 1617 1618 1618 if (*word == '*') … … 1646 1646 if (rLen) 1647 1647 { 1648 char *pw, *ps;1648 unsigned char *pw, *ps; 1649 1649 int found = 0; 1650 1650 pw = &remains[0]; … … 1658 1658 { 1659 1659 // no wildcard "*" at end, so length should exactly match 1660 if ((pw == (char*)&remains[strlen( remains) - 1]) && (*(ps + 1) == '\0'))1660 if ((pw == (char*)&remains[strlen((char)remains) - 1]) && (*(ps + 1) == '\0')) 1661 1661 found = 1; 1662 1662 else … … 1666 1666 { 1667 1667 // wildcard at end, so ignore length 1668 if (pw == (char*)&remains[strlen( remains) - 1])1668 if (pw == (char*)&remains[strlen((char)remains) - 1]) 1669 1669 found = 1; 1670 1670 else … … 1679 1679 if (!p) 1680 1680 { 1681 if ((pw == (char*)&remains[strlen( remains) - 1]) && (*(ps + 1) == '\0'))1681 if ((pw == (char*)&remains[strlen((char)remains) - 1]) && (*(ps + 1) == '\0')) 1682 1682 found = 1; 1683 1683 } 1684 1684 else 1685 1685 { 1686 if (pw == (char*)&remains[strlen( remains) - 1])1686 if (pw == (char*)&remains[strlen((char)remains) - 1]) 1687 1687 found = 1; 1688 1688 } … … 1692 1692 if (!found) 1693 1693 { 1694 char *resultword;1694 unsigned char *resultword; 1695 1695 1696 1696 /* Jump to next word */ … … 1807 1807 else 1808 1808 { 1809 char *resultword;1809 unsigned char *resultword; 1810 1810 1811 1811 /* Jump to next word */
