Make sure escape sequences don't leak into the prompt.
[profile.git] / .profile.d / krb5.bashrc
index 2ca4337..034dadd 100644 (file)
@@ -87,6 +87,11 @@ fi
 
 unset cache ccname default ng
 function kinit() {
-  [ -n "$KRB5CCNAME" ] && krb5ccname="env KRB5CCNAME=$KRB5CCNAME"
-  ( builtin cd /; exec -c $krb5ccname kinit ${1+"$@"} )
+  local args=
+  local krb5ccname=
+  if [ -n "$KRB5CCNAME" ]; then
+    args="$@"
+    [ "${args/-c /}" = "$args" ] && krb5ccname="-c $KRB5CCNAME"
+  fi
+  ( builtin cd /; exec -c kinit $krb5ccname ${1+"$@"} )
 }