From: Nicolas Boichat Date: Thu, 5 May 2005 18:58:48 +0000 (+0000) Subject: Fix a problem when link count for a file is greater than 99 (bug #304). X-Git-Tag: Release-1.38.0~502 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=eef071a834e0501829fec86c110ad84b3ea827da;p=bacula%2Fbacula Fix a problem when link count for a file is greater than 99 (bug #304). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1996 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/wx-console/CHANGELOG b/bacula/src/wx-console/CHANGELOG index 6714262373..e9485d5794 100644 --- a/bacula/src/wx-console/CHANGELOG +++ b/bacula/src/wx-console/CHANGELOG @@ -1,4 +1,5 @@ 05-05-2005 : + - Fix a problem when link count for a file is greater than 99 (bug #304). - Add a workaround for a problem when displaying Unicode filenames with non-Unicode wxWidgets. diff --git a/bacula/src/wx-console/wxbrestorepanel.cpp b/bacula/src/wx-console/wxbrestorepanel.cpp index edc6cad4ea..8b63dba566 100644 --- a/bacula/src/wx-console/wxbrestorepanel.cpp +++ b/bacula/src/wx-console/wxbrestorepanel.cpp @@ -1474,23 +1474,29 @@ void wxbRestorePanel::UpdateTreeItem(wxTreeItemId item, bool updatelist, bool re wxString* wxbRestorePanel::ParseList(wxString line) { /* See ls_output in dird/ua_tree.c */ - //drwxrwxrwx 1 root root 0 2004-04-03 14:35:21 f:/tocd/NVSU 1.00.00/ - //+ 10 + ++ + 8 + + 8 ++ 8 + + 19 + *+ -> - //0 12 15 24 32 42 62 - + //drwxrwxrwx 111 root root 0 2004-04-03 14:35:21 f:/tocd/NVSU 1.00.00/ + //+ 10 + +i+ + 8 + + 8 ++ 8 + + 19 + *+ -> + //0 12 i+15 i+24 i+32 i+42 i+62 + + int i; + if (line.Length() < 63) return NULL; wxString* ret = new wxString[9]; ret[0] = line.Mid(0, 10).Trim(); - ret[1] = line.Mid(12, 2).Trim(); - ret[2] = line.Mid(15, 8).Trim(); - ret[3] = line.Mid(24, 8).Trim(); - ret[4] = line.Mid(32, 8).Trim(); - ret[5] = line.Mid(42, 19).Trim(); - ret[6] = line.Mid(62, 1); - ret[7] = line.Mid(63).Trim(); + + /* Column 1 has a variable width */ + i = line.find(' ', 14) - 14; + ret[1] = line.Mid(12, 2+i).Trim(); + + ret[2] = line.Mid(15+i, 8).Trim(); + ret[3] = line.Mid(24+i, 8).Trim(); + ret[4] = line.Mid(32+i, 8).Trim(); + ret[5] = line.Mid(42+i, 19).Trim(); + ret[6] = line.Mid(62+i, 1); + ret[7] = line.Mid(63+i).Trim(); if (ret[6] == " ") ret[6] = "";