skip traling spaces by operands
authorkaashoek <none@none>
Tue, 31 May 1988 13:16:48 +0000 (13:16 +0000)
committerkaashoek <none@none>
Tue, 31 May 1988 13:16:48 +0000 (13:16 +0000)
util/ceg/assemble/obj_assemble/assemble.c

index 3b54b79..c8a1866 100644 (file)
@@ -116,16 +116,23 @@ char *parse_operand( ptr, n_ops, instr)
        char *ptr, *instr;
        int  n_ops;
 {
-       char *op = ptr;
+       char *op = ptr,
+            *last;
 
        ptr = skip_operand( ptr, instr);
        if ( *ptr != '\0')  {
-               if ( *ptr == ',') 
-                       *ptr++ = '\0';
+               if ( *ptr == ',')  {
+                       for( last=ptr-1; isspace( *last); last--) 
+                               ;
+                       *(last+1) = '\0';
+               }
                else {
+                       fprintf(stderr, "strange operand format: %s\n", ptr);
+                       /* 
                        *ptr++ = '\0';
                        ptr = skip_space( ptr);
                        if  ( *ptr != '\0') ptr++;   /* skip ';' */
+                       */
                }
                ptr = skip_space( ptr);
        }