- while ((rep = getrmtabent(1)) != NULL) {
- if (strcmp (rep->r_client, hname)
- || strcmp(rep->r_path, path))
- fputrmtabent(fp, rep);
+ while ((rep = getrmtabent(1, NULL)) != NULL) {
+ match = !strcmp (rep->r_client, hname)
+ && !strcmp(rep->r_path, path);
+ if (match)
+ rep->r_count--;
+ if (!match || rep->r_count)
+ fputrmtabent(fp, rep, NULL);