fixed .config directory path
This commit is contained in:
parent
c0f7461eab
commit
15bc846db8
@ -35,15 +35,16 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
void init_config(char *filename)
|
||||
{
|
||||
struct stat st;
|
||||
char *buffer = why2_replace(WHY2_CONFIG_DIR, "{USER}", getenv("USER"));
|
||||
|
||||
//CREATE USER CONFIG FOLDER [THIS SHOULDN'T HAPPEN ON CLIENT, BUT IT'S NEEDED ON FRESH SERVERS]
|
||||
if (stat(WHY2_CONFIG_DIR, &st) == -1)
|
||||
if (stat(buffer, &st) == -1)
|
||||
{
|
||||
mkdir(WHY2_CONFIG_DIR, 0700);
|
||||
mkdir(buffer, 0700);
|
||||
}
|
||||
|
||||
//GET THE CONFIG TYPE
|
||||
char *buffer = why2_malloc(strlen(WHY2_CHAT_CONFIG_DIR) + strlen(filename) + 2);
|
||||
buffer = why2_realloc(buffer, strlen(WHY2_CHAT_CONFIG_DIR) + strlen(filename) + 2);
|
||||
sprintf(buffer, "%s/%s", WHY2_CHAT_CONFIG_DIR, filename);
|
||||
|
||||
char *path = why2_replace(buffer, "{USER}", getenv("USER"));
|
||||
|
Loading…
x
Reference in New Issue
Block a user