diff options
Diffstat (limited to 'src/common/sql.c')
-rw-r--r-- | src/common/sql.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/common/sql.c b/src/common/sql.c index c75b90cec..7f89e9828 100644 --- a/src/common/sql.c +++ b/src/common/sql.c @@ -1004,10 +1004,10 @@ void Sql_HerculesUpdateCheck(Sql* self) { FILE* ifp;/* index fp */ unsigned int performed = 0; StringBuf buf; - + if( self == NULL ) return;/* return silently, build has no mysql connection */ - + if( !( ifp = fopen("sql-files/upgrades/index.txt", "r") ) ) { ShowError("SQL upgrade index was not found!\n"); return; @@ -1055,7 +1055,7 @@ void Sql_HerculesUpdateCheck(Sql* self) { ShowMessage("%s",StrBuf->Value(&buf)); ShowSQL("To manually skip, type: 'sql update skip <file name>'\n"); } - + StrBuf->Destroy(&buf); } @@ -1063,21 +1063,21 @@ void Sql_HerculesUpdateSkip(Sql* self,const char *filename) { char path[41];// "sql-files/upgrades/" (19) + "yyyy-mm-dd--hh-mm" (17) + ".sql" (4) + 1 char timestamp[11];// "1360186680" (10) + 1 FILE* ifp;/* index fp */ - + if( !self ) { ShowError("SQL not hooked!\n"); return; } - + snprintf(path,41,"sql-files/upgrades/%s",filename); - + if( !( ifp = fopen(path, "r") ) ) { ShowError("Upgrade file '%s' was not found!\n",filename); return; } - + fseek (ifp,1,SEEK_SET);/* woo. skip the # */ - + if( fgets(timestamp,sizeof(timestamp),ifp) ) { unsigned int timestampui = (unsigned int)atol(timestamp); if( SQL_ERROR == SQL->Query(self, "SELECT 1 FROM `sql_updates` WHERE `timestamp` = '%u' LIMIT 1", timestampui) ) |