Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S265754AbUAPWLX (ORCPT ); Fri, 16 Jan 2004 17:11:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S265832AbUAPWIN (ORCPT ); Fri, 16 Jan 2004 17:08:13 -0500 Received: from scrub.xs4all.nl ([194.109.195.176]:15624 "EHLO scrub.xs4all.nl") by vger.kernel.org with ESMTP id S265779AbUAPV4J (ORCPT ); Fri, 16 Jan 2004 16:56:09 -0500 Date: Fri, 16 Jan 2004 22:56:01 +0100 (CET) From: Roman Zippel X-X-Sender: roman@serv To: Romain Lievin cc: Ozan Eren Bilgen , Linux Kernel Mailing List Subject: Re: [PATCH] "gconfig" removed root folder... In-Reply-To: <20040115214416.GA25409@rlievin.dyndns.org> Message-ID: References: <1074177405.3131.10.camel@oebilgen> <20040115214416.GA25409@rlievin.dyndns.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 820 Lines: 27 Hi, On Thu, 15 Jan 2004, Romain Lievin wrote: > fn = gtk_file_selection_get_filename(GTK_FILE_SELECTION > (user_data)); > + > + /* protect against 'root directory' bug */ > + trailing = fn[strlen(fn)-1]; > + if(stat(fn, &sb) == -1) return; > + if(S_ISDIR(sb.st_mode)) > + if(trailing != '/') > + strcat((char *)fn, "/"); > > if (conf_write(fn)) > text_insert_msg("Error", "Unable to save configuration !"); Um, I thought gtk++ also had an option that prevents the selection of directories. A test like this should be added to conf_write(). bye, Roman - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/