I suggest making this:
```
if (!MCStringIsEmpty(p_fname))
  t_linkname = p_fname;
else if (sptr -> getfilename() != NULL)
  /* UNCHECKED */ MCStringCreateWithCString(sptr -> getfilename(), &t_linkname);
else
{
   MCresult -> sets("stack does not have filename ...
```