Fossil SCM
merged main trunk
Commit
7766e689926c703a9764ab0bc86ccbdaa8977d5d
Parent
ff3b6b323b61918…
8 files changed
+8
-8
+8
-8
+7
-2
+7
-2
+7
-2
+12
-3
+12
-3
+12
-3
+8
-8
| --- src/makeheaders.c | ||
| +++ src/makeheaders.c | ||
| @@ -2144,11 +2144,11 @@ | ||
| 2144 | 2144 | zArg = &zCmd[2]; |
| 2145 | 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | 2146 | zArg++; |
| 2147 | 2147 | } |
| 2148 | 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2149 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2150 | 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | ||
| 2163 | 2163 | zArg = &zCmd[5]; |
| 2164 | 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | 2165 | zArg++; |
| 2166 | 2166 | } |
| 2167 | 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2168 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2169 | 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | 2171 | /* |
| 2172 | 2172 | ** Push an #ifndef. |
| 2173 | 2173 | */ |
| @@ -2174,11 +2174,11 @@ | ||
| 2174 | 2174 | zArg = &zCmd[6]; |
| 2175 | 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | 2176 | zArg++; |
| 2177 | 2177 | } |
| 2178 | 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2179 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2180 | 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | 2182 | /* |
| 2183 | 2183 | ** Invert the #if on the top of the stack |
| 2184 | 2184 | */ |
| @@ -2800,11 +2800,11 @@ | ||
| 2800 | 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | 2802 | fprintf(stderr, |
| 2803 | 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | - pFile->zHdr, strlen(pFile->zHdr), ""); | |
| 2805 | + pFile->zHdr, (int)strlen(pFile->zHdr), ""); | |
| 2806 | 2806 | nErr++; |
| 2807 | 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | ||
| 2955 | 2955 | if( nLabel==0 ) continue; |
| 2956 | 2956 | zLabel[nLabel] = 0; |
| 2957 | 2957 | InsertExtraDecl(pDecl); |
| 2958 | 2958 | zDecl = pDecl->zDecl; |
| 2959 | 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | - printf("%s %s %s %d %d %d %d %d %d\n", | |
| 2960 | + printf("%s %s %s %p %d %d %d %d %d\n", | |
| 2961 | 2961 | pDecl->zName, |
| 2962 | 2962 | zLabel, |
| 2963 | 2963 | pDecl->zFile, |
| 2964 | - pDecl->pComment ? (int)pDecl->pComment/sizeof(Token) : 0, | |
| 2964 | + pDecl->pComment, | |
| 2965 | 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | - pDecl->zIf ? strlen(pDecl->zIf)+1 : 0, | |
| 2967 | - zDecl ? strlen(zDecl) : 0, | |
| 2966 | + pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, | |
| 2967 | + zDecl ? (int)strlen(zDecl) : 0, | |
| 2968 | 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | 2970 | ); |
| 2971 | 2971 | if( pDecl->pComment ){ |
| 2972 | 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 | 2973 |
| --- src/makeheaders.c | |
| +++ src/makeheaders.c | |
| @@ -2144,11 +2144,11 @@ | |
| 2144 | zArg = &zCmd[2]; |
| 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | zArg++; |
| 2147 | } |
| 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | |
| 2163 | zArg = &zCmd[5]; |
| 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | zArg++; |
| 2166 | } |
| 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | /* |
| 2172 | ** Push an #ifndef. |
| 2173 | */ |
| @@ -2174,11 +2174,11 @@ | |
| 2174 | zArg = &zCmd[6]; |
| 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | zArg++; |
| 2177 | } |
| 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | /* |
| 2183 | ** Invert the #if on the top of the stack |
| 2184 | */ |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | fprintf(stderr, |
| 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | pFile->zHdr, strlen(pFile->zHdr), ""); |
| 2806 | nErr++; |
| 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | |
| 2955 | if( nLabel==0 ) continue; |
| 2956 | zLabel[nLabel] = 0; |
| 2957 | InsertExtraDecl(pDecl); |
| 2958 | zDecl = pDecl->zDecl; |
| 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | printf("%s %s %s %d %d %d %d %d %d\n", |
| 2961 | pDecl->zName, |
| 2962 | zLabel, |
| 2963 | pDecl->zFile, |
| 2964 | pDecl->pComment ? (int)pDecl->pComment/sizeof(Token) : 0, |
| 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | pDecl->zIf ? strlen(pDecl->zIf)+1 : 0, |
| 2967 | zDecl ? strlen(zDecl) : 0, |
| 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | ); |
| 2971 | if( pDecl->pComment ){ |
| 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 |
| --- src/makeheaders.c | |
| +++ src/makeheaders.c | |
| @@ -2144,11 +2144,11 @@ | |
| 2144 | zArg = &zCmd[2]; |
| 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | zArg++; |
| 2147 | } |
| 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | |
| 2163 | zArg = &zCmd[5]; |
| 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | zArg++; |
| 2166 | } |
| 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | /* |
| 2172 | ** Push an #ifndef. |
| 2173 | */ |
| @@ -2174,11 +2174,11 @@ | |
| 2174 | zArg = &zCmd[6]; |
| 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | zArg++; |
| 2177 | } |
| 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | /* |
| 2183 | ** Invert the #if on the top of the stack |
| 2184 | */ |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | fprintf(stderr, |
| 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | pFile->zHdr, (int)strlen(pFile->zHdr), ""); |
| 2806 | nErr++; |
| 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | |
| 2955 | if( nLabel==0 ) continue; |
| 2956 | zLabel[nLabel] = 0; |
| 2957 | InsertExtraDecl(pDecl); |
| 2958 | zDecl = pDecl->zDecl; |
| 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | printf("%s %s %s %p %d %d %d %d %d\n", |
| 2961 | pDecl->zName, |
| 2962 | zLabel, |
| 2963 | pDecl->zFile, |
| 2964 | pDecl->pComment, |
| 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, |
| 2967 | zDecl ? (int)strlen(zDecl) : 0, |
| 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | ); |
| 2971 | if( pDecl->pComment ){ |
| 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 |
+8
-8
| --- src/makeheaders.c | ||
| +++ src/makeheaders.c | ||
| @@ -2144,11 +2144,11 @@ | ||
| 2144 | 2144 | zArg = &zCmd[2]; |
| 2145 | 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | 2146 | zArg++; |
| 2147 | 2147 | } |
| 2148 | 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2149 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2150 | 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | ||
| 2163 | 2163 | zArg = &zCmd[5]; |
| 2164 | 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | 2165 | zArg++; |
| 2166 | 2166 | } |
| 2167 | 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2168 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2169 | 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | 2171 | /* |
| 2172 | 2172 | ** Push an #ifndef. |
| 2173 | 2173 | */ |
| @@ -2174,11 +2174,11 @@ | ||
| 2174 | 2174 | zArg = &zCmd[6]; |
| 2175 | 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | 2176 | zArg++; |
| 2177 | 2177 | } |
| 2178 | 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | - nArg = pToken->nText + (int)pToken->zText - (int)zArg; | |
| 2179 | + nArg = pToken->nText + (int)(pToken->zText - zArg); | |
| 2180 | 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | 2182 | /* |
| 2183 | 2183 | ** Invert the #if on the top of the stack |
| 2184 | 2184 | */ |
| @@ -2800,11 +2800,11 @@ | ||
| 2800 | 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | 2802 | fprintf(stderr, |
| 2803 | 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | - pFile->zHdr, strlen(pFile->zHdr), ""); | |
| 2805 | + pFile->zHdr, (int)strlen(pFile->zHdr), ""); | |
| 2806 | 2806 | nErr++; |
| 2807 | 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | ||
| 2955 | 2955 | if( nLabel==0 ) continue; |
| 2956 | 2956 | zLabel[nLabel] = 0; |
| 2957 | 2957 | InsertExtraDecl(pDecl); |
| 2958 | 2958 | zDecl = pDecl->zDecl; |
| 2959 | 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | - printf("%s %s %s %d %d %d %d %d %d\n", | |
| 2960 | + printf("%s %s %s %p %d %d %d %d %d\n", | |
| 2961 | 2961 | pDecl->zName, |
| 2962 | 2962 | zLabel, |
| 2963 | 2963 | pDecl->zFile, |
| 2964 | - pDecl->pComment ? (int)pDecl->pComment/sizeof(Token) : 0, | |
| 2964 | + pDecl->pComment, | |
| 2965 | 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | - pDecl->zIf ? strlen(pDecl->zIf)+1 : 0, | |
| 2967 | - zDecl ? strlen(zDecl) : 0, | |
| 2966 | + pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, | |
| 2967 | + zDecl ? (int)strlen(zDecl) : 0, | |
| 2968 | 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | 2970 | ); |
| 2971 | 2971 | if( pDecl->pComment ){ |
| 2972 | 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 | 2973 |
| --- src/makeheaders.c | |
| +++ src/makeheaders.c | |
| @@ -2144,11 +2144,11 @@ | |
| 2144 | zArg = &zCmd[2]; |
| 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | zArg++; |
| 2147 | } |
| 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | |
| 2163 | zArg = &zCmd[5]; |
| 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | zArg++; |
| 2166 | } |
| 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | /* |
| 2172 | ** Push an #ifndef. |
| 2173 | */ |
| @@ -2174,11 +2174,11 @@ | |
| 2174 | zArg = &zCmd[6]; |
| 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | zArg++; |
| 2177 | } |
| 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | nArg = pToken->nText + (int)pToken->zText - (int)zArg; |
| 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | /* |
| 2183 | ** Invert the #if on the top of the stack |
| 2184 | */ |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | fprintf(stderr, |
| 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | pFile->zHdr, strlen(pFile->zHdr), ""); |
| 2806 | nErr++; |
| 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | |
| 2955 | if( nLabel==0 ) continue; |
| 2956 | zLabel[nLabel] = 0; |
| 2957 | InsertExtraDecl(pDecl); |
| 2958 | zDecl = pDecl->zDecl; |
| 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | printf("%s %s %s %d %d %d %d %d %d\n", |
| 2961 | pDecl->zName, |
| 2962 | zLabel, |
| 2963 | pDecl->zFile, |
| 2964 | pDecl->pComment ? (int)pDecl->pComment/sizeof(Token) : 0, |
| 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | pDecl->zIf ? strlen(pDecl->zIf)+1 : 0, |
| 2967 | zDecl ? strlen(zDecl) : 0, |
| 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | ); |
| 2971 | if( pDecl->pComment ){ |
| 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 |
| --- src/makeheaders.c | |
| +++ src/makeheaders.c | |
| @@ -2144,11 +2144,11 @@ | |
| 2144 | zArg = &zCmd[2]; |
| 2145 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2146 | zArg++; |
| 2147 | } |
| 2148 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2149 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2150 | if( nArg==9 && strncmp(zArg,"INTERFACE",9)==0 ){ |
| 2151 | PushIfMacro(0,0,0,pToken->nLine,PS_Interface); |
| 2152 | }else if( nArg==16 && strncmp(zArg,"EXPORT_INTERFACE",16)==0 ){ |
| 2153 | PushIfMacro(0,0,0,pToken->nLine,PS_Export); |
| 2154 | }else if( nArg==15 && strncmp(zArg,"LOCAL_INTERFACE",15)==0 ){ |
| @@ -2163,11 +2163,11 @@ | |
| 2163 | zArg = &zCmd[5]; |
| 2164 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2165 | zArg++; |
| 2166 | } |
| 2167 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2168 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2169 | PushIfMacro("defined",zArg,nArg,pToken->nLine,0); |
| 2170 | }else if( nCmd==6 && strncmp(zCmd,"ifndef",6)==0 ){ |
| 2171 | /* |
| 2172 | ** Push an #ifndef. |
| 2173 | */ |
| @@ -2174,11 +2174,11 @@ | |
| 2174 | zArg = &zCmd[6]; |
| 2175 | while( *zArg && isspace(*zArg) && *zArg!='\n' ){ |
| 2176 | zArg++; |
| 2177 | } |
| 2178 | if( *zArg==0 || *zArg=='\n' ){ return 0; } |
| 2179 | nArg = pToken->nText + (int)(pToken->zText - zArg); |
| 2180 | PushIfMacro("!defined",zArg,nArg,pToken->nLine,0); |
| 2181 | }else if( nCmd==4 && strncmp(zCmd,"else",4)==0 ){ |
| 2182 | /* |
| 2183 | ** Invert the #if on the top of the stack |
| 2184 | */ |
| @@ -2800,11 +2800,11 @@ | |
| 2800 | }else if( strncmp(zOldVersion,zTopLine,nTopLine)!=0 ){ |
| 2801 | if( report ) fprintf(report,"error!\n"); |
| 2802 | fprintf(stderr, |
| 2803 | "%s: Can't overwrite this file because it wasn't previously\n" |
| 2804 | "%*s generated by 'makeheaders'.\n", |
| 2805 | pFile->zHdr, (int)strlen(pFile->zHdr), ""); |
| 2806 | nErr++; |
| 2807 | }else if( strcmp(zOldVersion,zNewVersion)!=0 ){ |
| 2808 | if( report ) fprintf(report,"updated\n"); |
| 2809 | if( WriteFile(pFile->zHdr,zNewVersion) ){ |
| 2810 | fprintf(stderr,"%s: Can't write to file\n",pFile->zHdr); |
| @@ -2955,18 +2955,18 @@ | |
| 2955 | if( nLabel==0 ) continue; |
| 2956 | zLabel[nLabel] = 0; |
| 2957 | InsertExtraDecl(pDecl); |
| 2958 | zDecl = pDecl->zDecl; |
| 2959 | if( zDecl==0 ) zDecl = pDecl->zFwd; |
| 2960 | printf("%s %s %s %p %d %d %d %d %d\n", |
| 2961 | pDecl->zName, |
| 2962 | zLabel, |
| 2963 | pDecl->zFile, |
| 2964 | pDecl->pComment, |
| 2965 | pDecl->pComment ? pDecl->pComment->nText+1 : 0, |
| 2966 | pDecl->zIf ? (int)strlen(pDecl->zIf)+1 : 0, |
| 2967 | zDecl ? (int)strlen(zDecl) : 0, |
| 2968 | pDecl->pComment ? pDecl->pComment->nLine : 0, |
| 2969 | pDecl->tokenCode.nText ? pDecl->tokenCode.nText+1 : 0 |
| 2970 | ); |
| 2971 | if( pDecl->pComment ){ |
| 2972 | printf("%.*s\n",pDecl->pComment->nText, pDecl->pComment->zText); |
| 2973 |
+7
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -346,12 +346,17 @@ | ||
| 346 | 346 | if( cnt==0 ){ |
| 347 | 347 | @ <hr><h2>Attachments:</h2> |
| 348 | 348 | @ <ul> |
| 349 | 349 | } |
| 350 | 350 | cnt++; |
| 351 | - @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> | |
| 352 | - @ %h(zFile)</a> add by %h(zUser) on | |
| 351 | + if( g.okRead && g.okHistory ){ | |
| 352 | + @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> | |
| 353 | + @ %h(zFile)</a> | |
| 354 | + }else{ | |
| 355 | + @ %h(zFile) | |
| 356 | + } | |
| 357 | + @ added by %h(zUser) on | |
| 353 | 358 | hyperlink_to_date(zDate, "."); |
| 354 | 359 | if( g.okWrTkt && g.okAttach ){ |
| 355 | 360 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 356 | 361 | } |
| 357 | 362 | } |
| 358 | 363 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -346,12 +346,17 @@ | |
| 346 | if( cnt==0 ){ |
| 347 | @ <hr><h2>Attachments:</h2> |
| 348 | @ <ul> |
| 349 | } |
| 350 | cnt++; |
| 351 | @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> |
| 352 | @ %h(zFile)</a> add by %h(zUser) on |
| 353 | hyperlink_to_date(zDate, "."); |
| 354 | if( g.okWrTkt && g.okAttach ){ |
| 355 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 356 | } |
| 357 | } |
| 358 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -346,12 +346,17 @@ | |
| 346 | if( cnt==0 ){ |
| 347 | @ <hr><h2>Attachments:</h2> |
| 348 | @ <ul> |
| 349 | } |
| 350 | cnt++; |
| 351 | if( g.okRead && g.okHistory ){ |
| 352 | @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> |
| 353 | @ %h(zFile)</a> |
| 354 | }else{ |
| 355 | @ %h(zFile) |
| 356 | } |
| 357 | @ added by %h(zUser) on |
| 358 | hyperlink_to_date(zDate, "."); |
| 359 | if( g.okWrTkt && g.okAttach ){ |
| 360 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 361 | } |
| 362 | } |
| 363 |
+7
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -346,12 +346,17 @@ | ||
| 346 | 346 | if( cnt==0 ){ |
| 347 | 347 | @ <hr><h2>Attachments:</h2> |
| 348 | 348 | @ <ul> |
| 349 | 349 | } |
| 350 | 350 | cnt++; |
| 351 | - @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> | |
| 352 | - @ %h(zFile)</a> add by %h(zUser) on | |
| 351 | + if( g.okRead && g.okHistory ){ | |
| 352 | + @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> | |
| 353 | + @ %h(zFile)</a> | |
| 354 | + }else{ | |
| 355 | + @ %h(zFile) | |
| 356 | + } | |
| 357 | + @ added by %h(zUser) on | |
| 353 | 358 | hyperlink_to_date(zDate, "."); |
| 354 | 359 | if( g.okWrTkt && g.okAttach ){ |
| 355 | 360 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 356 | 361 | } |
| 357 | 362 | } |
| 358 | 363 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -346,12 +346,17 @@ | |
| 346 | if( cnt==0 ){ |
| 347 | @ <hr><h2>Attachments:</h2> |
| 348 | @ <ul> |
| 349 | } |
| 350 | cnt++; |
| 351 | @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> |
| 352 | @ %h(zFile)</a> add by %h(zUser) on |
| 353 | hyperlink_to_date(zDate, "."); |
| 354 | if( g.okWrTkt && g.okAttach ){ |
| 355 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 356 | } |
| 357 | } |
| 358 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -346,12 +346,17 @@ | |
| 346 | if( cnt==0 ){ |
| 347 | @ <hr><h2>Attachments:</h2> |
| 348 | @ <ul> |
| 349 | } |
| 350 | cnt++; |
| 351 | if( g.okRead && g.okHistory ){ |
| 352 | @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> |
| 353 | @ %h(zFile)</a> |
| 354 | }else{ |
| 355 | @ %h(zFile) |
| 356 | } |
| 357 | @ added by %h(zUser) on |
| 358 | hyperlink_to_date(zDate, "."); |
| 359 | if( g.okWrTkt && g.okAttach ){ |
| 360 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 361 | } |
| 362 | } |
| 363 |
+7
-2
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -346,12 +346,17 @@ | ||
| 346 | 346 | if( cnt==0 ){ |
| 347 | 347 | @ <hr><h2>Attachments:</h2> |
| 348 | 348 | @ <ul> |
| 349 | 349 | } |
| 350 | 350 | cnt++; |
| 351 | - @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> | |
| 352 | - @ %h(zFile)</a> add by %h(zUser) on | |
| 351 | + if( g.okRead && g.okHistory ){ | |
| 352 | + @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> | |
| 353 | + @ %h(zFile)</a> | |
| 354 | + }else{ | |
| 355 | + @ %h(zFile) | |
| 356 | + } | |
| 357 | + @ added by %h(zUser) on | |
| 353 | 358 | hyperlink_to_date(zDate, "."); |
| 354 | 359 | if( g.okWrTkt && g.okAttach ){ |
| 355 | 360 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 356 | 361 | } |
| 357 | 362 | } |
| 358 | 363 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -346,12 +346,17 @@ | |
| 346 | if( cnt==0 ){ |
| 347 | @ <hr><h2>Attachments:</h2> |
| 348 | @ <ul> |
| 349 | } |
| 350 | cnt++; |
| 351 | @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> |
| 352 | @ %h(zFile)</a> add by %h(zUser) on |
| 353 | hyperlink_to_date(zDate, "."); |
| 354 | if( g.okWrTkt && g.okAttach ){ |
| 355 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 356 | } |
| 357 | } |
| 358 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -346,12 +346,17 @@ | |
| 346 | if( cnt==0 ){ |
| 347 | @ <hr><h2>Attachments:</h2> |
| 348 | @ <ul> |
| 349 | } |
| 350 | cnt++; |
| 351 | if( g.okRead && g.okHistory ){ |
| 352 | @ <li><a href="%s(g.zTop)/attachview?tkt=%s(zFullName)&file=%t(zFile)"> |
| 353 | @ %h(zFile)</a> |
| 354 | }else{ |
| 355 | @ %h(zFile) |
| 356 | } |
| 357 | @ added by %h(zUser) on |
| 358 | hyperlink_to_date(zDate, "."); |
| 359 | if( g.okWrTkt && g.okAttach ){ |
| 360 | @ [<a href="%s(g.zTop)/attachdelete?tkt=%s(zFullName)&file=%t(zFile)&from=%s(g.zTop)/tktview%%3fname=%s(zFullName)">delete</a>] |
| 361 | } |
| 362 | } |
| 363 |
+12
-3
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -79,14 +79,22 @@ | ||
| 79 | 79 | ** WEBPAGE: index |
| 80 | 80 | ** WEBPAGE: not_found |
| 81 | 81 | */ |
| 82 | 82 | void home_page(void){ |
| 83 | 83 | char *zPageName = db_get("project-name",0); |
| 84 | + char *zIndexPage = db_get("index-page",0); | |
| 84 | 85 | login_check_credentials(); |
| 85 | 86 | if( !g.okRdWiki ){ |
| 86 | 87 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 87 | 88 | } |
| 89 | + if( zIndexPage ){ | |
| 90 | + while( zIndexPage[0]=='/' ) zIndexPage++; | |
| 91 | + if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0; | |
| 92 | + } | |
| 93 | + if( zIndexPage ){ | |
| 94 | + cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage); | |
| 95 | + } | |
| 88 | 96 | if( zPageName ){ |
| 89 | 97 | login_check_credentials(); |
| 90 | 98 | g.zExtra = zPageName; |
| 91 | 99 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 92 | 100 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | ||
| 218 | 226 | if( cnt==0 ){ |
| 219 | 227 | @ <hr><h2>Attachments:</h2> |
| 220 | 228 | @ <ul> |
| 221 | 229 | } |
| 222 | 230 | cnt++; |
| 223 | - if( g.okHistory ){ | |
| 231 | + if( g.okHistory && g.okRead ){ | |
| 224 | 232 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 233 | + @ %h(zFile)</a> | |
| 225 | 234 | }else{ |
| 226 | - @ <li> | |
| 235 | + @ <li>%h(zFile) | |
| 227 | 236 | } |
| 228 | - @ %h(zFile)</a> add by %h(zUser) on | |
| 237 | + @ added by %h(zUser) on | |
| 229 | 238 | hyperlink_to_date(zDate, "."); |
| 230 | 239 | if( g.okWrWiki && g.okAttach ){ |
| 231 | 240 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 232 | 241 | } |
| 233 | 242 | } |
| 234 | 243 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -79,14 +79,22 @@ | |
| 79 | ** WEBPAGE: index |
| 80 | ** WEBPAGE: not_found |
| 81 | */ |
| 82 | void home_page(void){ |
| 83 | char *zPageName = db_get("project-name",0); |
| 84 | login_check_credentials(); |
| 85 | if( !g.okRdWiki ){ |
| 86 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 87 | } |
| 88 | if( zPageName ){ |
| 89 | login_check_credentials(); |
| 90 | g.zExtra = zPageName; |
| 91 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 92 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | |
| 218 | if( cnt==0 ){ |
| 219 | @ <hr><h2>Attachments:</h2> |
| 220 | @ <ul> |
| 221 | } |
| 222 | cnt++; |
| 223 | if( g.okHistory ){ |
| 224 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 225 | }else{ |
| 226 | @ <li> |
| 227 | } |
| 228 | @ %h(zFile)</a> add by %h(zUser) on |
| 229 | hyperlink_to_date(zDate, "."); |
| 230 | if( g.okWrWiki && g.okAttach ){ |
| 231 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 232 | } |
| 233 | } |
| 234 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -79,14 +79,22 @@ | |
| 79 | ** WEBPAGE: index |
| 80 | ** WEBPAGE: not_found |
| 81 | */ |
| 82 | void home_page(void){ |
| 83 | char *zPageName = db_get("project-name",0); |
| 84 | char *zIndexPage = db_get("index-page",0); |
| 85 | login_check_credentials(); |
| 86 | if( !g.okRdWiki ){ |
| 87 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 88 | } |
| 89 | if( zIndexPage ){ |
| 90 | while( zIndexPage[0]=='/' ) zIndexPage++; |
| 91 | if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0; |
| 92 | } |
| 93 | if( zIndexPage ){ |
| 94 | cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage); |
| 95 | } |
| 96 | if( zPageName ){ |
| 97 | login_check_credentials(); |
| 98 | g.zExtra = zPageName; |
| 99 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 100 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | |
| 226 | if( cnt==0 ){ |
| 227 | @ <hr><h2>Attachments:</h2> |
| 228 | @ <ul> |
| 229 | } |
| 230 | cnt++; |
| 231 | if( g.okHistory && g.okRead ){ |
| 232 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 233 | @ %h(zFile)</a> |
| 234 | }else{ |
| 235 | @ <li>%h(zFile) |
| 236 | } |
| 237 | @ added by %h(zUser) on |
| 238 | hyperlink_to_date(zDate, "."); |
| 239 | if( g.okWrWiki && g.okAttach ){ |
| 240 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 241 | } |
| 242 | } |
| 243 |
+12
-3
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -79,14 +79,22 @@ | ||
| 79 | 79 | ** WEBPAGE: index |
| 80 | 80 | ** WEBPAGE: not_found |
| 81 | 81 | */ |
| 82 | 82 | void home_page(void){ |
| 83 | 83 | char *zPageName = db_get("project-name",0); |
| 84 | + char *zIndexPage = db_get("index-page",0); | |
| 84 | 85 | login_check_credentials(); |
| 85 | 86 | if( !g.okRdWiki ){ |
| 86 | 87 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 87 | 88 | } |
| 89 | + if( zIndexPage ){ | |
| 90 | + while( zIndexPage[0]=='/' ) zIndexPage++; | |
| 91 | + if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0; | |
| 92 | + } | |
| 93 | + if( zIndexPage ){ | |
| 94 | + cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage); | |
| 95 | + } | |
| 88 | 96 | if( zPageName ){ |
| 89 | 97 | login_check_credentials(); |
| 90 | 98 | g.zExtra = zPageName; |
| 91 | 99 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 92 | 100 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | ||
| 218 | 226 | if( cnt==0 ){ |
| 219 | 227 | @ <hr><h2>Attachments:</h2> |
| 220 | 228 | @ <ul> |
| 221 | 229 | } |
| 222 | 230 | cnt++; |
| 223 | - if( g.okHistory ){ | |
| 231 | + if( g.okHistory && g.okRead ){ | |
| 224 | 232 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 233 | + @ %h(zFile)</a> | |
| 225 | 234 | }else{ |
| 226 | - @ <li> | |
| 235 | + @ <li>%h(zFile) | |
| 227 | 236 | } |
| 228 | - @ %h(zFile)</a> add by %h(zUser) on | |
| 237 | + @ added by %h(zUser) on | |
| 229 | 238 | hyperlink_to_date(zDate, "."); |
| 230 | 239 | if( g.okWrWiki && g.okAttach ){ |
| 231 | 240 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 232 | 241 | } |
| 233 | 242 | } |
| 234 | 243 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -79,14 +79,22 @@ | |
| 79 | ** WEBPAGE: index |
| 80 | ** WEBPAGE: not_found |
| 81 | */ |
| 82 | void home_page(void){ |
| 83 | char *zPageName = db_get("project-name",0); |
| 84 | login_check_credentials(); |
| 85 | if( !g.okRdWiki ){ |
| 86 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 87 | } |
| 88 | if( zPageName ){ |
| 89 | login_check_credentials(); |
| 90 | g.zExtra = zPageName; |
| 91 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 92 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | |
| 218 | if( cnt==0 ){ |
| 219 | @ <hr><h2>Attachments:</h2> |
| 220 | @ <ul> |
| 221 | } |
| 222 | cnt++; |
| 223 | if( g.okHistory ){ |
| 224 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 225 | }else{ |
| 226 | @ <li> |
| 227 | } |
| 228 | @ %h(zFile)</a> add by %h(zUser) on |
| 229 | hyperlink_to_date(zDate, "."); |
| 230 | if( g.okWrWiki && g.okAttach ){ |
| 231 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 232 | } |
| 233 | } |
| 234 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -79,14 +79,22 @@ | |
| 79 | ** WEBPAGE: index |
| 80 | ** WEBPAGE: not_found |
| 81 | */ |
| 82 | void home_page(void){ |
| 83 | char *zPageName = db_get("project-name",0); |
| 84 | char *zIndexPage = db_get("index-page",0); |
| 85 | login_check_credentials(); |
| 86 | if( !g.okRdWiki ){ |
| 87 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 88 | } |
| 89 | if( zIndexPage ){ |
| 90 | while( zIndexPage[0]=='/' ) zIndexPage++; |
| 91 | if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0; |
| 92 | } |
| 93 | if( zIndexPage ){ |
| 94 | cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage); |
| 95 | } |
| 96 | if( zPageName ){ |
| 97 | login_check_credentials(); |
| 98 | g.zExtra = zPageName; |
| 99 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 100 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | |
| 226 | if( cnt==0 ){ |
| 227 | @ <hr><h2>Attachments:</h2> |
| 228 | @ <ul> |
| 229 | } |
| 230 | cnt++; |
| 231 | if( g.okHistory && g.okRead ){ |
| 232 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 233 | @ %h(zFile)</a> |
| 234 | }else{ |
| 235 | @ <li>%h(zFile) |
| 236 | } |
| 237 | @ added by %h(zUser) on |
| 238 | hyperlink_to_date(zDate, "."); |
| 239 | if( g.okWrWiki && g.okAttach ){ |
| 240 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 241 | } |
| 242 | } |
| 243 |
+12
-3
| --- src/wiki.c | ||
| +++ src/wiki.c | ||
| @@ -79,14 +79,22 @@ | ||
| 79 | 79 | ** WEBPAGE: index |
| 80 | 80 | ** WEBPAGE: not_found |
| 81 | 81 | */ |
| 82 | 82 | void home_page(void){ |
| 83 | 83 | char *zPageName = db_get("project-name",0); |
| 84 | + char *zIndexPage = db_get("index-page",0); | |
| 84 | 85 | login_check_credentials(); |
| 85 | 86 | if( !g.okRdWiki ){ |
| 86 | 87 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 87 | 88 | } |
| 89 | + if( zIndexPage ){ | |
| 90 | + while( zIndexPage[0]=='/' ) zIndexPage++; | |
| 91 | + if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0; | |
| 92 | + } | |
| 93 | + if( zIndexPage ){ | |
| 94 | + cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage); | |
| 95 | + } | |
| 88 | 96 | if( zPageName ){ |
| 89 | 97 | login_check_credentials(); |
| 90 | 98 | g.zExtra = zPageName; |
| 91 | 99 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 92 | 100 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | ||
| 218 | 226 | if( cnt==0 ){ |
| 219 | 227 | @ <hr><h2>Attachments:</h2> |
| 220 | 228 | @ <ul> |
| 221 | 229 | } |
| 222 | 230 | cnt++; |
| 223 | - if( g.okHistory ){ | |
| 231 | + if( g.okHistory && g.okRead ){ | |
| 224 | 232 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 233 | + @ %h(zFile)</a> | |
| 225 | 234 | }else{ |
| 226 | - @ <li> | |
| 235 | + @ <li>%h(zFile) | |
| 227 | 236 | } |
| 228 | - @ %h(zFile)</a> add by %h(zUser) on | |
| 237 | + @ added by %h(zUser) on | |
| 229 | 238 | hyperlink_to_date(zDate, "."); |
| 230 | 239 | if( g.okWrWiki && g.okAttach ){ |
| 231 | 240 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 232 | 241 | } |
| 233 | 242 | } |
| 234 | 243 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -79,14 +79,22 @@ | |
| 79 | ** WEBPAGE: index |
| 80 | ** WEBPAGE: not_found |
| 81 | */ |
| 82 | void home_page(void){ |
| 83 | char *zPageName = db_get("project-name",0); |
| 84 | login_check_credentials(); |
| 85 | if( !g.okRdWiki ){ |
| 86 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 87 | } |
| 88 | if( zPageName ){ |
| 89 | login_check_credentials(); |
| 90 | g.zExtra = zPageName; |
| 91 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 92 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | |
| 218 | if( cnt==0 ){ |
| 219 | @ <hr><h2>Attachments:</h2> |
| 220 | @ <ul> |
| 221 | } |
| 222 | cnt++; |
| 223 | if( g.okHistory ){ |
| 224 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 225 | }else{ |
| 226 | @ <li> |
| 227 | } |
| 228 | @ %h(zFile)</a> add by %h(zUser) on |
| 229 | hyperlink_to_date(zDate, "."); |
| 230 | if( g.okWrWiki && g.okAttach ){ |
| 231 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 232 | } |
| 233 | } |
| 234 |
| --- src/wiki.c | |
| +++ src/wiki.c | |
| @@ -79,14 +79,22 @@ | |
| 79 | ** WEBPAGE: index |
| 80 | ** WEBPAGE: not_found |
| 81 | */ |
| 82 | void home_page(void){ |
| 83 | char *zPageName = db_get("project-name",0); |
| 84 | char *zIndexPage = db_get("index-page",0); |
| 85 | login_check_credentials(); |
| 86 | if( !g.okRdWiki ){ |
| 87 | cgi_redirectf("%s/login?g=%s/home", g.zBaseURL, g.zBaseURL); |
| 88 | } |
| 89 | if( zIndexPage ){ |
| 90 | while( zIndexPage[0]=='/' ) zIndexPage++; |
| 91 | if( strcmp(zIndexPage, P("PATH_INFO"))==0 ) zIndexPage = 0; |
| 92 | } |
| 93 | if( zIndexPage ){ |
| 94 | cgi_redirectf("%s/%s", g.zBaseURL, zIndexPage); |
| 95 | } |
| 96 | if( zPageName ){ |
| 97 | login_check_credentials(); |
| 98 | g.zExtra = zPageName; |
| 99 | cgi_set_parameter_nocopy("name", g.zExtra); |
| 100 | g.isHome = 1; |
| @@ -218,16 +226,17 @@ | |
| 226 | if( cnt==0 ){ |
| 227 | @ <hr><h2>Attachments:</h2> |
| 228 | @ <ul> |
| 229 | } |
| 230 | cnt++; |
| 231 | if( g.okHistory && g.okRead ){ |
| 232 | @ <li><a href="%s(g.zTop)/attachview?page=%s(zPageName)&file=%t(zFile)"> |
| 233 | @ %h(zFile)</a> |
| 234 | }else{ |
| 235 | @ <li>%h(zFile) |
| 236 | } |
| 237 | @ added by %h(zUser) on |
| 238 | hyperlink_to_date(zDate, "."); |
| 239 | if( g.okWrWiki && g.okAttach ){ |
| 240 | @ [<a href="%s(g.zTop)/attachdelete?page=%s(zPageName)&file=%t(zFile)&from=%s(g.zTop)/wiki%%3fname=%s(zPageName)">delete</a>] |
| 241 | } |
| 242 | } |
| 243 |