X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?p=pspp;a=blobdiff_plain;f=src%2Flanguage%2Flexer%2Fsegment.c;h=52ff37a457bc13597a1a2f861911f3e49ef94bd4;hp=0c4a6bd8007201e1ce685d21f229237f9e46b9f9;hb=bc6c656d60d5140ea59eec9484bbd0e245eee890;hpb=76f722cdfd6475f8ae2d98139ea596adfcdb47be diff --git a/src/language/lexer/segment.c b/src/language/lexer/segment.c index 0c4a6bd800..52ff37a457 100644 --- a/src/language/lexer/segment.c +++ b/src/language/lexer/segment.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2010, 2011, 2013 Free Software Foundation, Inc. + Copyright (C) 2010, 2011, 2013, 2016 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -1010,6 +1010,9 @@ segmenter_detect_command_name__ (const char *input, size_t n, int ofs) ofs += mblen; } + if (!ofs) + return 0; + if (input[ofs - 1] == '.') ofs--;