gnokii-users
[Top][All Lists]
Advanced

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

Re: --writephonebook options (resend)


From: Pawel Kot
Subject: Re: --writephonebook options (resend)
Date: Mon, 9 Aug 2004 09:19:17 +0200 (CEST)

On Fri, 6 Aug 2004, Reiner Steib wrote:

> (1) interactive mode (the default) should skip busy locations
>
> I don't understand how the interactive "Overwrite?  (yes/no)" is
> supposed to work, because the phonebook already is read from stdin.
> All I get (without using "-f") is an infloop:
>
> $ gnokii --writephonebook < file
> ...
> Overwrite? (yes/no)
> Incorrect answer []
> ...

This is interactive mode, and redirecting file is not an interactive mode. ;-)
Being more serious: this is known, brown-bag bug. It was discussed on
gnokii ml already few times. The solution is to detect the terminal from
which we should read the interactive answers. I dunno how to do it in
portable way. Someone mentioned gnupg as the program with the solution for
this.

The workaround would be to avoid reading input from the stdin. But that's
ugly.

> AFAICS, writephonebook() should just skip the entry unless
> "--overwrite" is given.  The code following "if (!confirm)" in
> gnokii.c should definitely be changed.

You mean: when the location is busy, do not write it? That's not correct
behaviour.

> -                                             else fprintf(stdout, 
> "\nIncorrect answer [%s]\n", ans);
> +                                             else {
> +                                               fprintf(stdout, "\nIncorrect 
> answer [%s], skipping this location.\n", ans);
> +                                               confirm = 0; }

So you just stop the interactivity when someone gives incorrect answer...

> (2) How is "--writephonebook --find-free" supposed to work?

For each entry to be written, the first empty location is found and the
given entry is being written there.

> echo 'Foo Bar;12345678;SM;;0;'|gnokii --writephonebook --find-free
> GNOKII Version 0.6.4-CVS-20040709
> Error (The given memory location is invalid.)
>
> If I specify the location, I'm caught in the interactive mode infloop.

Well, there's a bug few lines earlier:
                case 'f':
                        find_free = 0;
                        break;
You should read it: find_free = 1
Could you please change it and re-verify if it works?

take care,
pkot
-- 
mailto:address@hidden
http://www.gnokii.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]