/* open and lock the file to be annotated */
if ((fd = lkopen(file, O_RDWR, 0)) == NOTOK) {
switch (errno) {
- case ENOENT:
- break;
+ case ENOENT:
+ break;
- default:
- admonish(file, "unable to lock and open");
- break;
+ default:
+ admonish(file, "unable to lock and open");
+ break;
}
return 1;
}
if (number)
printf("%d\t", ++count);
- if (text == (char *)0 && (sp = strrchr(cp, '/')) != (char *)0)
+ if (text == NULL && (sp = strrchr(cp, '/')) != NULL)
cp = sp + 1;
printf("%s\n", cp);
if (strncasecmp(field, comp, length) == 0 && field[length] == ':') {
if (delete == 0) {
- if (text == (char *)0)
+ if (text == NULL)
break;
for (cp = field + length + 1; *cp == ' ' || *cp == '\t'; cp++)
break;
}
else {
- if ((sp = strrchr(cp, '/')) != (char *)0)
+ if ((sp = strrchr(cp, '/')) != NULL)
cp = sp + 1;
if (strcmp(cp, text) == 0)
strncpy(buffer, m_backup(file), sizeof(buffer));
if (rename(file, buffer) == NOTOK) {
switch (errno) {
- case ENOENT: /* unlinked early - no annotations */
- unlink(tmpfil);
- break;
+ case ENOENT: /* unlinked early - no annotations */
+ unlink(tmpfil);
+ break;
- default:
- admonish(buffer, "unable to rename %s to", file);
- break;
+ default:
+ admonish(buffer, "unable to rename %s to",
+ file);
+ break;
}
return 1;
}