mirror of
https://github.com/swaywm/sway.git
synced 2026-04-29 06:46:22 -04:00
Add readline tests
This commit is contained in:
parent
8758a2bd04
commit
689935ed39
6 changed files with 86 additions and 14 deletions
|
|
@ -10,7 +10,7 @@ char *read_line(FILE *file) {
|
|||
return NULL;
|
||||
}
|
||||
while (1) {
|
||||
int c = getc(file);
|
||||
int c = fgetc(file);
|
||||
if (c == '\n' && lastChar == '\\'){
|
||||
--length; // Ignore last character.
|
||||
lastChar = '\0';
|
||||
|
|
@ -51,7 +51,7 @@ char *read_line_buffer(FILE *file, char *string, size_t string_len) {
|
|||
return NULL;
|
||||
}
|
||||
while (1) {
|
||||
int c = getc(file);
|
||||
int c = fgetc(file);
|
||||
if (c == EOF || c == '\n' || c == '\0') {
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue