aboutsummaryrefslogtreecommitdiffstats
path: root/pw.c
diff options
context:
space:
mode:
Diffstat (limited to 'pw.c')
-rw-r--r--pw.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/pw.c b/pw.c
index 1e4ce19..174dac4 100644
--- a/pw.c
+++ b/pw.c
@@ -709,17 +709,18 @@ static int decodeparms(pwstate *pw, char *parms,
snprintf(resbuf, size, "bad flags %s: %s\n", flags, err);
return 0;
}
- pw->stat = stat & stat_save;
+ pw->stat &= ~stat_save;
+ pw->stat |= (stat & stat_save);
}
return 1;
}
-static execode execute(pwstate *pw, const char *cmd, char *resbuf,
+static execode execute(pwstate *pw, char *cmd, char *resbuf,
size_t size, int count)
{
execode res = exec_failed;
- const char *arg = cmd + 2 + strspn(cmd + 2, " \t");
+ char *arg = cmd + 2 + strspn(cmd + 2, " \t");
clrline(0);
@@ -874,6 +875,14 @@ static execode execute(pwstate *pw, const char *cmd, char *resbuf,
res = exec_ok;
}
break;
+ case 'p':
+ {
+ if (decodeparms(pw, arg, resbuf, size)) {
+ pw->stat |= stat_force;
+ res = exec_ok;
+ }
+ }
+ break;
case 's':
{
int rflg = 0;
@@ -889,6 +898,9 @@ static execode execute(pwstate *pw, const char *cmd, char *resbuf,
break;
}
+ fprintf(f, ":p%d,%d,%d,%d,%d\n", pw->hpos, pw->vsplit1, pw->vsplit2,
+ pw->vs2pos, (int) pw->stat & stat_save);
+
if (pw->tcount)
fprintf(f, ":f%d\n", pw->tcount);
if (pw->sncount)
@@ -998,7 +1010,7 @@ static execode execute(pwstate *pw, const char *cmd, char *resbuf,
return res;
}
-static execode batchexe(pwstate *pw, const char *cmd, char *resbuf, size_t size)
+static execode batchexe(pwstate *pw, char *cmd, char *resbuf, size_t size)
{
size_t ndigits = strspn(cmd, "0123456789");
int count = 0;