1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-18 13:54:36 -05:00

[DMenu] Strip off delimiter in sync mode.

Fixes: #1679
This commit is contained in:
Dave Davenport 2022-08-18 10:17:24 +02:00
parent 65b48aae4f
commit a22c81c4a9

View file

@ -237,6 +237,10 @@ static void read_input_sync(DmenuModePrivateData *pd, unsigned int pre_read) {
char *line = NULL; char *line = NULL;
while (pre_read > 0 && while (pre_read > 0 &&
(nread = getdelim(&line, &len, pd->separator, pd->fd_file)) != -1) { (nread = getdelim(&line, &len, pd->separator, pd->fd_file)) != -1) {
if (line[nread - 1] == pd->separator) {
nread--;
line[nread] = '\0';
}
read_add(pd, line, nread); read_add(pd, line, nread);
pre_read--; pre_read--;
} }