summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2024-05-24 21:44:10 -0300
committerEuAndreh <eu@euandre.org>2024-05-24 22:07:13 -0300
commit08942380d424b856c2e3c7a3cf2ed83d6e3b4c36 (patch)
treee0eef2d8f026ca28a4720372c940ab2e839c9581 /src
parentsrc/random.c: Simplify via better variable names (diff)
downloadpindaiba-08942380d424b856c2e3c7a3cf2ed83d6e3b4c36.tar.gz
pindaiba-08942380d424b856c2e3c7a3cf2ed83d6e3b4c36.tar.xz
src/i18n.c: Remove leading empty string in MSGS[]
Diffstat (limited to 'src')
-rw-r--r--src/catalog.c4
-rw-r--r--src/i18n.c1
-rw-r--r--src/i18n.h2
-rw-r--r--src/pindaibabs.en.msg70
4 files changed, 38 insertions, 39 deletions
diff --git a/src/catalog.c b/src/catalog.c
index 8ddfaee..3e40bf2 100644
--- a/src/catalog.c
+++ b/src/catalog.c
@@ -118,13 +118,13 @@ int
dump_translatable_strings(const char *const MSGS[]) {
int rc = -1;
- for (size_t i = 1; MSGS[i]; i++) {
+ for (size_t i = 0U; MSGS[i] != NULL; i++) {
if (printf("%ld ", i) < 0) {
logerr("printf(): %s", strerror(errno));
goto out;
}
- for (size_t j = 0; MSGS[i][j]; j++) {
+ for (size_t j = 0U; MSGS[i][j]; j++) {
if (MSGS[i][j] == '\n') {
if (printf("\\n") < 0) {
logerr("printf(): %s", strerror(errno));
diff --git a/src/i18n.c b/src/i18n.c
index 81d1e36..4f5f748 100644
--- a/src/i18n.c
+++ b/src/i18n.c
@@ -9,7 +9,6 @@
const char *const
MSGS[] = {
- "",
[MSG_USAGE_FIRST]="Usage:\n",
[MSG_USAGE_1]=" " NAME " -p FILE [-o DIRECTORY]\n",
[MSG_USAGE_2]=" " NAME " -l FILE [-o DIRECTORY]\n",
diff --git a/src/i18n.h b/src/i18n.h
index 3d3f98a..0779ce5 100644
--- a/src/i18n.h
+++ b/src/i18n.h
@@ -1,5 +1,5 @@
enum MSGCATALOG_ID {
- MSG_USAGE_FIRST = 1,
+ MSG_USAGE_FIRST,
MSG_USAGE_1,
MSG_USAGE_2,
MSG_USAGE_LAST,
diff --git a/src/pindaibabs.en.msg b/src/pindaibabs.en.msg
index 24eccbd..72c5daa 100644
--- a/src/pindaibabs.en.msg
+++ b/src/pindaibabs.en.msg
@@ -1,76 +1,76 @@
-1 Usage:\n
+0 Usage:\n
-2 pindaibabs -p FILE [-o DIRECTORY]\n
+1 pindaibabs -p FILE [-o DIRECTORY]\n
-3 pindaibabs -l FILE [-o DIRECTORY]\n
+2 pindaibabs -l FILE [-o DIRECTORY]\n
-4 pindaibabs [-hV]\n
+3 pindaibabs [-hV]\n
+
+4 \n
5 \n
-6 \n
+6 Options:\n
-7 Options:\n
+7 -p FILE parser file to be processed\n
-8 -p FILE parser file to be processed\n
+8 -l FILE lexer file to be processed\n
-9 -l FILE lexer file to be processed\n
+9 -o DIRECTORY output where to place the\n
-10 -o DIRECTORY output where to place the\n
+10 generated files (default .)\n
-11 generated files (default .)\n
+11 -h, --help show this help message\n
-12 -h, --help show this help message\n
+12 -V, --version print the version number\n
-13 -V, --version print the version number\n
+13 \n
14 \n
-15 \n
+15 Run the pindaibabs(1) parser program.\n
-16 Run the pindaibabs(1) parser program.\n
+16 \n
-17 \n
+17 Here is the explanation for what it does, and the synopsis\n
-18 Here is the explanation for what it does, and the synopsis\n
+18 of its usage.\n
-19 of its usage.\n
+19 \n
-20 \n
+20 See "man pindaibabs" for usage information and\n
-21 See "man pindaibabs" for usage information and\n
+21 "man pindaibabs.tutorial" for a beginner introduction.\n
-22 "man pindaibabs.tutorial" for a beginner introduction.\n
+22 \n
23 \n
-24 \n
+24 Examples:\n
-25 Examples:\n
+25 \n
-26 \n
+26 Do a one-line parser:\n
-27 Do a one-line parser:\n
+27 \n
-28 \n
+28 $ pindaibabs run md.grammar < README.md\n
-29 $ pindaibabs run md.grammar < README.md\n
+29 \n
30 \n
-31 \n
-
-32 Compile the grammer:\n
+31 Compile the grammer:\n
-33 \n
+32 \n
-34 $ pindaibabs build csv.grammar > dunno.alsodunno\n
+33 $ pindaibabs build csv.grammar > dunno.alsodunno\n
-35 pindaibabs 0.1.0 1970-01-01\n
+34 pindaibabs 0.1.0 1970-01-01\n
-36 Already at max capacity (%ld): %s\n
+35 Already at max capacity (%ld): %s\n
-37 idx (%ld) is beyond bounds (%ld)\n
+36 idx (%ld) is beyond bounds (%ld)\n
-38 pop on an empty vector\n
+37 pop on an empty vector\n