~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Brian Aker
  • Date: 2009-06-24 23:17:45 UTC
  • mfrom: (1060.2.7 rm_my_symlink)
  • Revision ID: brian@gaz-20090624231745-rhuamlvq4zkt70xp
Merge EricL tree

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)