Skip to content

Commit

Permalink
Escape the __args.remaining before joining together
Browse files Browse the repository at this point in the history
The current way ignores the case and won't work if
the arguments include a space.

Signed-off-by: Hollow Man <[email protected]>
  • Loading branch information
HollowMan6 committed Oct 24, 2024
1 parent 13a06f5 commit 8bcad71
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/omniperf_profile/profiler_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from tqdm import tqdm
import glob
import logging
import shlex
import sys
import os
import re
Expand Down Expand Up @@ -263,7 +264,7 @@ def pre_processing(self):
"Your command %s doesn't point to a executable. Please verify."
% self.__args.remaining[0]
)
self.__args.remaining = " ".join(self.__args.remaining)
self.__args.remaining = " ".join(shlex.quote(arg) for arg in self.__args.remaining)
else:
console_error(
"Profiling command required. Pass application executable after -- at the end of options.\n\t\ti.e. omniperf profile -n vcopy -- ./vcopy -n 1048576 -b 256"
Expand Down

0 comments on commit 8bcad71

Please sign in to comment.