jdk/src/java.base/share/native/libjli/args.c
changeset 45463 d9325138bac6
parent 45252 654115968257
equal deleted inserted replaced
45462:0de8011890c0 45463:d9325138bac6
     1 /*
     1 /*
     2  * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    76 // Initialize to 1, as the first argument is the app name and not preprocessed
    76 // Initialize to 1, as the first argument is the app name and not preprocessed
    77 static size_t argsCount = 1;
    77 static size_t argsCount = 1;
    78 static jboolean stopExpansion = JNI_FALSE;
    78 static jboolean stopExpansion = JNI_FALSE;
    79 static jboolean relaunch = JNI_FALSE;
    79 static jboolean relaunch = JNI_FALSE;
    80 
    80 
    81 void JLI_InitArgProcessing(jboolean isJava, jboolean disableArgFile) {
    81 void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
    82     // No expansion for relaunch
    82     // No expansion for relaunch
    83     if (argsCount != 1) {
    83     if (argsCount != 1) {
    84         relaunch = JNI_TRUE;
    84         relaunch = JNI_TRUE;
    85         stopExpansion = JNI_TRUE;
    85         stopExpansion = JNI_TRUE;
    86         argsCount = 1;
    86         argsCount = 1;
    89     }
    89     }
    90 
    90 
    91     expectingNoDashArg = JNI_FALSE;
    91     expectingNoDashArg = JNI_FALSE;
    92 
    92 
    93     // for tools, this value remains 0 all the time.
    93     // for tools, this value remains 0 all the time.
    94     firstAppArgIndex = isJava ? NOT_FOUND : 0;
    94     firstAppArgIndex = hasJavaArgs ? 0: NOT_FOUND;
    95 }
    95 }
    96 
    96 
    97 int JLI_GetAppArgIndex() {
    97 int JLI_GetAppArgIndex() {
    98     // Will be 0 for tools
    98     // Will be 0 for tools
    99     return firstAppArgIndex;
    99     return firstAppArgIndex;