Project

General

Profile

0001-Modified-automatic-branch-mask-generation-for-IP-add.patch

hades, 01/20/2009 06:23 PM

View differences:

src/core/userinputhandler.cpp
104 104
      return;
105 105
    }
106 106

  
107
    if(generalizedHost.lastIndexOf(".") != -1 && generalizedHost.lastIndexOf(".", generalizedHost.lastIndexOf(".")-1) != -1) {
107
    static QRegExp ipAddress("\\d+\\.\\d+\\.\\d+\\.\\d+");
108
    if(ipAddress.exactMatch(generalizedHost))    {
109
        int lastDotPos = generalizedHost.lastIndexOf('.') + 1;
110
        generalizedHost.replace(lastDotPos, generalizedHost.length() - lastDotPos, '*');
111
    } else if(generalizedHost.lastIndexOf(".") != -1 && generalizedHost.lastIndexOf(".", generalizedHost.lastIndexOf(".")-1) != -1) {
108 112
      int secondLastPeriodPosition = generalizedHost.lastIndexOf(".", generalizedHost.lastIndexOf(".")-1);
109 113
      generalizedHost.replace(0, secondLastPeriodPosition, "*");
110 114
    }
111
-