@@ -41,6 +41,28 @@ std::string get_uuid()
4141
4242std::string startup_cmd = " None" ;
4343
44+ const char *ws = " \t\n\r\f\v " ;
45+
46+ // trim from end of string (right)
47+ inline std::string &rtrim (std::string &s, const char *t = ws)
48+ {
49+ s.erase (s.find_last_not_of (t) + 1 );
50+ return s;
51+ }
52+
53+ // trim from beginning of string (left)
54+ inline std::string <rim (std::string &s, const char *t = ws)
55+ {
56+ s.erase (0 , s.find_first_not_of (t));
57+ return s;
58+ }
59+
60+ // trim from both ends of string (right then left)
61+ inline std::string &trim (std::string &s, const char *t = ws)
62+ {
63+ return ltrim (rtrim (s, t), t);
64+ }
65+
4466void signal_handler (int signumber)
4567{
4668 try
@@ -101,8 +123,23 @@ bool BeginCrashListener()
101123 }
102124
103125 startup_cmd = CommandLine ()->GetCmdLine ();
126+ std::vector<std::string> exp = explode (startup_cmd, " " );
127+ std::vector<std::string> exp2;
128+ for (int i = 1 ; i < exp.size (); i++)
129+ {
130+ std::string str = trim (exp[i]);
131+ if (str.length () == 0 )
132+ continue ;
133+ if (exp2.size () > 0 )
134+ if (ends_with (exp2[exp2.size () - 1 ], " sv_setsteamaccount" ) || ends_with (exp2[exp2.size () - 1 ], " authkey" ))
135+ str = " REDACTED" ;
136+
137+ exp2.push_back (str);
138+ }
139+ startup_cmd = implode (exp2, " " );
104140
105141 ::signal (SIGSEGV, &signal_handler);
142+
106143 return true ;
107144}
108145
0 commit comments