11/*
2- * Copyright (c) 1998, 2020 , Oracle and/or its affiliates. All rights reserved.
2+ * Copyright (c) 1998, 2025 , Oracle and/or its affiliates. All rights reserved.
33 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44 *
55 * This code is free software; you can redistribute it and/or modify it
4141/* We should also include jdk_util.h here, for the prototype of JDK_Canonicalize.
4242 This isn't possible though because canonicalize_md.c is as well used in
4343 different contexts within Oracle.
44- */
44+ */
4545#include "io_util_md.h"
4646
4747/* Copy bytes to dst, not going past dend; return dst + number of bytes copied,
@@ -139,7 +139,8 @@ lastErrorReportable()
139139 || (errval == ERROR_ACCESS_DENIED )
140140 || (errval == ERROR_NETWORK_UNREACHABLE )
141141 || (errval == ERROR_NETWORK_ACCESS_DENIED )
142- || (errval == ERROR_NO_MORE_FILES )) {
142+ || (errval == ERROR_NO_MORE_FILES )
143+ || (errval == ERROR_NETNAME_DELETED )) {
143144 return 0 ;
144145 }
145146 return 1 ;
@@ -183,7 +184,7 @@ wcanonicalize(WCHAR *orig_path, WCHAR *result, int size)
183184 /* Copy prefix, assuming path is absolute */
184185 c = src [0 ];
185186 if (((c <= L'z' && c >= L'a' ) || (c <= L'Z' && c >= L'A' ))
186- && (src [1 ] == L':' ) && (src [2 ] == L'\\' )) {
187+ && (src [1 ] == L':' ) && (src [2 ] == L'\\' )) {
187188 /* Drive specifier */
188189 * src = towupper (* src ); /* Canonicalize drive letter */
189190 if (!(dst = wcp (dst , dend , L'\0' , src , src + 2 ))) {
@@ -244,9 +245,9 @@ wcanonicalize(WCHAR *orig_path, WCHAR *result, int size)
244245 continue ;
245246 } else {
246247 if (!lastErrorReportable ()) {
247- if (!(dst = wcp (dst , dend , L'\0' , src , src + wcslen (src )))){
248- goto err ;
249- }
248+ if (!(dst = wcp (dst , dend , L'\0' , src , src + wcslen (src )))){
249+ goto err ;
250+ }
250251 break ;
251252 } else {
252253 goto err ;
@@ -255,7 +256,7 @@ wcanonicalize(WCHAR *orig_path, WCHAR *result, int size)
255256 }
256257
257258 if (dst >= dend ) {
258- errno = ENAMETOOLONG ;
259+ errno = ENAMETOOLONG ;
259260 goto err ;
260261 }
261262 * dst = L'\0' ;
@@ -366,7 +367,7 @@ JDK_Canonicalize(const char *orig, char *out, int len) {
366367 // Change return value to success.
367368 ret = 0 ;
368369
369- finish :
370+ finish :
370371 free (wresult );
371372 free (wpath );
372373
0 commit comments