]> sourceware.org Git - newlib-cygwin.git/commitdiff
* cygpath.cc (do_pathconv): when -p option is given, generate wide
authorCorinna Vinschen <corinna@vinschen.de>
Wed, 26 Jun 2013 13:10:35 +0000 (13:10 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 26 Jun 2013 13:10:35 +0000 (13:10 +0000)
path without long path prefixing.
* wide_path.h (wide_path::wide_path): Allow extra bool parameter to
specify whether or not performing Windows long path prefixing.

winsup/utils/ChangeLog
winsup/utils/cygpath.cc
winsup/utils/wide_path.h

index e67bb102a40b7e847192be2d561d7331dfc48855..6eab6b341c5bcf44a8199134e08d178f095a577a 100644 (file)
@@ -1,3 +1,10 @@
+2013-06-26  Corinna Vinschen  <corinna@vinschen.de>
+
+       * cygpath.cc (do_pathconv): when -p option is given, generate wide 
+       path without long path prefixing.
+       * wide_path.h (wide_path::wide_path): Allow extra bool parameter to
+       specify whether or not performing Windows long path prefixing.
+
 2013-05-21  Corinna Vinschen  <corinna@vinschen.de>
 
        Reinstantiate accidentally removed patch from 2009-05-16:
index 07752f9f1d7655bb10489780e21ba5d5ce66d30f..6094eb7eb8ea5b401cdb02cecfe7137d78eb842a 100644 (file)
@@ -1,6 +1,6 @@
 /* cygpath.cc -- convert pathnames between Windows and Unix format
    Copyright 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008,
-   2009, 2010, 2011, 2012 Red Hat, Inc.
+   2009, 2010, 2011, 2012, 2013 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -675,7 +675,7 @@ do_pathconv (char *filename)
     {
       if (unix_flag)
        {
-         wide_path wpath (filename);
+         wide_path wpath (filename, false);
          err = cygwin_conv_path_list (conv_func, wpath, buf, len);
        }
       else
index 210eaf1cf9208e2351187d030e503c7d03d4d961..7a507c809cf30f6c1f5634a55dcc3a48090dca11 100644 (file)
@@ -2,7 +2,7 @@
                   to wchar_t Win32 path including long path prefix if
                   necessary.
 
-   Copyright 2009, 2011 Red Hat, Inc.
+   Copyright 2009, 2011, 2013 Red Hat, Inc.
 
    This file is part of Cygwin.
 
@@ -19,12 +19,12 @@ class wide_path
 
 public:
   wide_path () : wp (NULL) {}
-  wide_path (const char *mb_path)
+  wide_path (const char *mb_path, bool do_prefix = true)
   {
     int len = mbstowcs (NULL, mb_path, 0) + 1;
     wp = (wchar_t *) malloc ((len + 6) * sizeof (wchar_t));
     wchar_t *wp_p = wp;
-    if (len >= MAX_PATH && strncmp (mb_path, "\\\\?\\", 4) != 0)
+    if (do_prefix && len >= MAX_PATH && strncmp (mb_path, "\\\\?\\", 4) != 0)
       {
        wcscpy (wp_p, L"\\\\?\\");
        wp_p += 4;
This page took 0.038127 seconds and 5 git commands to generate.