File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed
src/java.base/unix/native/libjava Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright (c) 1998, 2023 , Oracle and/or its affiliates. All rights reserved.
2
+ * Copyright (c) 1998, 2024 , Oracle and/or its affiliates. All rights reserved.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
@@ -521,11 +521,14 @@ GetJavaProperties(JNIEnv *env)
521
521
{
522
522
char buf [MAXPATHLEN ];
523
523
errno = 0 ;
524
- if (getcwd (buf , sizeof (buf )) == NULL )
524
+ if (getcwd (buf , sizeof (buf )) == NULL ) {
525
525
JNU_ThrowByName (env , "java/lang/Error" ,
526
- "Properties init: Could not determine current working directory." );
527
- else
526
+ "Properties init: Could not determine current working directory." );
527
+ return NULL ;
528
+ }
529
+ else {
528
530
sprops .user_dir = strdup (buf );
531
+ }
529
532
}
530
533
531
534
sprops .file_separator = "/" ;
You can’t perform that action at this time.
0 commit comments