fix read/write to scope
Iris Lightshard nilix@nilfm.cc
PGP Signature
-----BEGIN PGP SIGNATURE----- iQIzBAABCAAdFiEEkFh6dA+k/6CXFXU4O3+8IhROY5gFAmECOlUACgkQO3+8IhRO Y5g+Wg/9HnXDNH1qZlRJ1ZRSpuSGdzzyIAWh6VwlP2O3X6rqFP+TI0gMJdZ0DxFv F087hZN5Oc/5Rnbol1ZkRe3K/vbUC0vdLNwYeqBTAcm6sOWiTMAMiwoINO59072/ VKzLNNzRZwsqAZo42zoU0ZxQPgsQnkWdz8tZbE2isWBBvXPm07yE0jEeppShixij zXAVGuSivu+vzPxmMKOKFPTUqlx3RrAmQIAQG3fglIwcgK1hTNtCvYhK0h5f6eXh nyOygWqhMBT8jX7cMNYSXdbI0yr/LQ/WzTd7/53Tz9Ghgo2up0nr1D+gdjgTac25 WvMvp8mJNxTTpdBYY1xi5nXNVzHxOgeFazpV4inOL4T/8dNKAZLT8uxe6KA0NF4W n5lTULuU2mDJz42nT3CkBfNy5BxxWoSNn/FZlhM3fZ8lHFVO/INKRa2QY86GEIqm PdCyChlEiLqfSe+sFm999lWPpJZG/VLubdKTyErHHim0pDbpNqCVVqAEKSJFcGBU qfGiA7XBHYS5qDR0hBzqViQcJBR19uta3YW5H/1XTFY3CH1EvpKC5NRFVRlpdiTm eBGK2nqUwfg9Op1JwOLk3R2QikBTdt9Nea1pMfKrrVJKpqU7DvqlEhyc37tQYWRq CxYW5W/0IRgKIxiRHxM2gbgAEB3grP1jcaMdk8qMKRB1klIyAq8= =93UT -----END PGP SIGNATURE-----
1 files changed,
8 insertions(+),
1 deletions(-)
jump to
M
xrxs.c
→
xrxs.c
@@ -160,6 +160,7 @@ for (i = 0; i < r->ifcall.count; i++) {
s_putc(scope, *c++); } s_terminate(scope); + fprintf(stderr, scope->base); if (u != nil && u->realm != nil && u->realm->universe != nil) { u->scope = malloc(r->ifcall.count);@@ -182,6 +183,7 @@ write_universe(r);
break; case SCOPE: write_scope(r); + break; default: respond(r, nil); break;@@ -398,13 +400,14 @@ String* data = s_new();
Universe* universe; Atom* a; char key[16] = {0}; - char* c = u->scope; + char* c; if (u == nil || u->scope == nil || u->realm == nil) { respond(r, nil); return; } + c = u->scope; universe = u->realm->universe; if (universe == nil) { respond(r, ENOUNI);@@ -421,6 +424,8 @@ s_append(data, a->value);
s_putc(data, '\n'); } *key = '\0'; + if (*c == '\0') + break; c++; }@@ -435,6 +440,7 @@ char buf[8] = {0};
srand(rand()); sprintf(buf, "%d\n", rand() % 100); readstr(r, buf); + respond(r, nil); } void read_grandom(Req* r) {@@ -478,6 +484,7 @@ }
sprintf(buf, "%d\n", u->random); u->random = -1; readstr(r, buf); + respond(r, nil); } void xrxs_read(Req* r) {