#include <errno.h>
#include <fcntl.h>
+#include <ctype.h>
#include <signal.h>
#include <stdio.h>
#include <stdlib.h>
umask(DEFAULT_UMASK);
if(!datafile_writeable()) {
- char *s = mkstr(_("File %s is not writeable"), datafile);
+ char *s = strdup_printf(_("File %s is not writeable"), datafile);
refresh_screen();
statusline_msg(s);
free(s);
{
char email[MAX_EMAIL_LEN];
char *ret;
- char *name = mkstr("\"%s\"", database[item][NAME]);
+ char *name = strdup_printf("\"%s\"", database[item][NAME]);
get_first_email(email, item);
ret = *database[item][EMAIL] ?
- mkstr("%s <%s>", name, email) :
+ strdup_printf("%s <%s>", name, email) :
xstrdup(name);
free(name);
return;
if( database[item][URL] )
- cmd = mkstr("%s '%s'",
+ cmd = strdup_printf("%s '%s'",
opt_get_str(STR_WWW_COMMAND),
safe_str(database[item][URL]));
else
}
do {
- /* TODO gettext: handle translated keypresses? */
- printf(_("Add \"%s <%s>\" to %s? (y/n)\n"),
+ printf(_("Add \"%s <%s>\" to %s? (%c/%c)\n"),
name,
email,
- datafile);
- c = getc(in);
- if(c == 'n' || c == 'N') {
+ datafile,
+ *S_("keybinding for yes|y"),
+ *S_("keybinding for no|n"));
+ c = tolower(getc(in));
+ if(c == *S_("keybinding for no|n")) {
fclose(in);
return 0;
}
- } while(c != 'y' && c != 'Y');
+ } while(c != *S_("keybinding for yes|y"));
fclose(in);
}