From commits-return-58387-apmail-harmony-commits-archive=harmony.apache.org@harmony.apache.org Thu May 07 08:13:55 2009 Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 87862 invoked from network); 7 May 2009 08:13:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 7 May 2009 08:13:53 -0000 Received: (qmail 36984 invoked by uid 500); 7 May 2009 08:13:53 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 36923 invoked by uid 500); 7 May 2009 08:13:53 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 36913 invoked by uid 99); 7 May 2009 08:13:53 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 08:13:53 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.140] (HELO brutus.apache.org) (140.211.11.140) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 07 May 2009 08:13:51 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id 2543A234C003 for ; Thu, 7 May 2009 01:13:31 -0700 (PDT) Message-ID: <1278865114.1241684011137.JavaMail.jira@brutus> Date: Thu, 7 May 2009 01:13:31 -0700 (PDT) From: "Li Jing Qin (JIRA)" To: commits@harmony.apache.org Subject: [jira] Commented: (HARMONY-6041) [classlib][portlib] incorrect parse path contains special unicode charactor In-Reply-To: <1182935414.1228977106069.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/HARMONY-6041?page=3Dcom.atlassi= an.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D12= 706757#action_12706757 ]=20 Li Jing Qin commented on HARMONY-6041: -------------------------------------- In this patch, I remove the code for removing the '.' because GetFullPathNa= me does this for us. Using GetFullPathNameW can help us with long name path= and filename. By inserting '\\?\' prefix after we get the full path, we ca= n deal the situation whether the input path is a relative path or a absolut= e path. > [classlib][portlib] incorrect parse path contains special unicode charact= or > -------------------------------------------------------------------------= -- > > Key: HARMONY-6041 > URL: https://issues.apache.org/jira/browse/HARMONY-6041 > Project: Harmony > Issue Type: Bug > Components: Classlib > Affects Versions: 5.0M8 > Reporter: Regis Xu > Assignee: Jimmy, Jing Lv > Fix For: 5.0M9 > > Attachments: HARMONY-6041-v2.diff, HARMONY-6041.diff > > > test case: > String s =3D "\u5C73"; > File file =3D new File(s); > System.out.println(file.mkdir()); > System.out.println(file.exists()); > System.out.println(file.getCanonicalPath()); > output of RI: > true > true > C:\work\workspace\temp\=E5=B1=B3 > output of Harmony: > false > true > C:\work\workspace\temp\? > I found the root cause is in hyfile.c:convert_path_to_unicode, which conv= ert UTF-8 byte array to unicode byte array > at hyfile.c::437 invoke=20 > GetFullPathNameA(path, ABS_PATH_BUF_LEN, absPath, (void*) 0)=20 > GetFullPathNameA is ANSI version, but path is encoded as UTF-8, this may= corrupt the path. > I have got a fix for this, will attach patch soon. --=20 This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.