~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Monty Taylor
  • Date: 2011-03-15 16:10:15 UTC
  • mfrom: (2235.3.1 staging)
  • Revision ID: mordred@inaugust.com-20110315161015-qceggirmf3cct7cw
Merge in libdrizzle install changes, doc changes and some header
refactoring.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2204
2204
    return(0);
2205
2205
  if (status.getAddToHistory() && line[0] && not_in_history(line))
2206
2206
    add_history(line);
2207
 
  char *end_of_line=line+(uint32_t) strlen(line);
2208
2207
 
2209
2208
  for (pos=out=line ; (inchar= (unsigned char) *pos) ; pos++)
2210
2209
  {
2298
2297
        continue;
2299
2298
      }
2300
2299
    }
2301
 
    else if (!*ml_comment && !*in_string &&
2302
 
             (end_of_line - pos) >= 10 &&
2303
 
             !strncmp(pos, "delimiter ", 10))
2304
 
    {
2305
 
      // Flush previously accepted characters
2306
 
      if (out != line)
2307
 
      {
2308
 
        buffer->append(line, (out - line));
2309
 
        out= line;
2310
 
      }
2311
 
 
2312
 
      // Flush possible comments in the buffer
2313
 
      if (!buffer->empty())
2314
 
      {
2315
 
        if (com_go(buffer, 0) > 0) // < 0 is not fatal
2316
 
          return(1);
2317
 
        assert(buffer!=NULL);
2318
 
        buffer->clear();
2319
 
      }
2320
 
 
2321
 
      /*
2322
 
        Delimiter wants the get rest of the given line as argument to
2323
 
        allow one to change ';' to ';;' and back
2324
 
      */
2325
 
      buffer->append(pos);
2326
 
      if (com_delimiter(buffer, pos) > 0)
2327
 
        return(1);
2328
 
 
2329
 
      buffer->clear();
2330
 
      break;
2331
 
    }
2332
2300
    else if (!*ml_comment && !*in_string && !strncmp(pos, delimiter,
2333
2301
                                                     strlen(delimiter)))
2334
2302
    {
2388
2356
 
2389
2357
      // comment to end of line
2390
2358
      if (preserve_comments)
 
2359
      {
 
2360
        bool started_with_nothing= !buffer->empty();
2391
2361
        buffer->append(pos);
2392
2362
 
 
2363
        /*
 
2364
          A single-line comment by itself gets sent immediately so that
 
2365
          client commands (delimiter, status, etc) will be interpreted on
 
2366
          the next line.
 
2367
        */
 
2368
        if (started_with_nothing)
 
2369
        {
 
2370
          if (com_go(buffer, 0) > 0)             // < 0 is not fatal
 
2371
           return 1;
 
2372
          buffer->clear();
 
2373
        }
 
2374
      }  
 
2375
 
2393
2376
      break;
2394
2377
    }
2395
2378
    else if (!*in_string && inchar == '/' && *(pos+1) == '*' &&