Returns 'newstr' only if it contains the basename of a file, without an
extension or path. If 'newstr' contains any invalid filename characters,
a path, or a dot for an extension, then 'curstr' will be returned.
Returns 'newstr' only if it contains a filename, without a path. If
'newstr' contains any invalid filename characters or a path, then
'curstr' will be returned.