uriloader/exthandler/tests/WriteArgument.cpp
author Boris Zbarsky <bzbarsky@mit.edu>
Thu, 05 Aug 2010 14:39:39 -0400
changeset 49028 dd0c8936a36da69fe9e35ad53bb718a29c16d99f
parent 15220 b5b210b0cd7ee10e89c9933164832604d608a868
permissions -rw-r--r--
Bug 547342 real fix. Flush on ScrollToRow. r=enn

#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;
}