瀏覽代碼

Fix `su` being used for both flag and function

Weiyi Lou 10 年之前
父節點
當前提交
203f4f3645
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      js/pgsh.js

+ 4 - 4
js/pgsh.js

@@ -72,8 +72,8 @@ function pgsh(ev) {
          'href="http://slightlymagic.com.au">slightlymagic.com.au</a>')
   }
   this.su = function(args) {
-    if (self.su !== true) {
-      self.su = true
+    if (self.su_active !== true) {
+      self.su_active = true
       if (!self.su_warned) {
         self.su_warned = true
         show('We trust you have received the usual lecture from the ' +
@@ -87,8 +87,8 @@ function pgsh(ev) {
     }
   }
   this.exit = function(args) {
-    if (self.su) {
-      self.su = false
+    if (self.su_active) {
+      self.su_active = false
       ev.trigger('prompt_set', self.prompt)
       return
     }