uriloader/exthandler/tests/WriteArgument.cpp
author Rob Campbell <rcampbell@mozilla.com>
Wed, 30 Mar 2011 08:23:52 -0300
changeset 64423 41a7fb6cb4f95efcc9e84cc0caf970a4dc9cdd96
parent 15220 b5b210b0cd7ee10e89c9933164832604d608a868
permissions -rw-r--r--
added nightly.mozilla.org mention to README.txt, pushing to a CLOSED TREE, a=davidb

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