From 906d9cc83b2094f1c9e33c0b1a186de381741692 Mon Sep 17 00:00:00 2001 From: usa Date: Tue, 25 Sep 2001 01:47:47 +0000 Subject: [PATCH] * win32/win32.c (isInternalCmd): check return value of NtMakeCmdVector (Tietew 's patch). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1756 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ win32/win32.c | 26 ++++++++++++++------------ 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34933ec745..c087dce9b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Tue Sep 25 10:46:42 2001 Usaku Nakamura + + * win32/win32.c (isInternalCmd): check return value of NtMakeCmdVector + (Tietew 's patch). + Thu Sep 20 21:25:00 2001 Nobuyoshi Nakada * eval.c (MATCH_DATA): access via rb_svar(). diff --git a/win32/win32.c b/win32/win32.c index 52c361d27d..53c7c22467 100644 --- a/win32/win32.c +++ b/win32/win32.c @@ -367,20 +367,22 @@ static char *szInternalCmds[] = { int isInternalCmd(char *cmd) { - int i, fRet=0; - char **vec; - int vecc = NtMakeCmdVector(cmd, &vec, FALSE); + int i, fRet=0; + char **vec; + int vecc = NtMakeCmdVector(cmd, &vec, FALSE); - for( i = 0; szInternalCmds[i] ; i++){ - if(!strcasecmp(szInternalCmds[i], vec[0])){ - fRet = 1; - break; - } - } - - SafeFree (vec, vecc); + if (vecc == 0) + return 0; + for( i = 0; szInternalCmds[i] ; i++){ + if(!strcasecmp(szInternalCmds[i], vec[0])){ + fRet = 1; + break; + } + } - return fRet; + SafeFree(vec, vecc); + + return fRet; }