chiark / gitweb /
fixes during movpos wip
authorian <ian>
Thu, 10 Apr 2008 18:53:36 +0000 (18:53 +0000)
committerian <ian>
Thu, 10 Apr 2008 18:53:36 +0000 (18:53 +0000)
hostside/commands.c
hostside/parseutils.c
hostside/realtime.c

index 55fcc3b770aff042803b8d750a0c15185aec466a..1c9953ae156a4f28ffbc0e17fe2d29f374d82014 100644 (file)
@@ -203,11 +203,13 @@ static void cmd_movfeat(ParseState *ps, const CmdInfo *ci) {
   if (!ps_neednoargs(ps)) return;
 
   ec= movpos_change(back,move,fwd,ms,0);
-  if (ec)
+  if (ec) {
     badcmd(ps,"movfeat %s %s %s %ld %s",
           back->i->pname, move->i->pname, fwd->i->pname,
           ms==INT_MAX ? -1L : ms,
           errorcodelist[ec]);
+    return;
+  }
 
   ouack(ci);  
 }
index d1509f3ff528bfb880ac9a601c641eaac9e33dec..c41bbd0bbe228ef954b68da127220eb6251b08cc 100644 (file)
@@ -100,7 +100,7 @@ const void *any_lookup(ParseState *ps, const void *inf, int ninfsmax,
   
   for (i=0;
        i<ninfsmax && (tname= *(const char *const*)inf);
-       inf= (const char*)inf + sz)
+       i++, inf= (const char*)inf + sz)
     if (!thiswordstrcmp(ps,tname))
       return inf;
   return 0;
@@ -111,7 +111,10 @@ const void *any_needword_lookup(ParseState *ps, const void *infs, int ninfsmax,
   const void *r;
   if (!ps_needword(ps)) return 0;
   r= any_lookup(ps,infs,ninfsmax,sz);
-  if (!r) { badcmd(ps,"unknown %s",what); return 0; }
+  if (!r) {
+    badcmd(ps,"unknown %s %.*s",what, ps->lthisword,ps->thisword);
+    return 0;
+  }
   return r;
 }
 
index ae2082b610c60fdef975a9610930a921c4e71782..fbaa090d611fa0d8c7b52c5cb5b216a195979744 100644 (file)
@@ -260,9 +260,8 @@ void die_hook(void) {
 int ps_needsegment(ParseState *ps, Segment **seg_r,
                   const SegmentInfo **segi_r) {
   const SegmentInfo *segi;
-  if (!ps_needword(ps)) return 0;
   segi= some_needword_lookup_counted(ps,info_segments,info_nsegments,
-                                    ps->thisword);
+                                    "segment");
   if (!segi) return 0;
   if (segi_r) *segi_r= segi;
   if (seg_r) *seg_r= segments + (segi - info_segments);