/[erbot]/erbot/erbc5.el
ViewVC logotype

Diff of /erbot/erbc5.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10 by deego, Sat Jan 1 04:37:31 2005 UTC revision 1.11 by deego, Sat Jan 8 17:53:08 2005 UTC
# Line 1  Line 1 
1  ;;; erbc5.el --- continuation of erbc.el  ;;; erbc5.el --- continuation of erbc.el
2  ;; Time-stamp: <2004-12-31 22:45:55 deego>  ;; Time-stamp: <2005-01-08 12:52:25 deego>
3  ;; Copyright (C) 2003 D. Goel  ;; Copyright (C) 2003 D. Goel
4  ;; Emacs Lisp Archive entry  ;; Emacs Lisp Archive entry
5  ;; Filename: erbc5.el  ;; Filename: erbc5.el
# Line 175  to query using PROMPT, or just return t. Line 175  to query using PROMPT, or just return t.
175    
176  (ignore-errors (require 'calc))  (ignore-errors (require 'calc))
177    
178  (defvar erbnoc-calc-time 3)  (defvar erbn-calc-time 3)
179  (defcustom erbnoc-calc-p nil  (defcustom erbn-calc-p nil
180    "Enable this variable at your own risk.    "Enable this variable at your own risk.
181  Enabling this means that fsbot will do calc operations, but those have  Enabling this means that fsbot will do calc operations, but those have
182  no timeout build in... leading to DOS attacks. ")  no timeout build in... leading to DOS attacks. ")
# Line 191  waiting for user input.. Line 191  waiting for user input..
191  which is why turned off by default.  which is why turned off by default.
192    
193  "  "
194    (unless erbnoc-calc-p    (unless erbn-calc-p
195      (error "Sorry, but i am a bot! not a calc!"))      (error "Sorry, but i am a bot! not a calc!"))
196    (unless str (error "Eval what?"))    (unless str (error "Eval what?"))
197    (unless (stringp str)    (unless (stringp str)
198      (setq str (format "%s" str)))      (setq str (format "%s" str)))
199    (with-timeout    (with-timeout
200        (erbnoc-calc-time "That's WAY too much math for me!")        (erbn-calc-time "That's WAY too much math for me!")
201      (calc-eval str)))      (calc-eval str)))
202            
203  (defalias 'fs-calc 'fs-calc-eval)  (defalias 'fs-calc 'fs-calc-eval)
# Line 205  which is why turned off by default. Line 205  which is why turned off by default.
205  (erbutils-defalias '(process-list))  (erbutils-defalias '(process-list))
206  (defalias 'fs-list-processes 'fs-process-list)  (defalias 'fs-list-processes 'fs-process-list)
207    
208  (defcustom erbnoc-sregex-p nil  (defcustom erbn-sregex-p nil
209    "Nil by default for safety. Enable to permit fs-sregex.    "Nil by default for safety. Enable to permit fs-sregex.
210  I think it is safe, but not 100% sure, so disabled by default. --DG"  I think it is safe, but not 100% sure, so disabled by default. --DG"
211    )    )
# Line 218  I think it is safe, but not 100% sure, s Line 218  I think it is safe, but not 100% sure, s
218    
219  (defun fsi-sregex (&rest args)  (defun fsi-sregex (&rest args)
220    (cond    (cond
221     (erbnoc-sregex-p     (erbn-sregex-p
222      (apply 'sregex args))      (apply 'sregex args))
223     (t     (t
224      (error "sregexp is disabled in this bot. "))))      (error "sregexp is disabled in this bot. "))))

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26