summaryrefslogtreecommitdiff
path: root/rts/ProfHeap.c
diff options
context:
space:
mode:
authorBen Gamari <ben@smart-cactus.org>2018-11-24 14:01:40 -0500
committerBen Gamari <ben@smart-cactus.org>2018-11-24 14:13:38 -0500
commitbba2b9bf2d69700dc114118658507aaac34c5e62 (patch)
tree3851b5f467ab0b4bcbd2843be4e69256beb7b707 /rts/ProfHeap.c
parent6a70acfa0b8757b9a6a56cffedc4b16a39dad510 (diff)
downloadhaskell-bba2b9bf2d69700dc114118658507aaac34c5e62.tar.gz
Revert "Fix uninformative hp2ps error when the cmdline contains double quotes"
This reverts commit 390df8b51b917fb6409cbde8e73fe838d61d8832.
Diffstat (limited to 'rts/ProfHeap.c')
-rw-r--r--rts/ProfHeap.c30
1 files changed, 8 insertions, 22 deletions
diff --git a/rts/ProfHeap.c b/rts/ProfHeap.c
index 517702f241..de3d2b6aa5 100644
--- a/rts/ProfHeap.c
+++ b/rts/ProfHeap.c
@@ -361,18 +361,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)
{
fprintf(hp_file, "%s %f\n",
@@ -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 */