Peter Wu [Mon, 16 Feb 2015 18:41:56 +0000 (19:41 +0100)]
Fix "Allocator sizeof operand mismatch"
sizeof should be used on the data that will be stored, not the pointer.
Luckily the pointers are larger than the actual data, so there is no
security issue here.
Remove sizeof(char) as it is equal to 1 by the C standard.
Raphaël Droz [Wed, 27 Nov 2013 16:53:02 +0000 (17:53 +0100)]
i18n: removed po/stamp-po from the repository
If present it'll most probably keep `make -C po install` from
(re)generating gmo files (timestamp comparison).
ui: makes potentially destructive operations safe to wrong key presses.
When a deletion, a merge or a deduplication of entries is requested,
accounts (translated) key binding other than [y|n] as a "no" instead
of "yes" to avoid mistakes.
mouse: improve to new scrolling method implemented in 775cf2c
If the viewport reaches the top/bottom list limit, then further
scroll makes the cursor to move instead of the viewport.
Thorsten Wißmann [Sat, 12 May 2012 14:07:50 +0000 (16:07 +0200)]
Scroll whole list on mouse wheel action
This lets the whole list scroll on mouse action (button 5 and 6) instead
of just moving the selection. This also adds the scroll_speed option
that sets the number of lines the list is scrolled by.
Raphaël Droz [Sun, 20 Jan 2013 16:59:03 +0000 (17:59 +0100)]
autotools update: 2/2: autofiles after `autoreconf -f`
- Used autoconf-2.69, the version in the (currently frozen)
Debian testing: wheezy
- Applied the externalization of gettext (intl/ files are not
part of the repository anymore)
- autoheader pass: significantly reduced config.h.in
Raphaël Droz [Sun, 20 Jan 2013 16:54:28 +0000 (17:54 +0100)]
autotools update: 1/2: main files
* run autoupdate on configure.in
* renamed configure{.in => .ac}
* unbundle libintl: AM_GNU_GETTEXT([external])
* added a couple of files to .gitignore
Raphaël Droz [Sun, 20 Jan 2013 16:20:44 +0000 (17:20 +0100)]
miscellaneous fixes & doc: i18n, custom format and vcard
* converted HOWTO.translating_abook to UTF-8, added a couple of lines
about quickly installing and testing new translations and updated URL
of some po-related softwares.
* fixed a trivial error with custom format strncpy() initialization
* vcard builtin import: removed variables unused since e3aa1d4
* vcard export: set a "PREF" EMAIL field attribute (not [yet]
used by vcard import though)
* vcard libvformat import:
- fixed segfault on 64bits arch where a va_list's NULL sentinel value
must be properly casted [sizeof(int) != sizeof(char *)]
- now really import multivalued fields (better use of libvformat):
VFGP_FIND instead of VFGP_GET + vf_get_next_property()
- use of abook_list instead of strconcat for multivalued fields
(groups and emails)
- no more duplicated phone numbers if one or more *PHONE/FAX is
provided while no HOMEPHONE is available
Raphaël Droz [Sun, 13 Jan 2013 12:31:20 +0000 (13:31 +0100)]
vcard import: fixing the "ADR" field
* cleaner code for vcard_parse_address() (the abook's built-in vcard parser)
* vcard_parse_address() now parses "ADR" w.r.t. rfc6350
* fixed the libvformat-based "ADR" import in a similar way
Raphaël Droz [Wed, 2 Jan 2013 13:56:45 +0000 (14:56 +0100)]
* custom output format: fixes and enhancements
- support for the {groups} placeholder
- support for escaped characters (\n, \t, ...)
- removed the leading empty line from the output
- fix segfaults when an empty or a special format string
was provided
- referenced --outformatstr in --help
- code cleanup: use of built-in ITEM_FIELDS and standard_fields[]
to fetch standard fields numbering
* vcard output: removed the leading empty line
(which is mutt-specific)
* colors: added the has_colors() ncurses check
before actually initializing colors.
* Changelog, RELEASE_NOTES, AUTHORS and THANKS files updated
Raphaël Droz [Wed, 19 Dec 2012 01:55:28 +0000 (02:55 +0100)]
ldif: removed ldif_fix_string()
WARNING: this will change the default output file
encoding when importing a LDIF input!
- An LDIF input of UTF-8 entries is base64-encoded (RFC)
str_parse_line() already supports that pretty well.
- But ldif_fix_string(), present since the initial
CVS revision of abook, forces the conversion of utf-8
wide-chars to latin1.
- And that's why iconv exists
=> so let's drop it unless someone complains for a good reason.
Raphaël Droz [Wed, 19 Dec 2012 01:36:29 +0000 (02:36 +0100)]
ldif: deeply reworked LDIF fields processing!
* import: now relies on item_f*t() only when it's safe
Internal field assignation used to be very wrong what made the
LDIF import unreliable. This is not the case anymore
* import: ability to consider additional aliases of LDIF attributes,
eg: "zip" for "postalcode", "fax" for "facsimiletelephonenumber", ...
* import: multiple emails support (up to 2, naturally)
* import/export: added support for "description" (NOTES),
"anniversary" and "ou" (GROUPS)
* export: replaced the attribute named "xmozillaanyphone" by
the _more standard_ "telephonenumber"
Code has been heavily commented and hopefully opens the way
to a better and more extensible LDIF importer.
The last chunk of that patch is a bit unclear but very simple:
LDIF export got rid of some uneeded indirections: there's no point
in testing LDIF_ITEM_FIELDS and doing ldif_conv_table[] translations.
Iterating over j until ITEM_FIELDS to grab names from
ldif_field_names[j] is enough.
Other than new features, effective changes to LDIF export
brought by this commit are:
* attribute order is changed (eg: the URL attribute will
displayed after MOBILEPHONE)
* no more empty ",mail:" in the "dn:" when no email exists
* export now uses the "telephonenumber" attribute
instead of "xmozillaanyphone" previously
The LDIF import may be (undetectably) slower.
That being said, the results a the below command are now
far more reliable.
$ diff ~/.abook/addressbook
<( ./abook --convert --infile ~/.abook/addressbook --outformat ldif | \
./abook --convert --informat ldif --outformat abook )
Raphaël Droz [Thu, 13 Dec 2012 15:47:00 +0000 (16:47 +0100)]
ldif: support parsing from stdin
ldif parser used to seek in the file handler to grab multi-line
strings, thus creating buggy records when input was stdin.
It now reads-ahead the next line in order to work consistently with
unseekable streams like stdin.
Raphaël Droz [Thu, 13 Dec 2012 16:01:14 +0000 (17:01 +0100)]
ldif: cleanup ldif_convert()
* removed the "dirty hack" about LDIF_ITEM_FIELDS
* removed a useless free() causing segfaults
* don't process "objectclass" fields as we don't do anything about them
Raphaël Droz [Mon, 3 Dec 2012 13:28:58 +0000 (14:28 +0100)]
command-line containing --outformat is less-error prone.
Since --convert isn't mandatory anymore for --outformat to be used
(what was conflicting with --mutt-query), we removed the call to
set_convert_var() in 141acfcc.
We now need to test that one of MODE_CONVERT and MODE_QUERY is 'on'
before allowing the use of --outformat.
$ abook --outformat anyformat < file # won't hang anymore
Raphaël Droz [Tue, 6 Nov 2012 21:56:34 +0000 (22:56 +0100)]
vformat: vCard format can now be used in the context of --mutt-query
eg:
$ abook --mutt-query "Max" --outformat vcard
will only dump abook's entries matching "Max", using the vCard output format.