[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [augeas-devel] Make augtool quiet in batch mode.



On Tue, 2009-03-31 at 10:17 +0200, Raphaël Pinson wrote:
> This patch makes augtool silent in batch mode, i.e. when stdin is a tty.
> In order to avoid printing the prompt in batch mode, it uses getline in
> this case.

This looks good now.

> This patch makes augtest output series of "Unknown command '\n'", but
> all tests pass. I cannot reproduce this error by sending empty lines to
> augtool in the shell, either with 'echo -e "command\ncommand" |' or 'cat <<EOF |'.

I am not entirely sure why that happened, but cleanpath/cleanstr had an
off-by-one error. This

    while (e != path && (*e == sep || isspace(*e)))

should be 

    while (e >= path && (*e == sep || isspace(*e)))

i.e. we should enter the loop body for e == path, too, so that we reduce
the string "\n" to ""

David




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]