uriloader/exthandler/tests/WriteArgument.cpp
author Mark Banner <bugzilla@standard8.plus.com>
Tue, 03 Jun 2008 13:05:59 +0100
changeset 15220 b5b210b0cd7ee10e89c9933164832604d608a868
permissions -rw-r--r--
Core parts of Bug 378991 - Enable IDN link support in messages for Thunderbird and only pass punycode values to external apps. r=masayuki,dmose,sr=biesi

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