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 Nov 7, 2024
1 parent 1e5cb38 commit 6f4b585
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/rocprof_compute_profile/profiler_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import logging
import os
import re
import shlex
import sys
from abc import ABC, abstractmethod

Expand Down Expand Up @@ -265,7 +266,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. rocprof-compute profile -n vcopy -- ./vcopy -n 1048576 -b 256"
Expand Down

0 comments on commit 6f4b585

Please sign in to comment.