diff options
Diffstat (limited to 'src/expand.cpp')
-rw-r--r-- | src/expand.cpp | 56 |
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()) |