tech-userlevel archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [PATCH 1/2] Add BSD-licensed gettext(1) implementation
In article <1433227520-6111-1-git-send-email-will%worrbase.com@localhost>,
William Orr <will%worrbase.com@localhost> wrote:
>+
>+LDADD+= -lintl -lutil
>+DPADD+= ${LIBINTL}
DPADD+= ${LIBINTL} ${LIBUTIL}
>+ printf("Usage: %s [-ehn] [[TEXTDOMAIN] MSGID]\n", getprogname());
>+ printf("Usage: %s -s [MSGID]...\n", getprogname());
>+ exit(exit_status);
fprintf(stderr, (usage goes to stderr).
>+
>+ setlocale(LC_ALL, "");
>+ setprogname(basename(argv[0]));
No basename() here; setprogname() takes care of it.
>+
>+ while ((ch = getopt(argc, argv, "d:eEhnsV")) != -1) {
>+ switch (ch) {
>+ case 'd':
>+ msgdomain = strdup(optarg);
>+ if (msgdomain == NULL)
>+ err(EXIT_FAILURE, "can't allocate memory");
estrdup() here too.
>+ /* msgdomain can be passed as optional arg iff -s is not passed */
>+ if (argc == 2 && !sflag) {
>+ msgdomain = strdup(argv[0]);
>+ if (msgdomain == NULL)
>+ err(EXIT_FAILURE, "can't allocate memory");
estrdup() here too.
Cheers,
christos
Home |
Main Index |
Thread Index |
Old Index