~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Brian Aker
  • Date: 2009-07-16 19:30:03 UTC
  • mfrom: (1093.1.17 captain)
  • Revision ID: brian@gaz-20090716193003-gwt4i1le2g02ay0j
Merge Jay

Show diffs side-by-side

added added

removed removed

Lines of Context:
2010
2010
        continue;
2011
2011
    }
2012
2012
 
2013
 
#ifdef USE_MB
2014
2013
    // Accept multi-byte characters as-is
2015
2014
    int length;
2016
2015
    if (use_mb(charset_info) &&
2026
2025
        pos+= length - 1;
2027
2026
      continue;
2028
2027
    }
2029
 
#endif
2030
 
        if (!*ml_comment && inchar == '\\' &&
2031
 
            !(*in_string && (drizzle_con_status(&con) & DRIZZLE_CON_STATUS_NO_BACKSLASH_ESCAPES)))
 
2028
    if (!*ml_comment && inchar == '\\' &&
 
2029
        !(*in_string && (drizzle_con_status(&con) & DRIZZLE_CON_STATUS_NO_BACKSLASH_ESCAPES)))
2032
2030
    {
2033
2031
      // Found possbile one character command like \c
2034
2032
 
3374
3372
    if (opt_raw_data)
3375
3373
      tee_fputs(pos, PAGER);
3376
3374
    else for (const char *end=pos+length ; pos != end ; pos++)
3377
 
         {
3378
 
#ifdef USE_MB
3379
 
           int l;
3380
 
           if (use_mb(charset_info) &&
3381
 
               (l = my_ismbchar(charset_info, pos, end)))
3382
 
           {
3383
 
             while (l--)
3384
 
               tee_putc(*pos++, PAGER);
3385
 
             pos--;
3386
 
             continue;
3387
 
           }
3388
 
#endif
3389
 
           if (!*pos)
3390
 
             tee_fputs("\\0", PAGER); // This makes everything hard
3391
 
           else if (*pos == '\t')
3392
 
             tee_fputs("\\t", PAGER); // This would destroy tab format
3393
 
           else if (*pos == '\n')
3394
 
             tee_fputs("\\n", PAGER); // This too
3395
 
           else if (*pos == '\\')
3396
 
             tee_fputs("\\\\", PAGER);
3397
 
           else
3398
 
             tee_putc(*pos, PAGER);
3399
 
         }
 
3375
    {
 
3376
      int l;
 
3377
      if (use_mb(charset_info) &&
 
3378
          (l = my_ismbchar(charset_info, pos, end)))
 
3379
      {
 
3380
        while (l--)
 
3381
          tee_putc(*pos++, PAGER);
 
3382
        pos--;
 
3383
        continue;
 
3384
      }
 
3385
      if (!*pos)
 
3386
        tee_fputs("\\0", PAGER); // This makes everything hard
 
3387
      else if (*pos == '\t')
 
3388
        tee_fputs("\\t", PAGER); // This would destroy tab format
 
3389
      else if (*pos == '\n')
 
3390
        tee_fputs("\\n", PAGER); // This too
 
3391
      else if (*pos == '\\')
 
3392
        tee_fputs("\\\\", PAGER);
 
3393
      else
 
3394
        tee_putc(*pos, PAGER);
 
3395
    }
3400
3396
  }
3401
3397
}
3402
3398