Subversion Repositories wimsdev

Rev

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

Rev 10 Rev 3718
Line 27... Line 27...
27
char sepchar=':', grpchar=0;
27
char sepchar=':', grpchar=0;
28
 
28
 
29
/***************** Nothing should need change hereafter *****************/
29
/***************** Nothing should need change hereafter *****************/
30
 
30
 
31
#include "../wims.h"
31
#include "../wims.h"
-
 
32
#include "../Lib/basicstr.c"
32
 
33
 
33
char inpbuf[MAX_LINELEN+1], outbuf[2*MAX_LINELEN+2];
34
char inpbuf[MAX_LINELEN+1], outbuf[2*MAX_LINELEN+2];
34
char *dicbuf;
35
char *dicbuf;
35
char dicname[1024], suffixname[1024];
36
char dicname[1024], suffixname[1024];
36
 
37
 
Line 98... Line 99...
98
    va_start(vp,good);
99
    va_start(vp,good);
99
    vsnprintf(buf,sizeof(buf),good,vp); va_end(vp);
100
    vsnprintf(buf,sizeof(buf),good,vp); va_end(vp);
100
    if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN)
101
    if(strlen(start)-(bad_end-bad_beg)+strlen(buf)>=MAX_LINELEN)
101
      return;   /* this is an error situation. */
102
      return;   /* this is an error situation. */
102
    strcat(buf,bad_end);
103
    strcat(buf,bad_end);
103
    strcpy(bad_beg,buf);
104
    ovlstrcpy(bad_beg,buf);
104
}
105
}
105
 
106
 
106
        /* change all spaces into ' ', and collapse multiple occurences */
107
        /* change all spaces into ' ', and collapse multiple occurences */
107
void singlespace(char *p)
108
void singlespace(char *p)
108
{
109
{
109
    char *pp, *p2;
110
    char *pp, *p2;
110
    for(pp=p;*pp;pp++) {
111
    for(pp=p;*pp;pp++) {
111
        if(!isspace(*pp)) continue;
112
        if(!isspace(*pp)) continue;
112
        if(leaveline) {
113
        if(leaveline) {
113
            if(*pp==13) strcpy(pp,pp+1);
114
            if(*pp==13) ovlstrcpy(pp,pp+1);
114
            if(*pp=='\n') {
115
            if(*pp=='\n') {
115
                pp++;
116
                pp++;
116
                gopt: for(p2=pp; isspace(*p2) && *p2!='\n'; p2++);
117
                gopt: for(p2=pp; isspace(*p2) && *p2!='\n'; p2++);
117
                if(p2>pp) strcpy(pp,p2); pp--;
118
                if(p2>pp) ovlstrcpy(pp,p2); pp--;
118
            }
119
            }
119
            else {
120
            else {
120
                pp++; if(!isspace(*pp) || *pp=='\n') continue;
121
                pp++; if(!isspace(*pp) || *pp=='\n') continue;
121
                goto gopt;
122
                goto gopt;
122
            }
123
            }
123
        }
124
        }
124
        else {
125
        else {
125
            if(*pp!=' ') *pp=' ';
126
            if(*pp!=' ') *pp=' ';
126
            pp++; if(!isspace(*pp)) continue;
127
            pp++; if(!isspace(*pp)) continue;
127
            for(p2=pp;isspace(*p2);p2++);
128
            for(p2=pp;isspace(*p2);p2++);
128
            strcpy(pp,p2); pp--;
129
            ovlstrcpy(pp,p2); pp--;
129
        }
130
        }
130
    }
131
    }
131
}
132
}
132
 
133
 
133
        /* Prepare dictionary */
134
        /* Prepare dictionary */