Hi Ralf,

Sorry for the slow turnaround on this bug fix.  I've just done a
review and it took me a while to work out what was being done with the
code as it's rather cryptic. I reproduced the problem you observed at
my end and worked out the original code had the right intention only
that the there was a == used rather than an !=

I note that your suggestion is simpler than the original, and this
initially threw me off until I worked out ythe < relied upon
std::string::npos being higher than any valid position.  This is a bit
cryptic in itself so I've decided to just fix the original error and
keep in the != check.  I've also added some code comment to explain
what this bit of code is doing. The new code changes are:

~/OpenSceneGraph/src/osg$ svn diff
Index: GraphicsContext.cpp
===================================================================
--- GraphicsContext.cpp (revision 13588)
+++ GraphicsContext.cpp (working copy)
@@ -113,8 +113,11 @@
     std::string::size_type colon = displayName.find_last_of(':');
     std::string::size_type point = displayName.find_last_of('.');

+    // handle the case where the host name is supplied with '.' such
as 127.0.0.1:0  with only DisplayNum provided
+    // here the point to picks up on the .1 from the host name,
rather then demarking the DisplayNum/ScreenNum as
+    // no ScreenNum is provided, hence no . in the rhs of the :
     if (point!=std::string::npos &&
-        colon==std::string::npos &&
+        colon!=std::string::npos &&
         point < colon) point = std::string::npos;

     if (colon==std::string::npos)

This change works with your example of 127.0.0.1:2 just fine.  Changes
now checked into svn/trunk.

Cheers,
Robert.





On 23 November 2012 08:09, Ralf Habacker <[email protected]> wrote:
> Hi Robert,
>
> the appended file contains a patch which fixes an issue when using dot's in
> the hostname for example  127.0.0.1:2 which result into a display number 0.1
> (the last two parts of the ip address).
>
> The file is based on recent svn trunk.
>
> Regards
>   Ralf
>
>
>
>
>
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
>
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to