Ignore:
Timestamp:
Feb 2, 2016, 6:13:30 PM (4 years ago)
Author:
mabarracus
Message:

Add new source code 5.15.2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • yaz/trunk/fuentes/client/client.c

    r255 r265  
    51855185{
    51865186    int i, res;
    5187     char word[32], arg[10240];
     5187    char word[32], *arg;
     5188    int no_read = 0;
    51885189
    51895190#if HAVE_GETTIMEOFDAY
     
    51915192#endif
    51925193
    5193     if ((res = sscanf(line, "%31s %10239[^;]", word, arg)) <= 0)
     5194    sscanf(line, "%31s%n", word, &no_read);
     5195    if (no_read == 0)
    51945196    {
    51955197        strcpy(word, last_cmd);
    5196         *arg = '\0';
    5197     }
    5198     else if (res == 1)
    5199         *arg = 0;
     5198        arg = line + strlen(line);
     5199    }
     5200    else
     5201        arg = line + no_read;
    52005202    strcpy(last_cmd, word);
    52015203
    5202     /* removed tailing spaces from the arg command */
    5203     {
    5204         char* p = arg;
    5205         char* lastnonspace=NULL;
    5206 
    5207         for (; *p; ++p)
     5204    /* whitespace chop */
     5205    {
     5206        char *p;
     5207        char *lastnonspace = 0;
     5208
     5209        while (*arg && yaz_isspace(*arg))
     5210            arg++;
     5211        for (p = arg; *p; ++p)
    52085212        {
    52095213            if (!yaz_isspace(*p))
     
    52895293    else
    52905294    {
    5291         char arg[10240],word[32];
    5292         int i ,res;
    5293         if ((res = sscanf(rl_line_buffer, "%31s %10239[^;]", word, arg)) <= 0)
     5295        char word[32];
     5296        int i;
     5297        if (sscanf(rl_line_buffer, "%31s", word) <= 0)
    52945298        {
    52955299            rl_attempted_completion_over = 1;
Note: See TracChangeset for help on using the changeset viewer.