This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
Summary: | Opening PDF file brings up command console | ||
---|---|---|---|
Product: | utilities | Reporter: | rptmaestro <rptmaestro> |
Component: | Assignee: | Marian Petras <mpetras> | |
Status: | RESOLVED FIXED | ||
Severity: | blocker | CC: | mmirilovic |
Priority: | P1 | Keywords: | SPACE_IN_PATH |
Version: | 6.x | ||
Hardware: | PC | ||
OS: | Windows XP | ||
Issue Type: | DEFECT | Exception Reporter: | |
Attachments: |
binary patch for NB 6.0 (RC 1 or newer)
source code patch for branch 'release60' |
Description
rptmaestro
2007-11-18 04:16:59 UTC
reassign to utilities Confirmed on Windows 2000 and Windows XP 64-bit. The new mechanism introduced by fix of bug #119333 ("Common PDF viewer for Windows") does not work if if path of the PDF file being opened contains space. The mechanism of the failure is the following: Running command-line cmd.exe /C start ... actually executes a built-in command "start" with the given arguments. The root cause of the failure is that I did not know the strange semantics of the arguments passed to it. The semantics of the "start" command is that if the first argument is enclosed in quotes, it is considered to be a windows title (and otherwise ignored). If the Utilities module executes Runtime.getRuntime("cmd.exe", "/C", "start", filePath) and the filePath contains a space character, the JRE automatically encloses the file path in quotes which causes that it is handled like a windows title. To prevent it, this patch adds an extra (dummy) argument to the "start" command: Runtime.getRuntime("cmd.exe", "/C", "start", "\"PDF Viewer\"", filePath) which is always handled as a windows title (because it is enclosed in quotes), so that the file path argument is handled correctly. Modified file: utilities/src/org/netbeans/modules/pdf/PDFOpenSupport.java (1.19) Diff: http://deadlock.netbeans.org/fisheye/browse/netbeans/utilities/src/org/netbeans/modules/pdf/PDFOpenSupport.java?r1=1.18&r2=1.19 Created attachment 53257 [details]
binary patch for NB 6.0 (RC 1 or newer)
*** Issue 120257 has been marked as a duplicate of this issue. *** Created attachment 53405 [details]
source code patch for branch 'release60'
Verified the binary patch with latest RC2 build. The fix seems OK to me. Committed to branch 'release60'. Modified file: utilities/src/org/netbeans/modules/pdf/PDFOpenSupport.java (1.18.2.1) Diff: http://deadlock.netbeans.org/fisheye/browse/netbeans/utilities/src/org/netbeans/modules/pdf/PDFOpenSupport.java?r1=1.18&r2=1.18.2.1 |