gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-49


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-494-gb6694ba
Date: Fri, 26 Apr 2013 08:19:37 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  b6694baa30803eb3cd75453693cd0f503e41a0b1 (commit)
      from  e773c984579f759644e339678d90fdfa3aae6491 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=b6694baa30803eb3cd75453693cd0f503e41a0b1


commit b6694baa30803eb3cd75453693cd0f503e41a0b1
Author: Daniele Forsi <address@hidden>
Date:   Fri Apr 26 10:14:19 2013 +0200

    Fix --writephonebook returning an error at EOF
    
    An error is returned by gn_vcard2phonebook() if the input file contains
    an empty line after the last END:VCARD which is the case for files created
    by --readphonebook.

diff --git a/gnokii/gnokii-phonebook.c b/gnokii/gnokii-phonebook.c
index ba05a23..dc6dad4 100644
--- a/gnokii/gnokii-phonebook.c
+++ b/gnokii/gnokii-phonebook.c
@@ -279,7 +279,7 @@ gn_error writephonebook(int argc, char *argv[], gn_data 
*data, struct gn_statema
                                2 - LDIF
                        */
        char *line, oline[MAX_INPUT_LINE_LEN];
-       int i;
+       int i, c;
 
        struct option options[] = {
                { "overwrite",          0,                      NULL, 'o'},
@@ -436,6 +436,12 @@ gn_error writephonebook(int argc, char *argv[], gn_data 
*data, struct gn_statema
                } else
                        fprintf(stderr, _("Write failed (%s): memory type: %s, 
loc: %d, name: %s, number: %s\n"),
                                 gn_error_print(error), 
gn_memory_type2str(entry.memory_type), entry.location, entry.name, 
entry.number);
+
+               /* gn_vcard2phonebook() gn_ldif2phonebook() return an error if 
input file contains trailing empty lines */
+               do {
+                       c = fgetc(stdin);
+               } while (c == '\r' || c == '\n');
+               ungetc(c, stdin);
        }
 out:
        if (error != GN_ERR_NONE)

-----------------------------------------------------------------------

Summary of changes:
 gnokii/gnokii-phonebook.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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