From 60e7704b5b25aa33332074e2ddea43df72b6c055 Mon Sep 17 00:00:00 2001 From: Jack Allnutt Date: Tue, 11 Feb 2014 18:23:21 +0000 Subject: [PATCH] Normalise path to configuration file when specified on the command line --- server/configuration.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/server/configuration.js b/server/configuration.js index b8241f3..f9ed927 100644 --- a/server/configuration.js +++ b/server/configuration.js @@ -1,6 +1,7 @@ var fs = require('fs'), events = require('events'), - util = require('util'); + util = require('util'), + path = require('path'); var config_filename = 'config.js', config_dirs = ['/etc/kiwiirc/', __dirname + '/../'], @@ -17,7 +18,8 @@ Config.prototype.loadConfig = function (manual_config_file) { conf_filepath, i; - if (manual_config_file) { + if ((manual_config_file) || (this.manual_config_file)) { + manual_config_file = path.resolve(path.normalize(manual_config_file || this.manual_config_file)); if (fs.existsSync(manual_config_file)) { try { if (fs.lstatSync(manual_config_file).isFile() === true) { -- 2.25.1