Issue 27304 - windows path foo
Summary: windows path foo
Status: CLOSED FIXED
Alias: None
Product: Build Tools
Classification: Code
Component: code (show other issues)
Version: OOo 1.1.1
Hardware: All All
: P2 Trivial (vote)
Target Milestone: OOo 1.1.2
Assignee: quetschke
QA Contact: issues@tools
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-04-01 15:05 UTC by mmeeks
Modified: 2004-04-28 17:09 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description mmeeks 2004-04-01 15:05:21 UTC
This small patch makes life nicer on win32 I was getting:

 /usr/bin:/usr/local/bin -> /usr/bi/cygpath/n/usr/local/bin 

simply because my path had : 'Program\ Files' type elements in it.

simple fix:

diff -u -p -u -r1.10.6.6 set_soenv.in
--- config_office/set_soenv.in  13 Feb 2004 14:20:17 -0000      1.10.6.6
+++ config_office/set_soenv.in  1 Apr 2004 14:43:17 -0000
@@ -2225,7 +2254,7 @@ sub PosixFormat
    {   $variable =~ s/(\$\{?\w+\}?)/$1/eeg ;         # expand the variables
        $variable =~ s/(\$\{?\w+\}?)/$1/eeg ;         # expand the variables twice!
           if ( ( $variable =~ /\\/ ) and ( $variable =~ /:/ ) )
-          {   $variable =~ s{([c-z]):}{/cygdrive/$1}gi;
+          {   $variable =~ s{([c-z]):\\}{/cygdrive/$1/}gi;
                   # Map drives to /cgydrive/drive
                   # We do this also for old cygwins, back
                   # replacement in winformat.
Comment 1 Martin Hollmichel 2004-04-02 15:50:28 UTC
mh->vq: are you able to review this ?
Comment 2 quetschke 2004-04-02 18:27:00 UTC
vq->mh: Yes. This is correct and fixes a problem with already POSIX
pathes that contain "\", e.g. ones with spaces.

The patch is correct, but it would be nice to change the if condition
to reflect what really is tested:

->  if ( $variable =~ /[c-z]:\\/ )   # Find drive letters

Besides this patch it would be worthwhile to investigate why/where
PosixFormat is called for variables already in posix format.

Approved with the change of the if statement.
Comment 3 quetschke 2004-04-11 03:19:51 UTC
Committed to cws_srx645_ooo112fix1.
Comment 4 josef.cacek 2004-04-13 15:16:28 UTC
(Win 2003 srv, Cygwin 1.5.9)
New version cause problem in variable INCUDE:
$ echo $INCLUDE
.;e:\\home\\kwart\\OOo\\devel2\\BuildDir\\ooo_cws_srx645_ooo112fix1_src\\solver\\645\\wntmsci8.pro\\inc;e:\\home\\kwart\\OOo\\devel2\\BuildDir\\ooo_cws_srx645_ooo112fix1_src\\solenv\\wntmsci8\\inc;e:\\home\\kwart\\OOo\\devel2\\BuildDir\\ooo_cws_srx645_ooo112fix1_src\\solenv\\inc;C;;e:\\MICROS~1.NET\\VC7\\include;c:\\j2sdk1.4.2_04\\include;c:\\j2sdk1.4.2_04\\include\\win32

In previous version:
$ echo $INCLUDE
.;e:\\home\\kwart\\OOo\\devel\\BuildDir\\ooo_cws_srx645_ooo112fix1_src\\solver\\645\\wntmsci8.pro\\inc;e:\\home\\kwart\\OOo\\devel\\BuildDir\\ooo_cws_srx645_ooo112fix1_src\\solenv\\wntmsci8\\inc;e:\\home\\kwart\\OOo\\devel\\BuildDir\\ooo_cws_srx645_ooo112fix1_src\\solenv\\inc;c:\\PROGRA~1\\MICROS~2\\include;e:\\MICROS~1.NET\\VC7\\include;c:\\j2sdk1.4.2_04\\include;c:\\j2sdk1.4.2_04\\include\\win32

=> in new version is only "C" instead of "c:\\PROGRA~1\\MICROS~2\\include" (path
to MS PSDK)
Comment 5 pavel 2004-04-13 16:50:53 UTC
So new version of set_soenv.in is the problem -> reopening.
Comment 6 quetschke 2004-04-13 16:55:53 UTC
No, I don't think so,

$variable =~ s{([c-z]):\\}{/cygdrive/$1/}gi;

is not able to remove c:\\PROGRA~1\\MICROS~2\\include.

To solve this, we need the PATH and all commandline for configure.

And the output of the configure command.

Comment 7 josef.cacek 2004-04-13 17:11:19 UTC
I replaced 2 changed lines with older version and it works. 
  if ( ( $variable =~ /\\/ ) and ( $variable =~ /:/ ) )
  {   $variable =~ s{([c-z]):}{/cygdrive/$1}gi;

So the problem has to be in the following 2 lines.
  if ( $variable =~ /[c-z]:\\/ )
  {   $variable =~ s{([c-z]):\\}{/cygdrive/$1/}gi;
Comment 8 quetschke 2004-04-13 19:33:03 UTC
Sorry, my fault. I missed the check for capital drive letters (C:), now it
works. Committed!
Comment 9 quetschke 2004-04-28 17:09:34 UTC
verified
Comment 10 quetschke 2004-04-28 17:09:49 UTC
close