Skip to content

Commit

Permalink
prte.c: a prefix of "/" is ok
Browse files Browse the repository at this point in the history
It's not an error if the prefix ends up being a plain "/".  More
specifically, if we strip off all trailing "/" characters from the
prefix and end up with an empty string, then the prefix is just "/".

Signed-off-by: Jeff Squyres <[email protected]>
  • Loading branch information
jsquyres committed Nov 17, 2023
1 parent 9db9fdb commit 7d58be0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/tools/prte/prte.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* reserved.
* Copyright (c) 2022-2023 Triad National Security, LLC. All rights
* reserved.
* Copyright (c) 2023 Jeffrey M. Squyres. All rights reserved.
* $COPYRIGHT$
*
* Additional copyrights may follow
Expand Down Expand Up @@ -692,10 +693,11 @@ int main(int argc, char *argv[])
param[param_len - 1] = '\0';
param_len--;
if (0 == param_len) {
pmix_show_help("help-prun.txt", "prun:empty-prefix", true, prte_tool_basename,
prte_tool_basename);
PRTE_UPDATE_EXIT_STATUS(PRTE_ERR_FATAL);
goto DONE;
/* We get here if we removed all PATH_SEP's and end up
with an empty string. In this case, the prefix is
just a single PATH_SEP. */
strncpy(param, PRTE_PATH_SEP, sizeof(param) - 1);
break;
}
}
prte_set_attribute(&dapp->attributes, PRTE_APP_PREFIX_DIR, PRTE_ATTR_GLOBAL, param,
Expand Down

0 comments on commit 7d58be0

Please sign in to comment.