Windows fixes

This commit is contained in:
AlexSSD7 2023-09-03 14:08:24 +01:00
commit 1b69e6294d
7 changed files with 30 additions and 20 deletions

View file

@ -34,7 +34,7 @@ const (
)
var safeArgs = map[string]ArgAcceptedValue{
"accel": ArgAcceptedValueString,
"accel": ArgAcceptedValueKeyValue,
"boot": ArgAcceptedValueString,
"m": ArgAcceptedValueUint,
"smp": ArgAcceptedValueUint,

View file

@ -69,11 +69,6 @@ func NewKeyValueArg(key string, items []KeyValueArgItem) (*KeyValueArg, error) {
return nil, fmt.Errorf("empty key not allowed")
}
if len(item.Value) == 0 {
// Values *can* be empty, though. We do not allow them for consistency.
return nil, fmt.Errorf("empty value for key '%v' is not allowed", item.Key)
}
err := validateArgStrValue(item.Key)
if err != nil {
return nil, errors.Wrapf(err, "validate key '%v'", item.Key)

View file

@ -45,5 +45,9 @@ func validateArgStrValue(s string) error {
return fmt.Errorf("backslashes are not allowed")
}
if strings.Contains(s, "=") {
return fmt.Errorf("equals sign is not allowed")
}
return nil
}