Skip to content

Commit c53f597

Browse files
committed
Fix release build error.
1 parent c20e8b9 commit c53f597

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

clink/lib/src/line_editor_impl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -571,7 +571,7 @@ bool line_editor_impl::notify_matches_ready(int32 generation_id, matches* matche
571571
m_matches.transfer(static_cast<matches_impl&>(*matches));
572572
m_matches.done_building();
573573
clear_flag(flag_generate);
574-
if (dbg_get_env_int("CLINK_LOG_GENERATORS"))
574+
if (get_log_generators())
575575
{
576576
str<> tmp;
577577
int32 i = 0;
@@ -598,7 +598,7 @@ bool line_editor_impl::notify_matches_ready(int32 generation_id, matches* matche
598598
// newer generation id's autosuggest will have been canceled due to the
599599
// match generator coroutine that was already running, and which has
600600
// just now signaled its completion.
601-
if (dbg_get_env_int("CLINK_LOG_GENERATORS"))
601+
if (get_log_generators())
602602
{
603603
LOG("CLEAR MATCHES: matches gen %d vs editor gen %d", generation_id, m_matches_generation_id);
604604
}
@@ -1729,7 +1729,7 @@ void line_editor_impl::try_suggest()
17291729
// cannot work with wildcards or substrings.
17301730
rollback<int32> rb_completion_type(rl_completion_type, TAB);
17311731

1732-
if (dbg_get_env_int("CLINK_LOG_GENERATORS"))
1732+
if (get_log_generators())
17331733
{
17341734
LOG("try_suggest, update_matches");
17351735
}

clink/lib/src/match_pipeline.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ extern setting_bool g_match_wild;
5454

5555

5656

57+
//------------------------------------------------------------------------------
58+
int32 get_log_generators()
59+
{
60+
char tmp[32];
61+
int32 len = GetEnvironmentVariableA("CLINK_LOG_GENERATORS", tmp, sizeof(tmp));
62+
int32 val = (len > 0 && len < sizeof(tmp)) ? atoi(tmp) : 0;
63+
return val;
64+
}
65+
5766
//------------------------------------------------------------------------------
5867
static bool include_match_type(match_type type)
5968
{
@@ -335,7 +344,7 @@ void match_pipeline::generate(
335344

336345
m_matches.done_building();
337346

338-
if (dbg_get_env_int("CLINK_LOG_GENERATORS"))
347+
if (get_log_generators())
339348
{
340349
str<> tmp;
341350
int32 i = 0;

clink/lib/src/match_pipeline.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@ class match_pipeline
2525
private:
2626
matches_impl& m_matches;
2727
};
28+
29+
//------------------------------------------------------------------------------
30+
int32 get_log_generators();

0 commit comments

Comments
 (0)