<p>From the docs for <a href="https://msdn.microsoft.com/en-us/library/windows/desktop/aa364963(v=vs.85).aspx">GetFullPathName</a>:</p>
<blockquote>
<p>In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function (GetFullPathNameW), and prepend "\?" to the path.</p>
</blockquote>
<p>I'm not sure why we use any ANSI functions in Win32 code, that stuff has been deprecated for nearly 20 years by now. We should just define <code>_UNICODE</code> or whatever and use the bare wrapper macros and <code>TCHAR</code> for character type.</p>
<p>Some time ago I wrote a portable, "proper" (not limited size) <code>realpath</code> kind of function, using <code>GetFullPathName()</code> on Windows, <code>canonicalize_file_name()</code> where supported, and <code>pathconf/realpath</code> on others, etc. If I get a chance I'll see if I can find it or re-implement it (it was fairly straightforward).</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/geany/geany/issues/1534#issuecomment-314601771">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/ABDrJ5mOlg4M8i1uC3M8WhMeReNwjMIfks5sNAewgaJpZM4OPMx0">mute the thread</a>.<img alt="" height="1" src="https://github.com/notifications/beacon/ABDrJw2bQIsPiexPUl5wmKrnM6MDvFgbks5sNAewgaJpZM4OPMx0.gif" width="1" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/geany/geany/issues/1534#issuecomment-314601771"></link>
  <meta itemprop="name" content="View Issue"></meta>
</div>
<meta itemprop="description" content="View this Issue on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/geany/geany","title":"geany/geany","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/geany/geany"}},"updates":{"snippets":[{"icon":"PERSON","message":"@codebrainz in #1534: From the docs for [GetFullPathName](https://msdn.microsoft.com/en-us/library/windows/desktop/aa364963(v=vs.85).aspx):\r\n\r\n\u003e In the ANSI version of this function, the name is limited to MAX_PATH characters. To extend this limit to 32,767 wide characters, call the Unicode version of the function (GetFullPathNameW), and prepend \"\\\\?\\\" to the path.\r\n\r\nI'm not sure why we use any ANSI functions in Win32 code, that stuff has been deprecated for nearly 20 years by now. We should just define `_UNICODE` or whatever and use the bare wrapper macros and `TCHAR` for character type.\r\n\r\nSome time ago I wrote a portable, \"proper\" (not limited size) `realpath` kind of function, using `GetFullPathName()` on Windows, `canonicalize_file_name()` where supported, and `pathconf/realpath` on others, etc. If I get a chance I'll see if I can find it or re-implement it (it was fairly straightforward)."}],"action":{"name":"View Issue","url":"https://github.com/geany/geany/issues/1534#issuecomment-314601771"}}}</script>