~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: devananda
  • Date: 2009-06-30 14:27:54 UTC
  • mfrom: (1030.2.4 trunk)
  • mto: (1093.1.7 captain)
  • mto: This revision was merged to the branch mainline in revision 1095.
  • Revision ID: devananda.vdv@gmail.com-20090630142754-vm9w374yxkf1pikc
mergeĀ fromĀ lp

Show diffs side-by-side

added added

removed removed

Lines of Context:
1292
1292
      if (histfile)
1293
1293
        sprintf(histfile,"%s/.drizzle_history",getenv("HOME"));
1294
1294
      char link_name[FN_REFLEN];
1295
 
      if (my_readlink(link_name, histfile, 0) == 0 &&
1296
 
          strncmp(link_name, "/dev/null", 10) == 0)
 
1295
      ssize_t sym_link_size= readlink(histfile,link_name,FN_REFLEN-1);
 
1296
      if (sym_link_size >= 0)
1297
1297
      {
1298
 
        /* The .drizzle_history file is a symlink to /dev/null, don't use it */
1299
 
        free(histfile);
1300
 
        histfile= 0;
 
1298
        link_name[sym_link_size]= '\0';
 
1299
        if (strncmp(link_name, "/dev/null", 10) == 0)
 
1300
        {
 
1301
          /* The .drizzle_history file is a symlink to /dev/null, don't use it */
 
1302
          free(histfile);
 
1303
          histfile= 0;
 
1304
        }
1301
1305
      }
1302
1306
    }
1303
1307
    if (histfile)
3161
3165
      extra_padding= data_length - visible_length;
3162
3166
 
3163
3167
      if (field_max_length > MAX_COLUMN_LENGTH)
3164
 
        tee_print_sized_data(buffer, data_length, MAX_COLUMN_LENGTH+extra_padding, FALSE);
 
3168
        tee_print_sized_data(buffer, data_length, MAX_COLUMN_LENGTH+extra_padding, false);
3165
3169
      else
3166
3170
      {
3167
3171
        if (num_flag[off] != 0) /* if it is numeric, we right-justify it */
3168
 
          tee_print_sized_data(buffer, data_length, field_max_length+extra_padding, TRUE);
 
3172
          tee_print_sized_data(buffer, data_length, field_max_length+extra_padding, true);
3169
3173
        else
3170
3174
          tee_print_sized_data(buffer, data_length,
3171
 
                               field_max_length+extra_padding, FALSE);
 
3175
                               field_max_length+extra_padding, false);
3172
3176
      }
3173
3177
      tee_fputs(" | ", PAGER);
3174
3178
    }