Commit bba2b9bf authored by Ben Gamari's avatar Ben Gamari 🐢

Revert "Fix uninformative hp2ps error when the cmdline contains double quotes"

This reverts commit 390df8b5.
parent 6a70acfa
......@@ -360,18 +360,6 @@ void endProfiling( void )
}
#endif /* !PROFILING */
static void
printEscapedString(const char* string)
{
for (const char* p = string; *p != '\0'; ++p) {
if (*p == '\"') {
// Escape every " as ""
fputc('"', hp_file);
}
fputc(*p, hp_file);
}
}
static void
printSample(bool beginSample, StgDouble sampleValue)
{
......@@ -440,18 +428,16 @@ initHeapProfiling(void)
initEra( &censuses[era] );
/* initProfilingLogFile(); */
fprintf(hp_file, "JOB \"");
printEscapedString(prog_name);
fprintf(hp_file, "JOB \"%s", prog_name);
#if defined(PROFILING)
for (int i = 1; i < prog_argc; ++i) {
fputc(' ', hp_file);
printEscapedString(prog_argv[i]);
}
fprintf(hp_file, " +RTS");
for (int i = 0; i < rts_argc; ++i) {
fputc(' ', hp_file);
printEscapedString(rts_argv[i]);
{
int count;
for(count = 1; count < prog_argc; count++)
fprintf(hp_file, " %s", prog_argv[count]);
fprintf(hp_file, " +RTS");
for(count = 0; count < rts_argc; count++)
fprintf(hp_file, " %s", rts_argv[count]);
}
#endif /* PROFILING */
......
TOP=../..
include $(TOP)/mk/boilerplate.mk
include $(TOP)/mk/test.mk
.PHONY: T15904
T15904:
"$(TEST_HC)" $(TEST_HC_OPTS) -rtsopts -main-is "$@" "$@.hs" -o "\"$@\""
"./\"$@\"" '{"e": 2.72, "pi": 3.14}' $$'\n' "\\" "" +RTS -h
"$(HP2PS_ABS)" "\"$@\".hp"
module T15904 (main) where
import System.Environment
main :: IO ()
main = do
args <- getArgs
mapM_ putStrLn args
[1 of 1] Compiling T15904 ( T15904.hs, T15904.o )
Linking "T15904" ...
{"e": 2.72, "pi": 3.14}
\
test('T15904', [], run_command, ['$MAKE -s --no-print-directory T15904'])
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment