summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaakko Keränen <jaakko.keranen@iki.fi>2021-02-02 12:52:04 +0200
committerJaakko Keränen <jaakko.keranen@iki.fi>2021-02-02 12:52:04 +0200
commitb868d336e7facc4b227ae3aff056188ca226167d (patch)
tree11294192ed812bf468f924c93b862518db25e60e
parent49bda577d061dd3949939f0ef959b8daaec45a95 (diff)
App: List environment variables in "about:debug"
-rw-r--r--src/app.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/app.c b/src/app.c
index 82628c9c..29d88c2b 100644
--- a/src/app.c
+++ b/src/app.c
@@ -501,6 +501,7 @@ const iString *downloadDir_App(void) {
501} 501}
502 502
503const iString *debugInfo_App(void) { 503const iString *debugInfo_App(void) {
504 extern char **environ; /* The environment variables. */
504 iApp *d = &app_; 505 iApp *d = &app_;
505 iString *msg = collectNew_String(); 506 iString *msg = collectNew_String();
506 format_String(msg, "# Debug information\n"); 507 format_String(msg, "# Debug information\n");
@@ -512,6 +513,11 @@ const iString *debugInfo_App(void) {
512 cstr_String(bookmarkTitle_DocumentWidget(doc))); 513 cstr_String(bookmarkTitle_DocumentWidget(doc)));
513 append_String(msg, collect_String(debugInfo_History(history_DocumentWidget(doc)))); 514 append_String(msg, collect_String(debugInfo_History(history_DocumentWidget(doc))));
514 } 515 }
516 appendCStr_String(msg, "## Environment\n```\n");
517 for (char **env = environ; *env; env++) {
518 appendFormat_String(msg, "%s\n", *env);
519 }
520 appendCStr_String(msg, "```\n");
515 appendFormat_String(msg, "## Launch arguments\n```\n"); 521 appendFormat_String(msg, "## Launch arguments\n```\n");
516 iConstForEach(StringList, i, args_CommandLine(&d->args)) { 522 iConstForEach(StringList, i, args_CommandLine(&d->args)) {
517 appendFormat_String(msg, "%3zu : %s\n", i.pos, cstr_String(i.value)); 523 appendFormat_String(msg, "%3zu : %s\n", i.pos, cstr_String(i.value));
@@ -519,7 +525,7 @@ const iString *debugInfo_App(void) {
519 appendFormat_String(msg, "```\n## Launch commands\n"); 525 appendFormat_String(msg, "```\n## Launch commands\n");
520 iConstForEach(StringList, j, d->launchCommands) { 526 iConstForEach(StringList, j, d->launchCommands) {
521 appendFormat_String(msg, "%s\n", cstr_String(j.value)); 527 appendFormat_String(msg, "%s\n", cstr_String(j.value));
522 } 528 }
523 appendFormat_String(msg, "## MIME hooks\n"); 529 appendFormat_String(msg, "## MIME hooks\n");
524 append_String(msg, debugInfo_MimeHooks(d->mimehooks)); 530 append_String(msg, debugInfo_MimeHooks(d->mimehooks));
525 return msg; 531 return msg;