lib9: make netmkaddr handle unix! addresses better

This commit is contained in:
Russ Cox 2008-06-11 06:35:51 -07:00
parent 226cc90ba7
commit e082105c33

View file

@ -45,12 +45,18 @@ netmkaddr(char *linear, char *defnet, char *defsrv)
if(cp)
return linear;
/*
* if the network is unix, no service
*/
if(strncmp(linear, "unix!", 5) == 0)
return linear;
/*
* add default service
*/
if(defsrv == 0)
return linear;
snprint(addr, sizeof(addr), "%s!%s", linear, defsrv);
snprint(addr, sizeof(addr), "%s!%s", linear, defsrv);
return addr;
}