]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/cmd/sed.c
rio, kbdfs: increase read buffer for high latency kbdfs support
[plan9front.git] / sys / src / cmd / sed.c
index 914aab7f330e025725f4a2fa4dfef79d194985bf..46d3cad6acd81a68f5b932b3ca7ab8e7c1454827 100644 (file)
@@ -96,7 +96,7 @@ SedCom pspace[MAXCMDS];                       /* Command storage */
 SedCom *pend = pspace+MAXCMDS;         /* End of command storage */
 SedCom *rep = pspace;                  /* Current fill point */
 
-int    dollars;                        /* Number of dollar addresses */
+int    dollars;                        /* Number of dollar (first) addresses */
 
 Reprog *lastre;                        /* Last regular expression */
 Resub  subexp[MAXSUB];                 /* sub-patterns of pattern match*/
@@ -290,6 +290,8 @@ comploop:
 
                address(&rep->ad1);
                if (rep->ad1.type != A_NONE) {
+                       if (rep->ad1.type == A_DOL)
+                               dollars++;
                        if (rep->ad1.type == A_LAST) {
                                if (!lastre)
                                        quit("First RE may not be null");
@@ -765,10 +767,9 @@ address(Addr *ap)
        int c;
        long lno;
 
-       if((c = *cp++) == '$'){
+       if((c = *cp++) == '$')
                ap->type = A_DOL;
-               dollars++;
-       }else if(c == '/') {
+       else if(c == '/') {
                seof = c;
                if (ap->rp = compile())
                        ap->type = A_RE;