aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/expand.cpp
diff options
context:
space:
mode:
authorGravatar Kurtis Rader <krader@skepticism.us>2016-04-03 19:02:46 -0700
committerGravatar Kurtis Rader <krader@skepticism.us>2016-04-03 19:02:46 -0700
commit9dd6873e5855f69b01f2e3705a49a4231c992e71 (patch)
tree7fc073cc4780b381285567b1df1b6caf9966bb00 /src/expand.cpp
parent3f1fc332e7451187b1b9806f544bc8199fa412a8 (diff)
lint: remove or comment out unused functions
Cppcheck has identified a lot of unused functions. This removes funcs that are unlikely to ever be used. Others that might be useful for debugging I've commented out with "#if 0".
Diffstat (limited to 'src/expand.cpp')
-rw-r--r--src/expand.cpp56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/expand.cpp b/src/expand.cpp
index c2b4258c..de67ffa8 100644
--- a/src/expand.cpp
+++ b/src/expand.cpp
@@ -1998,62 +1998,6 @@ bool fish_xdm_login_hack_hack_hack_hack(std::vector<std::string> *cmds, int argc
return result;
}
-bool fish_openSUSE_dbus_hack_hack_hack_hack(std::vector<completion_t> *args)
-{
- static signed char isSUSE = -1;
- if (isSUSE == 0)
- return false;
-
- bool result = false;
- if (args && ! args->empty())
- {
- const wcstring &cmd = args->at(0).completion;
- if (cmd.find(L"DBUS_SESSION_BUS_") != wcstring::npos)
- {
- /* See if we are SUSE */
- if (isSUSE < 0)
- {
- struct stat buf = {};
- isSUSE = (0 == stat("/etc/SuSE-release", &buf));
- }
-
- if (isSUSE)
- {
- /* Look for an equal sign */
- size_t where = cmd.find(L'=');
- if (where != wcstring::npos)
- {
- /* Oh my. It's presumably of the form foo=bar; find the = and split */
- const wcstring key = wcstring(cmd, 0, where);
-
- /* Trim whitespace and semicolon */
- wcstring val = wcstring(cmd, where+1);
- size_t last_good = val.find_last_not_of(L"\n ;");
- if (last_good != wcstring::npos)
- val.resize(last_good + 1);
-
- args->clear();
- append_completion(args, L"set");
- if (key == L"DBUS_SESSION_BUS_ADDRESS")
- append_completion(args, L"-x");
- append_completion(args, key);
- append_completion(args, val);
- result = true;
- }
- else if (string_prefixes_string(L"export DBUS_SESSION_BUS_ADDRESS;", cmd))
- {
- /* Nothing, we already exported it */
- args->clear();
- append_completion(args, L"echo");
- append_completion(args, L"-n");
- result = true;
- }
- }
- }
- }
- return result;
-}
-
bool expand_abbreviation(const wcstring &src, wcstring *output)
{
if (src.empty())