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
BSD 4 release
[unix-history]
/
usr
/
src
/
cmd
/
sdb
/
decode.c
diff --git
a/usr/src/cmd/sdb/decode.c
b/usr/src/cmd/sdb/decode.c
index
bf7c7ae
..
5951708
100644
(file)
--- a/
usr/src/cmd/sdb/decode.c
+++ b/
usr/src/cmd/sdb/decode.c
@@
-1,3
+1,4
@@
+static char sccsid[] = "@(#)decode.c 4.1 10/9/80";
#include "head.h"
/* decode() - read a line from standard input and decode it */
#include "head.h"
/* decode() - read a line from standard input and decode it */
@@
-5,7
+6,8
@@
decode(p)
char *p; {
register char c, *q;
decode(p)
char *p; {
register char c, *q;
- integ = scallf = reflag = colonflag = 0;
+ register int diff;
+ integ = scallf = reflag = colonflag = ncolonflag = percentflag = 0;
proc[0] = cmd = args[0] = var[0] = '\0';
argsp = args;
proc[0] = cmd = args[0] = var[0] = '\0';
argsp = args;
@@
-40,11
+42,15
@@
char *p; {
while (*p != '\n') { /* decode item by item */
if (number(*p)) { /* decimal number */
while (*p != '\n') { /* decode item by item */
if (number(*p)) { /* decimal number */
- if(integ) {
+ if
(integ) {
error("Too many numbers");
return(1);
}
integ = readint(&p);
error("Too many numbers");
return(1);
}
integ = readint(&p);
+ if (*p == ':') {
+ ncolonflag++;
+ p++;
+ }
continue;
}
continue;
}
@@
-78,11
+84,12
@@
char *p; {
}
if (((q-p == 1 && eqany(*p,COMMANDS) &&
(proc[0]=='\0' || eqany(*p, "abcd"))) ||
}
if (((q-p == 1 && eqany(*p,COMMANDS) &&
(proc[0]=='\0' || eqany(*p, "abcd"))) ||
- (integ && eqany(*p,COMMANDS))|| eqany(*p, "+-"))
+ (integ && eqany(*p,COMMANDS)) ||
+ eqany(*p, "+-?"))
&& !(*p=='-' && *(p+1) == '>'))
{ /* command */
cmd = *p++;
&& !(*p=='-' && *(p+1) == '>'))
{ /* command */
cmd = *p++;
- if (eqany(cmd, "acers")) {
+ if (eqany(cmd, "
M
acers")) {
while(*p == ' ')
p++;
p = cpall(args, p);
while(*p == ' ')
p++;
p = cpall(args, p);
@@
-95,6
+102,14
@@
char *p; {
return(1);
}
p = cpname(var, p);
return(1);
}
p = cpname(var, p);
+ if (*p == '%') {
+ percentflag++;
+ p++;
+ }
+ if (eqstr(var, ".?")) {
+ var[1] = '\0';
+ cmd = '?';
+ }
if (*p == '\n') {
cmd = '/';
continue;
if (*p == '\n') {
cmd = '/';
continue;