Pfadexpansion mit normalize_path()
Expansion von Pfadplatzhaltern und Normalisieren der Pfade
via normalize_path() aus /std/util/path
Change-Id: If42304c030f0725f13786454bbb71e5c594ba4bd
diff --git a/std/shells/magier/fileedit.c b/std/shells/magier/fileedit.c
index 655bab2..d34b3be 100644
--- a/std/shells/magier/fileedit.c
+++ b/std/shells/magier/fileedit.c
@@ -9,6 +9,8 @@
#pragma no_clone
#pragma pedantic
+protected functions virtual inherit "/std/util/path";
+
#include <wizlevels.h>
#include <input_to.h>
@@ -69,9 +71,8 @@
if (sizeof(args2=file_list(args[arg_size..arg_size],MODE_ED,0,"/")))
args[arg_size..arg_size]=args2;
else
- args[arg_size]=({ "" , -1, 0 , (string)
- call_other(master(),"_get_path",args[arg_size],
- getuid())});
+ args[arg_size]=({ "" , -1, 0 ,
+ normalize_path(args[arg_size], getuid(), 1) });
}
args=map(args,(:
if ($1[FILESIZE]>=FSIZE_NOFILE) return $1[FULLNAME];
diff --git a/std/shells/magier/magier_ext.c b/std/shells/magier/magier_ext.c
index a5d30b2..e563ca9 100644
--- a/std/shells/magier/magier_ext.c
+++ b/std/shells/magier/magier_ext.c
@@ -5,6 +5,8 @@
#pragma no_clone
#pragma pedantic
+protected functions virtual inherit "/std/util/path";
+
#include <wizlevels.h>
#include <logging.h>
#include <magier.h>
@@ -259,14 +261,14 @@
if (this_player()!=this_interactive()) return 0;
if (this_player()!=this_object()) return 0;
if (!(filename=_unparsed_args())) return USAGE("exec <objektname>");
- filename=(string)"secure/master"->_get_path(filename,getuid());
+ filename=normalize_path(filename, getuid(), 1);
if (file_size(filename)<0&&(!to_filename(filename+".c"))||
file_size(to_filename(filename+".c"))<0)
{
printf("exec: %s: Datei nicht vorhanden oder ein Verzeichnis.\n",filename);
return 1;
}
- if (catch(call_other(filename,"????")))
+ if (catch(load_object(filename)))
{
printf("exec: Fehler beim Laden von %s.\n",filename);
return 1;
diff --git a/std/shells/magier/moving.c b/std/shells/magier/moving.c
index 1aac3c3..ccb5535 100644
--- a/std/shells/magier/moving.c
+++ b/std/shells/magier/moving.c
@@ -9,6 +9,8 @@
#pragma no_clone
#pragma pedantic
+protected functions virtual inherit "/std/util/path";
+
#define NEED_PROTOTYPES
#include <magier.h>
#include <thing/properties.h>
@@ -74,7 +76,7 @@
sscanf(str, "%s %s", room, cmd) != 2)
return USAGE("in <raum> <befehl>\n");
old_room = environment();
- room=(string)call_other(master(),"_get_path",room,getuid());
+ room=normalize_path(room, getuid(), 1);
if (err=catch(move_object(room)))
{
if (catch(size=file_size(room+".c"))||size < 0)
@@ -134,7 +136,7 @@
return USAGE("goto [lebewesen|filename]\n");
if (!((target=find_living_nr(dest)) && (target=environment(target))))
{
- target2=target=(mixed)call_other(master(),"_get_path",dest,getuid());
+ target2=target=normalize_path(dest, getuid(), 1);
if (!find_object(target))
{
// ggf. .c dranhaengen