mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-17 06:48:47 +02:00
Store the filename / lineno at which a user-defined function is defined.
This commit is contained in:
@@ -32,6 +32,8 @@ typedef struct udf_struct {
|
||||
Var *locals;
|
||||
char IsActive;
|
||||
int nargs;
|
||||
char const *filename;
|
||||
int lineno;
|
||||
} UserFunc;
|
||||
|
||||
/* The hash table */
|
||||
@@ -93,6 +95,11 @@ int DoFset(ParsePtr p)
|
||||
DBufFree(&buf);
|
||||
return E_NO_MEM;
|
||||
}
|
||||
func->filename = StrDup(FileName);
|
||||
if (!func->filename) {
|
||||
return E_NO_MEM;
|
||||
}
|
||||
func->lineno = LineNo;
|
||||
StrnCpy(func->name, DBufValue(&buf), VAR_NAME_LEN);
|
||||
DBufFree(&buf);
|
||||
if (!Hush) {
|
||||
@@ -196,6 +203,9 @@ static void DestroyUserFunc(UserFunc *f)
|
||||
/* Free the function definition */
|
||||
if (f->text) free( (char *) f->text);
|
||||
|
||||
/* Free the filename */
|
||||
if (f->filename) free( (char *) f->filename);
|
||||
|
||||
/* Free the data structure itself */
|
||||
free(f);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user