diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/config.c | 3 | ||||
-rw-r--r-- | sway/main.c | 15 |
2 files changed, 15 insertions, 3 deletions
diff --git a/sway/config.c b/sway/config.c index e737f83c..98109937 100644 --- a/sway/config.c +++ b/sway/config.c | |||
@@ -575,6 +575,9 @@ bool read_config(FILE *file, struct sway_config *config) { | |||
575 | char *line; | 575 | char *line; |
576 | while (!feof(file)) { | 576 | while (!feof(file)) { |
577 | line = read_line(file); | 577 | line = read_line(file); |
578 | if (!line) { | ||
579 | continue; | ||
580 | } | ||
578 | line_number++; | 581 | line_number++; |
579 | line = strip_whitespace(line); | 582 | line = strip_whitespace(line); |
580 | if (line[0] == '#') { | 583 | if (line[0] == '#') { |
diff --git a/sway/main.c b/sway/main.c index 157c61b3..d41eb292 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -53,7 +53,10 @@ void detect_proprietary() { | |||
53 | return; | 53 | return; |
54 | } | 54 | } |
55 | while (!feof(f)) { | 55 | while (!feof(f)) { |
56 | char *line = read_line(f); | 56 | char *line; |
57 | if (!(line = read_line(f))) { | ||
58 | break; | ||
59 | } | ||
57 | if (strstr(line, "nvidia")) { | 60 | if (strstr(line, "nvidia")) { |
58 | fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia drivers do NOT support Wayland. Use nouveau.\x1B[0m\n"); | 61 | fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia drivers do NOT support Wayland. Use nouveau.\x1B[0m\n"); |
59 | fprintf(stderr, "\x1B[1;31mYes, they STILL don't work with the newly announced wayland \"support\".\x1B[0m\n"); | 62 | fprintf(stderr, "\x1B[1;31mYes, they STILL don't work with the newly announced wayland \"support\".\x1B[0m\n"); |
@@ -118,7 +121,10 @@ static void log_distro() { | |||
118 | if (f) { | 121 | if (f) { |
119 | sway_log(L_INFO, "Contents of %s:", paths[i]); | 122 | sway_log(L_INFO, "Contents of %s:", paths[i]); |
120 | while (!feof(f)) { | 123 | while (!feof(f)) { |
121 | char *line = read_line(f); | 124 | char *line; |
125 | if (!(line = read_line(f))) { | ||
126 | break; | ||
127 | } | ||
122 | if (*line) { | 128 | if (*line) { |
123 | sway_log(L_INFO, "%s", line); | 129 | sway_log(L_INFO, "%s", line); |
124 | } | 130 | } |
@@ -136,7 +142,10 @@ static void log_kernel() { | |||
136 | return; | 142 | return; |
137 | } | 143 | } |
138 | while (!feof(f)) { | 144 | while (!feof(f)) { |
139 | char *line = read_line(f); | 145 | char *line; |
146 | if (!(line = read_line(f))) { | ||
147 | break; | ||
148 | } | ||
140 | if (*line) { | 149 | if (*line) { |
141 | sway_log(L_INFO, "%s", line); | 150 | sway_log(L_INFO, "%s", line); |
142 | } | 151 | } |