diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2018-10-20 21:26:21 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2018-10-20 21:26:21 +0300 |
commit | 6c6d5fbd85be4a94600ca20b4ad0765bb75ae905 (patch) | |
tree | 2a68738538cf7d32c67a08e4763ea2e720867fc2 /profile.c | |
parent | 6e1521ee04ea12f551f8c98d669b13ab13a25a8c (diff) | |
download | egawk-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.c | 19 |
1 files changed, 15 insertions, 4 deletions
@@ -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"); } |