[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Behavior of readline() when it encounters EOF
From: |
Andrea Monaco |
Subject: |
Behavior of readline() when it encounters EOF |
Date: |
Thu, 06 Oct 2022 18:59:28 +0200 |
The readline manual says that: "If readline encounters an EOF while
reading the line, and the line is empty at that point, then (char *)NULL
is returned. Otherwise, the line is ended just as if a newline had been
typed" (from lib/readline/doc/rltech.texi).
But the second sentence appears wrong. When I type Ctrl-D at a readline
prompt and the line is non-empty, nothing happens. You can check at any
readline prompt, including bash.
Am I correct?
Andrea Monaco
- Behavior of readline() when it encounters EOF,
Andrea Monaco <=