Fixed error and poor error message when using an invalid target name.

This commit is contained in:
Christoffer Lerno
2025-03-01 12:30:36 +01:00
parent 1b0ac13d76
commit 76f226f536
3 changed files with 3 additions and 2 deletions

View File

@@ -31,6 +31,7 @@
- `@if` declarations were missing from -P output #1973.
- Check exe and lib output so -o works with directories.
- Swizzling an inline vector in a struct would cause a crash.
- Fixed error and poor error message when using an invalid target name.
### Stdlib changes

View File

@@ -111,7 +111,7 @@ static Library *add_library(JSONObject *object, const char *dir)
{
char *res = strdup(provides);
str_ellide_in_place(res, 32);
error_exit("Invalid 'provides' module name in %s, was '%s'.", library->dir, res);
error_exit("Invalid 'provides' module name in %s, was '%s', the name should only contain alphanumerical letters and '_'.", library->dir, res);
}
library->provides = provides;
library->execs = get_optional_string_array(context, object, "exec");

View File

@@ -208,7 +208,7 @@ static void load_into_build_target(BuildParseContext context, JSONObject *json,
{
char *name_copy = strdup(name);
str_ellide_in_place(name_copy, 32);
error_exit("Error reading %s: invalid library target '%s'.", filename, name_copy);
error_exit("Error reading %s: invalid library target name '%s' it should only contain alphanumerical letters and '_'.", context.file, name_copy);
}
}