~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Mark Atwood
  • Date: 2011-08-04 16:21:21 UTC
  • mfrom: (2318.9.14 refactor3)
  • Revision ID: me@mark.atwood.name-20110804162121-6b9ay1b1de3yfgvl
mergeĀ lp:~olafvdspek/drizzle/refactor3

Show diffs side-by-side

added added

removed removed

Lines of Context:
388
388
static string outfile("");
389
389
static FILE *PAGER, *OUTFILE;
390
390
static uint32_t prompt_counter;
391
 
static char *delimiter= NULL;
 
391
static const char *delimiter= NULL;
392
392
static uint32_t delimiter_length= 1;
393
393
unsigned short terminal_width= 80;
394
394
 
395
 
int drizzleclient_real_query_for_lazy(const char *buf, size_t length,
396
 
                                      drizzle_result_st *result,
397
 
                                      uint32_t *error_code);
 
395
int drizzleclient_real_query_for_lazy(const char *buf, size_t length, drizzle_result_st *result, uint32_t *error_code);
398
396
int drizzleclient_store_result_for_lazy(drizzle_result_st *result);
399
397
 
400
 
 
401
398
void tee_fprintf(FILE *file, const char *fmt, ...);
402
399
void tee_fputs(const char *s, FILE *file);
403
400
void tee_puts(const char *s, FILE *file);
1617
1614
    /* Check that delimiter does not contain a backslash */
1618
1615
    if (! strstr(delimiter_str.c_str(), "\\"))
1619
1616
    {
1620
 
      delimiter= (char *)delimiter_str.c_str();  
 
1617
      delimiter= delimiter_str.c_str();  
1621
1618
    }
1622
1619
    else
1623
1620
    {
3948
3945
static int
3949
3946
com_delimiter(string *, const char *line)
3950
3947
{
3951
 
  char buff[256], *tmp;
 
3948
  char buff[256];
3952
3949
 
3953
3950
  strncpy(buff, line, sizeof(buff) - 1);
3954
 
  tmp= get_arg(buff, 0);
 
3951
  char* tmp= get_arg(buff, 0);
3955
3952
 
3956
3953
  if (!tmp || !*tmp)
3957
3954
  {
3958
 
    put_info(_("DELIMITER must be followed by a 'delimiter' character or string"),
3959
 
             INFO_ERROR, 0, 0);
 
3955
    put_info(_("DELIMITER must be followed by a 'delimiter' character or string"), INFO_ERROR, 0, 0);
3960
3956
    return 0;
3961
3957
  }
3962
3958
  else
3963
3959
  {
3964
3960
    if (strstr(tmp, "\\"))
3965
3961
    {
3966
 
      put_info(_("DELIMITER cannot contain a backslash character"),
3967
 
               INFO_ERROR, 0, 0);
 
3962
      put_info(_("DELIMITER cannot contain a backslash character"), INFO_ERROR, 0, 0);
3968
3963
      return 0;
3969
3964
    }
3970
3965
  }
3971
 
  strncpy(delimiter, tmp, sizeof(delimiter) - 1);
 
3966
  delimiter= strdup(tmp);
3972
3967
  delimiter_length= (int)strlen(delimiter);
3973
3968
  delimiter_str= delimiter;
3974
3969
  return 0;