summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/gperf/ChangeLog5
-rw-r--r--apps/gperf/src/Key_List.cpp11
2 files changed, 13 insertions, 3 deletions
diff --git a/apps/gperf/ChangeLog b/apps/gperf/ChangeLog
index 70914cce18e..0993d35cc22 100644
--- a/apps/gperf/ChangeLog
+++ b/apps/gperf/ChangeLog
@@ -1,5 +1,10 @@
Fri Aug 21 11:57:57 1998 Douglas C. Schmidt <schmidt@tango.cs.wustl.edu>
+ * src/Key_List.cpp (set_output_types): Make sure that we leave an
+ extra space between the struct tag and the wordlist so the
+ compiler doesn't complain. Thanks to Andy Gokhale for reporting
+ this.
+
* src/gperf.cpp: Modified the main() program so that it doesn't
print the starting time until AFTER we've parsed the arguments.
diff --git a/apps/gperf/src/Key_List.cpp b/apps/gperf/src/Key_List.cpp
index 7c57015c7c6..c335de73150 100644
--- a/apps/gperf/src/Key_List.cpp
+++ b/apps/gperf/src/Key_List.cpp
@@ -173,8 +173,13 @@ Key_List::set_output_types (void)
return_type[struct_tag_length + 1] = '\0';
}
- struct_tag = new char[struct_tag_length + 1];
+ struct_tag = new char[struct_tag_length + 2];
strncpy (struct_tag, array_type, struct_tag_length);
+ if (struct_tag[struct_tag_length] != ' ')
+ {
+ struct_tag[struct_tag_length] = ' ';
+ struct_tag_length++;
+ }
struct_tag[struct_tag_length] = '\0';
}
else if (option[POINTER]) // Return a char *.
@@ -709,8 +714,8 @@ Key_List::output_keyword_table (void)
{
char *l_brace = *head->rest ? "{" : "";
char *r_brace = *head->rest ? "}," : "";
- char *indent = option[GLOBAL] ? "" : " ";
- int index = 0;
+ char *indent = option[GLOBAL] ? "" : " ";
+ int index = 0;
List_Node *temp;
printf ("%sstatic %s%swordlist[] =\n%s%s{\n",