devdraw: fix dangling else
Because of a dangling else, after adding a name to an image with 'N',
it was immediately deleted, resulting in Enoname in response to 'n'.
This went mostly unnoticed, since plan9port itself does not use named
images, but it can break external applications like truedraw[1].
[1]: https://git.sr.ht/~arusekk/truedraw
Fixes: c66b52501b ("new draw server")
This commit is contained in:
@@ -1107,10 +1107,10 @@ draw_datawrite(Client *client, void *v, int n)
|
||||
goto Enodrawimage;
|
||||
if(di->name)
|
||||
goto Enamed;
|
||||
if(c)
|
||||
if(c){
|
||||
if(drawaddname(client, di, j, (char*)a+7, &err) < 0)
|
||||
goto error;
|
||||
else{
|
||||
}else{
|
||||
dn = drawlookupname(client, j, (char*)a+7);
|
||||
if(dn == nil)
|
||||
goto Enoname;
|
||||
|
||||
Reference in New Issue
Block a user