uriloader/exthandler/tests/WriteArgument.cpp
author Hannes Verschore <hv1989@gmail.com>
Mon, 18 Feb 2013 18:32:10 +0100
changeset 122248 95e67683fe4e17e4b8c2321251fe6e7b0c28956d
parent 15220 b5b210b0cd7ee10e89c9933164832604d608a868
child 450554 09c71a7cf75aeaf2963050e315276fb9a866fd62
permissions -rw-r--r--
Bug 839315: IonMonkey: Fix fault in TypePolicy of MCompare for CompareType_Boolean and CompareType_String, r=jandem

#include <stdio.h>
#include "prenv.h"

int main(int argc, char* argv[])
{
  if (argc != 2)
    return 1;

  const char* value = PR_GetEnv("WRITE_ARGUMENT_FILE");

  if (!value)
    return 2;

  FILE* outfile = fopen(value, "w");
  if (!outfile)
    return 3;

  // We only need to write out the first argument (no newline).
  fputs(argv[argc -1], outfile);

  fclose(outfile);

  return 0;
}