[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
1 changed files with 4 additions and 0 deletions

View File

@ -237,6 +237,10 @@ static void read_input_sync(DmenuModePrivateData *pd, unsigned int pre_read) {
char *line = NULL;
while (pre_read > 0 &&
(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);
pre_read--;
}