From cc3a742e4f68fec41a7c191d905a5d802f6aa573 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Thu, 30 Jan 2020 22:57:03 +0100 Subject: [PATCH] Use PROGNAME_NOTES --- src/main.c | 10 +++++----- src/notes.c | 6 +++++- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/src/main.c b/src/main.c index 4998504..c9aba18 100644 --- a/src/main.c +++ b/src/main.c @@ -39,8 +39,8 @@ #define _(string) gettext(string) /* constants */ -#ifndef PROGNAME -# define PROGNAME "notes" +#ifndef PROGNAME_NOTES +# define PROGNAME_NOTES "notes" #endif #ifndef PREFIX # define PREFIX "/usr/local" @@ -68,7 +68,7 @@ static int _notes(void) NotesWindow * notes; if((notes = noteswindow_new()) == NULL) - return error_print(PACKAGE); + return error_print(PROGNAME_NOTES); gtk_main(); noteswindow_delete(notes); return 0; @@ -78,7 +78,7 @@ static int _notes(void) /* error */ static int _error(char const * message, int ret) { - fputs(PROGNAME ": ", stderr); + fputs(PROGNAME_NOTES ": ", stderr); perror(message); return ret; } @@ -87,7 +87,7 @@ static int _error(char const * message, int ret) /* usage */ static int _usage(void) { - fprintf(stderr, _("Usage: %s\n"), PROGNAME); + fprintf(stderr, _("Usage: %s\n"), PROGNAME_NOTES); return 1; } diff --git a/src/notes.c b/src/notes.c index 81404c6..4ab7554 100644 --- a/src/notes.c +++ b/src/notes.c @@ -49,6 +49,10 @@ static char const _license[] = "All rights reserved.\n" #define _(string) gettext(string) #define N_(string) (string) +#ifndef PROGNAME_NOTES +# define PROGNAME_NOTES "notes" +#endif + /* Notes */ /* private */ @@ -327,7 +331,7 @@ int notes_error(Notes * notes, char const * message, int ret) static int _error_text(char const * message, int ret) { - fputs(PACKAGE ": ", stderr); + fputs(PROGNAME_NOTES ": ", stderr); fputs(message, stderr); fputc('\n', stderr); return ret;