projects
/
unix-history
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
tags
|
clone url
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Must distinguish between "ambiguous" and "unknown" commands.
[unix-history]
/
usr
/
src
/
usr.bin
/
window
/
context.c
diff --git
a/usr/src/usr.bin/window/context.c
b/usr/src/usr.bin/window/context.c
index
1e38191
..
2f09d53
100644
(file)
--- a/
usr/src/usr.bin/window/context.c
+++ b/
usr/src/usr.bin/window/context.c
@@
-1,9
+1,16
@@
#ifndef lint
#ifndef lint
-static char
*sccsid = "@(#)context.c 3.1 83/11/22
";
+static char
sccsid[] = "@(#)context.c 3.7 %G%
";
#endif
#endif
+/*
+ * Copyright (c) 1983 Regents of the University of California,
+ * All rights reserved. Redistribution permitted subject to
+ * the terms of the Berkeley Software License Agreement.
+ */
+
#include <stdio.h>
#include "value.h"
#include <stdio.h>
#include "value.h"
+#include "string.h"
#include "context.h"
/*
#include "context.h"
/*
@@
-18,7
+25,7
@@
cx_alloc()
if (cx.x_type != 0) {
xp = (struct context *)
if (cx.x_type != 0) {
xp = (struct context *)
- malloc(
1,
(unsigned) sizeof (struct context));
+ malloc((unsigned) sizeof (struct context));
if (xp == 0)
return -1;
*xp = cx;
if (xp == 0)
return -1;
*xp = cx;
@@
-33,14
+40,16
@@
cx_alloc()
cx_free()
{
cx_free()
{
- if (cx.x_link != 0) {
- free(cx.x_link);
- cx = *cx.x_link;
+ struct context *xp;
+
+ if ((xp = cx.x_link) != 0) {
+ cx = *xp;
+ free((char *)xp);
} else
cx.x_type = 0;
}
} else
cx.x_type = 0;
}
-cx_
set
file(filename)
+cx_
begin
file(filename)
char *filename;
{
if (cx_alloc() < 0)
char *filename;
{
if (cx_alloc() < 0)
@@
-54,7
+63,7
@@
char *filename;
cx.x_bol = 1;
cx.x_lineno = 0;
cx.x_errwin = 0;
cx.x_bol = 1;
cx.x_lineno = 0;
cx.x_errwin = 0;
- cx.x_
bad
err = 0;
+ cx.x_
no
err = 0;
return 0;
bad:
if (cx.x_filename != 0)
return 0;
bad:
if (cx.x_filename != 0)
@@
-63,13
+72,17
@@
bad:
return -1;
}
return -1;
}
-cx_
setbuf(buf
)
+cx_
beginbuf(buf, arg, narg
)
char *buf;
char *buf;
+struct value *arg;
+int narg;
{
if (cx_alloc() < 0)
return -1;
cx.x_type = X_BUF;
cx.x_bufp = cx.x_buf = buf;
{
if (cx_alloc() < 0)
return -1;
cx.x_type = X_BUF;
cx.x_bufp = cx.x_buf = buf;
+ cx.x_arg = arg;
+ cx.x_narg = narg;
return 0;
}
return 0;
}