tech-pkg archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: wip/mu: std::getline returning falsy value
> > I'm working on wip/mu and I've ran into a strange issue. Basically,
> > it appears that line 121 in lib/utils/mu-readline.cc is returning a
> > falsy value and is causing the `server` command to quit immediately
> > after starting. I don't know much about C++ but it's my understanding
> > that std::getline returns falsy if there is a bad char input or issue
> > with the stream or something.
>
> The function returns the "basic_istream" that is passed as first
> argument. Testing that as a bool is equivalent to !fail() [inherited
> from std::basic_ios<CharT,Traits>::fail via operator bool from the same
> class] and assuming that the (output) string size is not exceeded, this
> means no characters were extracted from the stream (not even the line
> delimiter).
>
> This would happen e.g. if the stdin of the program has been closed.
Do you have any ideas of what would cause such a thing to happen? I'm
assuming it shouldn't happening since it's in the standard library...
Kev
Home |
Main Index |
Thread Index |
Old Index