bug fix for pointing to the command name

This commit is contained in:
Axel Kohlmeyer
2025-02-18 10:54:52 -05:00
parent 816fb83d1a
commit c19389a205

View File

@ -234,9 +234,9 @@ std::string utils::point_to_error(Input *input, int failed)
// construct and append error indicator line
cmdline += '\n';
cmdline += std::string(indicator, ' ');
cmdline += std::string(strlen(input->arg[failed]) + quoted, '^');
cmdline += std::string(strlen((failed < 0) ? input->command : input->arg[failed])
+ quoted, '^');
cmdline += '\n';
} else {
cmdline += lastline;
cmdline += '\n';