From 8f56a469d9384e255c0c65103e30a1ffa8cdc062 Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 10 Jan 2017 01:23:30 +0100 Subject: Doublon not avalible anymore --- todo.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/todo.cpp b/todo.cpp index 23ba269..1a8cab9 100755 --- a/todo.cpp +++ b/todo.cpp @@ -154,8 +154,14 @@ int main(int argc, char *argv[]) { if( sargv == "" ) { cout << "Chaine vide" << endl; break; - } else + } else { + for ( int i = listTodo.size()-1; i >= 0 ; --i) + if( listTodo.at(i).str == sargv ) { + cerr << "Erreur doublon" << endl; + break; + } listTodo.push_back(todoFromCmd(sargv)); + } break; } -- cgit v1.2.3