From: Michael Stapelberg Date: Thu, 29 Dec 2011 23:50:31 +0000 (+0100) Subject: Fix i3-config-wizard on FreeBSD 7.x (without getline()) (Thanks garga) X-Git-Tag: 4.2~165 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2ec689ec7dde952ecc8b9b7c0f1e2fe4511abbc3;p=i3%2Fi3 Fix i3-config-wizard on FreeBSD 7.x (without getline()) (Thanks garga) --- diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index 84a7f77e..11fec6ce 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -285,7 +285,7 @@ static void finish() { char *line = NULL; size_t len = 0; -#if !defined(__APPLE__) +#if !defined(__APPLE__) && (!defined(__FreeBSD__) || __FreeBSD_version >= 800000) ssize_t read; #endif bool head_of_file = true; @@ -298,7 +298,7 @@ static void finish() { fputs("# this file and re-run i3-config-wizard(1).\n", ks_config); fputs("#\n", ks_config); -#if defined(__APPLE__) +#if defined(__APPLE__) || (defined(__FreeBSD__) && __FreeBSD_version < 800000) while ((line = fgetln(kc_config, &len)) != NULL) { #else while ((read = getline(&line, &len, kc_config)) != -1) {