aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2018-10-20 21:26:21 +0300
committerArnold D. Robbins <arnold@skeeve.com>2018-10-20 21:26:21 +0300
commit6c6d5fbd85be4a94600ca20b4ad0765bb75ae905 (patch)
tree2a68738538cf7d32c67a08e4763ea2e720867fc2 /profile.c
parent6e1521ee04ea12f551f8c98d669b13ab13a25a8c (diff)
downloadegawk-6c6d5fbd85be4a94600ca20b4ad0765bb75ae905.tar.gz
egawk-6c6d5fbd85be4a94600ca20b4ad0765bb75ae905.tar.bz2
egawk-6c6d5fbd85be4a94600ca20b4ad0765bb75ae905.zip
Add comments to @load. Start for @include.
Diffstat (limited to 'profile.c')
-rw-r--r--profile.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/profile.c b/profile.c
index 502ba7c6..e023f55b 100644
--- a/profile.c
+++ b/profile.c
@@ -1264,17 +1264,28 @@ print_lib_list(FILE *prof_fp)
{
SRCFILE *s;
static bool printed_header = false;
+ const char *indent = "";
+ bool found = false;
+
+ if (do_profile)
+ indent = "\t";
for (s = srcfiles->next; s != srcfiles; s = s->next) {
if (s->stype == SRC_EXTLIB) {
- if (! printed_header) {
+ if (do_profile && ! printed_header) {
printed_header = true;
- fprintf(prof_fp, _("\t# Loaded extensions (-l and/or @load)\n\n"));
+ fprintf(prof_fp, _("%s# Loaded extensions (-l and/or @load)\n\n"), indent);
}
- fprintf(prof_fp, "\t@load \"%s\"\n", s->src);
+ found = true;
+ fprintf(prof_fp, "%s@load \"%s\"", indent, s->src);
+ if (s->comment != NULL) {
+ fprintf(prof_fp, "\t");
+ print_comment(s->comment, indent_level + 1);
+ } else
+ fprintf(prof_fp, "\n");
}
}
- if (printed_header) /* we found some */
+ if (found) /* we found some */
fprintf(prof_fp, "\n");
}