Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
fb974709
Commit
fb974709
authored
May 17, 2001
by
Henrik (Grubba) Grubbström
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a few bugs in String.SplitIterator.
Rev: src/iterators.cmod:1.6
parent
fda2e1cb
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/iterators.cmod
+10
-3
10 additions, 3 deletions
src/iterators.cmod
with
10 additions
and
3 deletions
src/iterators.cmod
+
10
−
3
View file @
fb974709
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
\*/
\*/
/**/
/**/
#include "global.h"
#include "global.h"
RCSID("$Id: iterators.cmod,v 1.
5
2001/05/17 1
6:49:22
grubba Exp $");
RCSID("$Id: iterators.cmod,v 1.
6
2001/05/17 1
8:31:18
grubba Exp $");
#include "main.h"
#include "main.h"
#include "object.h"
#include "object.h"
#include "mapping.h"
#include "mapping.h"
...
@@ -465,6 +465,10 @@ PIKECLASS string_split_iterator
...
@@ -465,6 +465,10 @@ PIKECLASS string_split_iterator
}
}
if (offset >= ssi->buffer->len) {
if (offset >= ssi->buffer->len) {
if (ssi->feed.type == T_INT) {
if (ssi->feed.type == T_INT) {
if (!ssi->flags) {
MAKE_CONSTANT_SHARED_STRING(ssi->current, "");
ssi->index++;
}
free_string(ssi->buffer);
free_string(ssi->buffer);
ssi->buffer = NULL;
ssi->buffer = NULL;
ssi->offset = 0;
ssi->offset = 0;
...
@@ -532,6 +536,10 @@ PIKECLASS string_split_iterator
...
@@ -532,6 +536,10 @@ PIKECLASS string_split_iterator
ssi->offset = end+1;
ssi->offset = end+1;
ssi->current = Pike_sp[-1].u.string;
ssi->current = Pike_sp[-1].u.string;
Pike_sp--;
Pike_sp--;
if ((!THIS->flags) && (ssi->offset > ssi->buffer->len)) {
free_string(THIS->buffer);
THIS->buffer = 0;
}
}
}
PIKEFUN string value()
PIKEFUN string value()
...
@@ -668,8 +676,7 @@ PIKECLASS string_split_iterator
...
@@ -668,8 +676,7 @@ PIKECLASS string_split_iterator
fatal("Unsupported size shift!\n");
fatal("Unsupported size shift!\n");
}
}
}
}
off++; /* Skip the end split character. */
if ((!THIS->flags) && (off == THIS->buffer->len-1)) {
if ((!THIS->flags) && (off == THIS->buffer->len)) {
/* Ends with an empty segment. */
/* Ends with an empty segment. */
res++;
res++;
break;
break;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment