conceptually const but not declared as such. Halibut is now back to
the practically-speaking-pointless but rather satisfying status of
having no global writable data whatsoever :-)
git-svn-id: svn://svn.tartarus.org/sgt/halibut@5476
cda61777-01e9-0310-a592-
d414129be87e
/* If there's nothing left, make something valid up */
if (!*text) {
/* If there's nothing left, make something valid up */
if (!*text) {
- static const char *anonfrag = "anon";
+ static const char *const anonfrag = "anon";
text = sresize(text, lenof(anonfrag), char);
strcpy(text, anonfrag);
}
text = sresize(text, lenof(anonfrag), char);
strcpy(text, anonfrag);
}
#include <stdio.h>
#include "halibut.h"
#include <stdio.h>
#include "halibut.h"
-static char *helptext[] = {
+static const char *const helptext[] = {
"usage: halibut [options] files",
"options: --text[=filename] generate plain text output",
" --html[=filename] generate XHTML output",
"usage: halibut [options] files",
"options: --text[=filename] generate plain text output",
" --html[=filename] generate XHTML output",
-static char *usagetext[] = {
+static const char *const usagetext[] = {
"usage: halibut [--format[=filename]] [options] file.but [file.but...]",
NULL
};
void help(void) {
"usage: halibut [--format[=filename]] [options] file.but [file.but...]",
NULL
};
void help(void) {
for (p = helptext; *p; p++)
puts(*p);
}
void usage(void) {
for (p = helptext; *p; p++)
puts(*p);
}
void usage(void) {
for (p = usagetext; *p; p++)
puts(*p);
}
for (p = usagetext; *p; p++)
puts(*p);
}
-static char *licencetext[] = {
+static const char *const licencetext[] = {
"Halibut is copyright (c) 1999-2005 Simon Tatham and James Aylett.",
"",
"Permission is hereby granted, free of charge, to any person",
"Halibut is copyright (c) 1999-2005 Simon Tatham and James Aylett.",
"",
"Permission is hereby granted, free of charge, to any person",
for (p = licencetext; *p; p++)
puts(*p);
}
for (p = licencetext; *p; p++)
puts(*p);
}