Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-8265

Failed to read env file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • Qt Creator 2.6.1
    • Qt Creator 2.6.0
    • Debugger
    • None
    • Windows 7 x64
    • 5981b1e5

    Description

      Fail when reading "environment file" which has Russian symbols. Write following error: "Failed to read env file".
      I think problem here:

      process_stub_win.c
        if (*argv[ArgEnv]) {
              FILE *envFd;
              long size;
              if (!(envFd = _wfopen(argv[ArgEnv], L"r"))) {
                  fprintf(stderr, "Cannot read creator env file %S: %s\n",
                          argv[ArgEnv], strerror(errno));
                  doExit(1);
              }
              fseek(envFd, 0, SEEK_END);
              size = ftell(envFd);
              rewind(envFd);
              env = malloc(size);
              if (fread(env, 1, size, envFd) != size) {
                  perror("Failed to read env file");
                  doExit(1);
              }
              fclose(envFd);
          }
      

      Fix: add binary flag when open "env file"

       wfopen(argv[ArgEnv], L"rb")
      

      Attachments

        For Gerrit Dashboard: QTCREATORBUG-8265
        # Subject Branch Project Status CR V

        Activity

          People

            hjk hjk
            ischuk.dmytro Dmytro
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes