summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2013-11-23 01:03:38 +0100
committerThierry Vignaud <thierry.vignaud@gmail.com>2013-11-24 11:00:48 +0100
commitb96dc581904f0d5a576f57e5199dbe158ce81e28 (patch)
tree0c59b99f2f7b00ded3703a20446e05df6716d2e1 /bin
parent9e778ed5d027334493415f59e3a5456a7df54a80 (diff)
downloaddrakx-net-b96dc581904f0d5a576f57e5199dbe158ce81e28.tar
drakx-net-b96dc581904f0d5a576f57e5199dbe158ce81e28.tar.gz
drakx-net-b96dc581904f0d5a576f57e5199dbe158ce81e28.tar.bz2
drakx-net-b96dc581904f0d5a576f57e5199dbe158ce81e28.tar.xz
drakx-net-b96dc581904f0d5a576f57e5199dbe158ce81e28.zip
simplify / fix crash when set_text() parameter is undef
Diffstat (limited to 'bin')
-rwxr-xr-xbin/draksambashare32
1 files changed, 14 insertions, 18 deletions
diff --git a/bin/draksambashare b/bin/draksambashare
index 2d1bfcd..451cd84 100755
--- a/bin/draksambashare
+++ b/bin/draksambashare
@@ -680,24 +680,20 @@ sub modify_entry {
my $s = $share_list->{data}[$selected][1];
$s or info_dialog(N("Error"), N("Please add or select a Samba share to be able to modify it.")) and return;
$share_name->set_text($s);
- $dir->set_text($share_list->{data}[$selected][2]);
- $comment->set_text($share_list->{data}[$selected][3]);
- $browseable->set_text($share_list->{data}[$selected][4]);
- $public->set_text($share_list->{data}[$selected][5]);
- $writable->set_text($share_list->{data}[$selected][6]);
- $create_mask->set_text($share_list->{data}[$selected][7]);
- $directory_mask->set_text($share_list->{data}[$selected][8]);
- $read_list->set_text($share_list->{data}[$selected][9]);
- $write_list->set_text($share_list->{data}[$selected][10]);
- $admin_users->set_text($share_list->{data}[$selected][11]);
- $valid_users->set_text($share_list->{data}[$selected][12]);
- $inherit_permissions->set_text($share_list->{data}[$selected][13]);
- $hide_dot_files->set_text($share_list->{data}[$selected][14]);
- $hide_files->set_text($share_list->{data}[$selected][15]);
- $preserve_case->set_text($share_list->{data}[$selected][16]);
- $force_create_mode->set_text($share_list->{data}[$selected][17]);
- $force_group->set_text($share_list->{data}[$selected][18]);
- $default_case->set_text($share_list->{data}[$selected][19]);
+
+ # start with $share_list->{data}[$selected][2]:
+ my $i = 1;
+ foreach my $box ($dir, $comment, $browseable, $public, $writable,
+ $create_mask, $directory_mask, $read_list,
+ $write_list, $admin_users, $valid_users,
+ $inherit_permissions, $hide_dot_files, $hide_files,
+ $preserve_case, $force_create_mode, $force_group,
+ $default_case) {
+ $i++;
+ my $value = $share_list->{data}[$selected][$i];
+ next if !$value;
+ $box->set_text($value);
+ }
my $expander_user = Gtk3::Expander->new(N("User options (user access, mask option, force mode)"));
$expander_user->add(gtkpack_(Gtk3::HBox->new,