Allow deleting a record at database creation.
Using a magical record type "#" will allow the user to delete previously created record from the database.
This commit is contained in:
committed by
Andrew Johnson
parent
057eb87101
commit
535c9c2a06
@@ -1119,6 +1119,19 @@ static void dbRecordHead(char *recordType, char *name, int visible)
|
||||
return;
|
||||
}
|
||||
|
||||
if (recordType[0] == '#' && recordType[1] == 0) {
|
||||
status = dbFindRecord(pdbentry, name);
|
||||
if (status == 0) {
|
||||
dbDeleteRecord(pdbentry);
|
||||
fprintf(stderr, ERL_WARNING ": Record \"%s\" DELETED!\n", name);
|
||||
return; /* done */
|
||||
}
|
||||
fprintf(stderr, ERL_ERROR ": Record \"%s\" not found\n", name);
|
||||
yyerror(NULL);
|
||||
duplicate = TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
status = dbFindRecordType(pdbentry, recordType);
|
||||
if (status) {
|
||||
fprintf(stderr, "Record \"%s\" is of unknown type \"%s\"\n",
|
||||
|
||||
Reference in New Issue
Block a user