/* * Scol Voyager * * Author : The Scol Team : http://www.scolring.org/ * * This file is a part of the Scol Voyager * * This program is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free Software * Foundation; either version 2 of the License, or (at your option) any later * version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License along with * this program; if not, write to the Free Software Foundation, Inc., 59 Temple * Place - Suite 330, Boston, MA 02111-1307, USA, or go to * http://www.gnu.org/copyleft/lesser.txt * * For others informations, please contact us from http://www.scolring.org/ * */ /* * Update 2014 12, 16 : S.BISARO ($IRI) : new tree files * */ defcom maincom = main S I S;; defcom CaddHistory = addHistory S;; // correct url spaces fun correctUrl(s)= if ((strfindi "https://" s 0) != nil)||((strfindi "http://" s 0) != nil)||((strfindi "file://" s 0) != nil)||((strfind "ftp://" s 0) != nil) then ( let 0 -> pos in let " " -> from in let "%20" -> to in let strlen from -> fsize in let strlen to -> tsize in if ((fsize <= 0) || (tsize <= 0)) then s else while ((set pos = strfind from s pos) != nil) do set s = strcatn (substr s 0 pos)::to::(substr s (pos + fsize) ((strlen s) - pos))::nil; ) else nil; s;; fun main(name, r, s)= // add the url in voyager history _on _masterchannel CaddHistory [name]; _load "lib/loc/loc.pkg"; _load "lib/locked/stduser1.pkg"; _script mkscript maincom [(correctUrl name) r s]; 0;;