Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

this is so horrible

  • Loading branch information...
commit f8b290b1d8db347a143c92f549c3b863e547f307 1 parent c45fac5
@avar authored
Showing with 30 additions and 8 deletions.
  1. +30 −8 src/hello.c
View
38 src/hello.c
@@ -46,6 +46,7 @@ main (int argc, char *argv[])
{
int optc;
int lose = 0;
+ int counter;
const char *greeting_msg = NULL;
greeting_type g = greet_gnu;
@@ -109,18 +110,39 @@ main (int argc, char *argv[])
printf (_("hello, world\n"));
else if (g == greet_new)
- /* TRANSLATORS: Use box drawing characters or other fancy stuff
- if your encoding (e.g., UTF-8) allows it. If done so add the
- following note, please:
-
- [Note: For best viewing results use a UTF-8 locale, please.]
- */
- printf (_("\
+ {
+ if (greeting_msg)
+ {
+ size_t length = strlen(greeting_msg);
+ printf ("+");
+ for (counter = 0; counter <= (length + 1); counter++)
+ {
+ printf ("-");
+ }
+ printf ("+\n");
+ printf ("| %s |\n", greeting_msg);
+ printf ("+");
+ for (counter = 0; counter <= (length + 1); counter++)
+ {
+ printf ("-");
+ }
+ printf ("+\n");
+ }
+ else
+ {
+ /* TRANSLATORS: Use box drawing characters or other fancy stuff
+ if your encoding (e.g., UTF-8) allows it. If done so add the
+ following note, please:
+
+ [Note: For best viewing results use a UTF-8 locale, please.]
+ */
+ printf (_("\
+---------------+\n\
| Hello, world! |\n\
+---------------+\n\
"));
-
+ }
+ }
else if (g == greet_user)
puts (greeting_msg);
Please sign in to comment.
Something went wrong with that request. Please try again.