Fix i3-config-wizard on FreeBSD 7.x (without getline()) (Thanks garga)

next
Michael Stapelberg 2011-12-30 00:50:31 +01:00
parent a2031a8894
commit 2ec689ec7d
1 changed files with 2 additions and 2 deletions

View File

@ -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) {