• Timothy Smith's avatar
    Bug #20748: Configuration files should not be read more than once · bbe19e13
    Timothy Smith authored
    Normalize directory names before adding them to default_directories.
    
    
    mysys/default.c:
      Normalize directory names with unpack_dirname() before adding them
      to default_directories.  This way, /etc/ and /etc will not count as
      duplicates.
      
      Because this entails allocating memory to store the normalized names,
      add error handling and ensure that it doesn't leak memory in case
      both my_print_defaults() and load_defaults() are called.
      
      Clean up the Windows code that finds the exe's parent directory, and
      pull it out into a separate function.
      
      Reorganize the code into a single init_default_directories() function,
      with internal #ifdefs, instead of init_default_directories_<system>()
      functions which were accessed via a function pointer.  This is more in
      line with normal MySQL coding style, and easier to read for some.
    bbe19e13
default.c 30.8 KB