Changeset 1838

Show
Ignore:
Timestamp:
10/17/06 22:58:02 (2 years ago)
Author:
karman
Message:

added Makefile.mingw so it actually gets packaged with distrib

fixed mixmatched signed/unsigned char defs to fix gcc 4.x warnings

stringQuote() change to fix double free() and only escape quotes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/swish-e/Makefile.am

    r1765 r1838  
    4141    perl/README \ 
    4242    perl/Makefile.PL \ 
     43    perl/Makefile.mingw \ 
    4344    perl/API.pm \ 
    4445    perl/API.xs \ 
  • trunk/swish-e/src/docprop.c

    r1778 r1838  
    186186      unsigned long   l; 
    187187}; 
    188 unsigned long convPropValue2ULong(char *propValue) 
     188unsigned long convPropValue2ULong(unsigned char *propValue) 
    189189{ 
    190190      union _conv_ u; 
  • trunk/swish-e/src/entities.c

    r1736 r1838  
    648648int     charEntityDecode(unsigned char *s, unsigned char **end) 
    649649{ 
    650     unsigned char *s1, 
    651            *t; 
    652     char *e_end; 
     650    unsigned char *s1, *t, *e_end; 
    653651    unsigned char s_cmp[MAX_ENTITY_LEN + 1]; 
    654652    int     len; 
  • trunk/swish-e/src/extprog.c

    r1825 r1838  
    215215 
    216216 
    217 //***JMRUIZ    efree(rd_buffer); 
     217/* **JMRUIZ    efree(rd_buffer);  */ 
    218218    fclose( out ); 
    219219 
  • trunk/swish-e/src/filter.c

    r1826 r1838  
    4444#include "error.h" 
    4545#include "filter.h" 
     46#include <stdlib.h> 
    4647 
    4748 
     
    347348 
    348349    sprintf(filtercmd, "%s %s", prog, cmd_opts); 
     350     
     351    if (getenv("SWISH_DEBUG")) 
     352        fprintf(stderr, "FilterCmd: %s\n", filtercmd); 
    349353 
    350354    fp = popen(filtercmd, F_READ_TEXT); /* Open stream */ 
     
    493497void stringQuote(char *str) 
    494498{ 
    495     char *copy
     499    char *copy,*orig
    496500     
    497501    copy = (char *) emalloc(strlen(str)+1); 
     502    orig = copy; 
    498503    strcpy(copy, str); 
    499504 
    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++; 
    505521    } 
    506522    *str = 0; 
    507523     
    508     efree(copy); 
    509 } 
     524    efree(orig); 
     525} 
  • trunk/swish-e/src/rank.c

    r1783 r1838  
    358358getrankDEF( RESULT *r ) 
    359359{ 
    360     int        *posdata; 
     360    unsigned int        *posdata; 
    361361    int         meta_bias; 
    362362    IndexFILE  *indexf; 
     
    516516{ 
    517517 
    518     int        *posdata; 
     518    unsigned int        *posdata; 
    519519    int         meta_bias; 
    520520    IndexFILE  *indexf; 
  • trunk/swish-e/src/search.c

    r1825 r1838  
    14621462                 ** faster proccess */ 
    14631463     
    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++) 
    14651465    { 
    14661466        if(GET_STRUCTURE(*p) & structure) 
     
    15051505    int           rLen; 
    15061506    int           tLen; 
    1507     char   *q; 
     1507    unsigned char   *q; 
    15081508    RESULT_LIST *l_rp, *l_rp2; 
    15091509    sw_off_t    wordID; 
     
    15701570 
    15711571    /* Second: Look for question mark somewhere in the word */ 
    1572     strcpy(remains, ""); 
     1572    strcpy(remains, (unsigned char)""); 
    15731573    rLen = 0; 
    15741574    tLen = strlen(word); 
     
    15921592            { 
    15931593                strcpy(remains, q);   // including the first "?" 
    1594                 rLen = strlen(remains); 
     1594                rLen = strlen((char)remains); 
    15951595                *q = '\0'; 
    15961596            } 
     
    16141614    else  /* There is a wildcard. So use the sequential approach */ 
    16151615    {        
    1616         char   *resultword; 
     1616        unsigned char   *resultword; 
    16171617 
    16181618        if (*word == '*') 
     
    16461646       if (rLen) 
    16471647       { 
    1648           char *pw, *ps; 
     1648          unsigned char *pw, *ps; 
    16491649          int found = 0; 
    16501650          pw = &remains[0]; 
     
    16581658              { 
    16591659                // 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')) 
    16611661                  found = 1; 
    16621662                else 
     
    16661666              { 
    16671667                // wildcard at end, so ignore length 
    1668                 if (pw == (char*)&remains[strlen(remains) - 1]) 
     1668                if (pw == (char*)&remains[strlen((char)remains) - 1]) 
    16691669                  found = 1; 
    16701670                else 
     
    16791679            if (!p) 
    16801680            { 
    1681               if ((pw == (char*)&remains[strlen(remains) - 1]) && (*(ps + 1) == '\0')) 
     1681              if ((pw == (char*)&remains[strlen((char)remains) - 1]) && (*(ps + 1) == '\0')) 
    16821682                found = 1; 
    16831683            } 
    16841684            else 
    16851685            { 
    1686               if (pw == (char*)&remains[strlen(remains) - 1]) 
     1686              if (pw == (char*)&remains[strlen((char)remains) - 1]) 
    16871687                found = 1; 
    16881688            } 
     
    16921692          if (!found) 
    16931693          { 
    1694             char   *resultword; 
     1694            unsigned char   *resultword; 
    16951695 
    16961696            /* Jump to next word */ 
     
    18071807        else 
    18081808        { 
    1809             char   *resultword; 
     1809            unsigned char   *resultword; 
    18101810 
    18111811            /* Jump to next word */