summaryrefslogtreecommitdiff
path: root/sed
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2008-01-16 14:05:55 +0100
committerPaolo Bonzini <bonzini@gnu.org>2008-01-16 14:54:13 +0100
commit1d66f2f7f681da73be89b9cfc11ed2da6aa11982 (patch)
tree63fefd685e175731e48d0fef119ce490156d0eee /sed
parent0dd01dfb9366db53cf828dfe84252c73f76960c1 (diff)
downloadsed-1d66f2f7f681da73be89b9cfc11ed2da6aa11982.tar.gz
sed/compile.c: Avoid uninitialized variable usage in snarf_char_class
2008-01-16 Jim Meyering <meyering@redhat.com> * sed/compile.c (snarf_char_class): Reverse order of conjuncts so that "delim" is not used uninitialized.
Diffstat (limited to 'sed')
-rw-r--r--sed/compile.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sed/compile.c b/sed/compile.c
index 9c02780..f13cb14 100644
--- a/sed/compile.c
+++ b/sed/compile.c
@@ -1,5 +1,5 @@
/* GNU SED, a batch stream editor.
- Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2004,2005,2006
+ Copyright (C) 1989,90,91,92,93,94,95,98,99,2002,2003,2004,2005,2006,2008
Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
@@ -492,7 +492,7 @@ snarf_char_class(b, cur_stat)
delim = ch;
state++;
}
- else if (ch == delim && state == 2)
+ else if (state == 2 && ch == delim)
state++;
else
break;