From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22466 invoked by alias); 21 Jun 2011 16:11:24 -0000 Received: (qmail 22139 invoked by uid 22791); 21 Jun 2011 16:11:20 -0000 X-SWARE-Spam-Status: No, hits=0.0 required=5.0 tests=AWL,BAYES_50,TW_TR X-Spam-Check-By: sourceware.org Received: from 3.mo2.mail-out.ovh.net (HELO mo2.mail-out.ovh.net) (46.105.58.226) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 21 Jun 2011 16:11:05 +0000 Received: from mail170.ha.ovh.net (b6.ovh.net [213.186.33.56]) by mo2.mail-out.ovh.net (Postfix) with SMTP id 6F743DC14C7 for ; Tue, 21 Jun 2011 18:11:15 +0200 (CEST) Received: from b0.ovh.net (HELO queueout) (213.186.33.50) by b0.ovh.net with SMTP; 21 Jun 2011 18:11:02 +0200 Received: from unknown (HELO ?172.25.1.160?) (piervit@pvittet.com@193.52.208.98) by ns0.ovh.net with SMTP; 21 Jun 2011 18:11:01 +0200 Message-ID: <4E00C295.5060502@pvittet.com> Date: Tue, 21 Jun 2011 16:16:00 -0000 From: Pierre Vittet User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.9) Gecko/20100515 Lightning/1.0b1 Icedove/3.0.4 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org Subject: [PATCH, MELT] fix minor issue with meltgc_new_split_string Content-Type: multipart/mixed; boundary="------------030006070502050701030202" X-Ovh-Tracer-Id: 14021113015347970206 X-Ovh-Remote: 193.52.208.98 () X-Ovh-Local: 213.186.33.20 (ns0.ovh.net) X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: Vade Retro 01.322.10 AV+AS Profile: OVH; Bailout: 300; X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg01607.txt.bz2 This is a multi-part message in MIME format. --------------030006070502050701030202 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 940 Hello, I got a bug when using meltgc_new_split_string (in melt-runtime.c) with a string (argument str) like this one "mystringanotherString" with the separator. The function is not working on a string that start with the separator. I guess this case can happen in real case, for exemple when an user give arguments with a space as a separator. The function was also not working properly on a string like this one: "firstStrsecondStr". With the patch, we get a correct list, ignoring the possible presence of a first separator and of separator immediatly followed by another. I took this opportunity to add a small comment to the function (in the second diff). ChangeLog 2011-06-21 Pierre Vittet * melt-runtime.c (meltgc_new_split_string): Fix issue. 2011-06-21 Pierre Vittet * melt-runtime.c (meltgc_new_split_string): Add comment. Pierre Vittet --------------030006070502050701030202 Content-Type: text/plain; name="improve_split_string-175247.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="improve_split_string-175247.diff" Content-length: 850 SW5kZXg6IGdjYy9tZWx0LXJ1bnRpbWUuYwo9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09Ci0tLSBnY2MvbWVsdC1ydW50aW1lLmMJKHJldmlzaW9uIDE3NTI0NykK KysrIGdjYy9tZWx0LXJ1bnRpbWUuYwkod29ya2luZyBjb3B5KQpAQCAtNDYz OCw2ICs0NjM4LDEyIEBAIG1lbHRnY19uZXdfc3BsaXRfc3RyaW5nIChjb25z dCBjaGFyKnN0ciwgaW50IHNlcCwKICAgICB7CiAgICAgICBjdXJzZXAgPSBO VUxMOwogICAgICAgc3RydiA9IE5VTEw7CisgICAgICAvKiBhdm9pZCBlcnJv cnMgd2hlbiB3ZSBoYXZlIHN0ciB3aGljaCBzdGFydHMgd2l0aCB0aGUgc2Vw YXJhdG9yIG9yIHdoZW4KKyAgICAgICAgIHdlIGhhdmUgYSBzZXBhcmF0b3Ig aW1tZWRpYXRseSBmb2xsb3dlZCBieSBhbm90aGVyIG9uZSAobGlrZQorICAg ICAgICAgJ2ZpcnN0OjpzZWNvbmQnKS4KKyAgICAgICovCisgICAgICB3aGls ZSAoKnBjID09IHNlcCkKKyAgICAgICAgcGMrKzsKICAgICAgIGlmIChJU1NQ QUNFIChzZXApKSAKIAkgIGZvciAoY3Vyc2VwPXBjOyAqY3Vyc2VwICYmICFJ U1NQQUNFICgqY3Vyc2VwKTsgY3Vyc2VwKyspOwogICAgICAgZWxzZQo= --------------030006070502050701030202 Content-Type: text/plain; name="comment_split_string-175247.diff" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="comment_split_string-175247.diff" Content-length: 537 SW5kZXg6IGdjYy9tZWx0LXJ1bnRpbWUuYwo9PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09Ci0tLSBnY2MvbWVsdC1ydW50aW1lLmMJKHJldmlzaW9uIDE3NTI0NykK KysrIGdjYy9tZWx0LXJ1bnRpbWUuYwkod29ya2luZyBjb3B5KQpAQCAtNDYw NCw3ICs0NjA0LDggQEAgZW5kOgogI3VuZGVmIHN0cl9zdHJ2CiB9CiAKLQor LyogU3BsaXQgYSBzdHJpbmcgaW50byBhIGxpc3Qgb2Ygc3RyaW5nIHZhbHVl IHVzaW5nIHNlcCBhcyBzZXBhcmF0aW5nIGNoYXJhY3Rlci4KKyovCiBtZWx0 X3B0cl90CiBtZWx0Z2NfbmV3X3NwbGl0X3N0cmluZyAoY29uc3QgY2hhcipz dHIsIGludCBzZXAsIG1lbHRfcHRyX3QgZGlzY3JfcCkKIHsK --------------030006070502050701030202--