use to "feature" in DEBUGFILES

The code to lookup a value in DEBUGFILES usually operates on a file
name, but there are few non-file uses.  The latter wouldn't work on
VMS because of the way it was manipulating the name:  first stripping
away path, suffix, and version, then adding hardcoded ".c" suffix on.

I thought we already had a routine to get the base part of a name
from a full path, but if so, I haven't been able to find it.  This
adds new nh_basename() to do that, with the option of either keeping
or discarding the suffix or type portion.

The VMS usage that prompted this hasn't actually been tested.
This commit is contained in:
PatR
2023-05-25 15:35:49 -07:00
parent 2876b6e8fd
commit cf8a49cae6
4 changed files with 49 additions and 20 deletions

View File

@@ -868,6 +868,7 @@ extern void makerogueghost(void);
/* ### files.c ### */
extern const char *nh_basename(const char *, boolean);
#if !defined(CROSSCOMPILE) || defined(CROSSCOMPILE_TARGET)
extern int l_get_config_errors(lua_State *);
#endif
@@ -3210,7 +3211,7 @@ extern int vms_creat(const char *, unsigned int);
extern int vms_open(const char *, int, unsigned int);
extern boolean same_dir(const char *, const char *);
extern int c__translate(int);
extern char *vms_basename(const char *);
extern char *vms_basename(const char *, boolean);
/* ### vmsmail.c ### */

View File

@@ -335,7 +335,7 @@ typedef int32_t off_t;
extern void vms_exit(int);
extern int vms_open(const char *, int, unsigned);
extern FILE *vms_fopen(const char *, const char *);
char *vms_basename(const char *); /* vmsfiles.c */
char *vms_basename(const char *, boolean); /* vmsfiles.c */
#endif /* VMSCONF_H */
#endif /* VMS */