diff options
| author | Dylan Baker <dylan@pnwbakers.com> | 2024-07-25 09:02:01 -0700 |
|---|---|---|
| committer | Eli Schwartz <eschwartz93@gmail.com> | 2024-07-25 14:10:20 -0400 |
| commit | 4842b8bcb37fe98f48b08e99210e04640380bffb (patch) | |
| tree | 66d25d6efeea6ad5ef85c59a812d53c6d6977114 | |
| parent | f009ccb81bde95a414ca071aadfe24b44b39398b (diff) | |
| download | meson-4842b8bcb37fe98f48b08e99210e04640380bffb.tar.gz | |
backend/ninja: fix off-by-one in cmd length estimate
This causes us to not count the spaces between arguments, thereby
undercounting the number of elements. This is extra important because we
previously double counted all actual characters, covering this issue up.
Fixes: cf0fecfce ("backend/ninja: Fix bug in NinjaRule.length_estimate")
| -rw-r--r-- | mesonbuild/backend/ninjabackend.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/backend/ninjabackend.py b/mesonbuild/backend/ninjabackend.py index e1c6d0ca8..552ddee12 100644 --- a/mesonbuild/backend/ninjabackend.py +++ b/mesonbuild/backend/ninjabackend.py @@ -292,7 +292,7 @@ class NinjaRule: estimate = len(command) for m in re.finditer(r'(\${\w+}|\$\w+)?[^$]*', command): if m.start(1) != -1: - estimate -= m.end(1) - m.start(1) + 1 + estimate -= m.end(1) - m.start(1) chunk = m.group(1) if chunk[1] == '{': chunk = chunk[2:-1] |
