]> granicus.if.org Git - apache/commitdiff
Time for these to be gone? I'd say it's long past :)
authorWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 17 Jun 2000 21:06:24 +0000 (21:06 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Sat, 17 Jun 2000 21:06:24 +0000 (21:06 +0000)
PR:
Obtained from:
Submitted by:
Reviewed by:

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@85603 13f79535-47bb-0310-9956-ffa450edef68

os/win32/os.h
os/win32/util_win32.c

index d17e5accdc09fc12a29437f492053127320b4d0a..5090362cb895c8d03b9e5826eafea59cbbe5dde7 100644 (file)
@@ -145,7 +145,6 @@ API_EXPORT(char *) ap_os_canonical_filename(ap_pool_t *p, const char *file);
 API_EXPORT(char *) ap_os_case_canonical_filename(ap_pool_t *pPool, const char *szFile);
 API_EXPORT(char *) ap_os_systemcase_filename(ap_pool_t *pPool, const char *szFile);
 API_EXPORT(int) ap_os_is_filename_valid(const char *file);
-API_EXPORT(int) os_strftime(char *, size_t , const char *, const struct tm *);
 
 #define ap_os_dso_error()   "" /* for now */
 /* Other ap_os_ routines not used by this platform */
index b4c6d8e3c981b780163312f1bff71775e2fc9577..9b6b388da02b39071400c0ee4ed3d948c439e445 100644 (file)
@@ -332,125 +332,6 @@ API_EXPORT(char *) ap_os_canonical_filename(ap_pool_t *pPool, const char *szFile
     return pNewName;
 }
 
-/* Win95 doesn't like trailing /s. NT and Unix don't mind. This works 
- * around the problem.
- * Errr... except if it is UNC and we are referring to the root of 
- * the UNC, we MUST have a trailing \ and we can't use /s. Jeez. 
- * Not sure if this refers to all UNCs or just roots,
- * but I'm going to fix it for all cases for now. (Ben)
- */
-
-#undef stat
-API_EXPORT(int) os_stat(const char *szPath, struct stat *pStat)
-{
-    int n;
-    
-    if (strlen(szPath) == 0) {
-        return -1;
-    }
-
-    if (szPath[0] == '/' && szPath[1] == '/') {
-       char buf[_MAX_PATH];
-       char *s;
-       int nSlashes = 0;
-
-       ap_assert(strlen(szPath) < _MAX_PATH);
-       strcpy(buf, szPath);
-       for (s = buf; *s; ++s) {
-           if (*s == '/') {
-               *s = '\\';
-               ++nSlashes;
-           }
-       }
-       /* then we need to add one more to get \\machine\share\ */
-       if (nSlashes == 3) {
-           *s++ = '\\';
-       }
-       *s = '\0';
-       return stat(buf, pStat);
-    }
-
-    /*
-     * Below removes the trailing /, however, do not remove
-     * it in the case of 'x:/' or stat will fail
-     */
-    n = strlen(szPath);
-    if ((szPath[n - 1] == '\\' || szPath[n - 1] == '/') &&
-        !(n == 3 && szPath[1] == ':')) {
-        char buf[_MAX_PATH];
-        
-        ap_assert(n < _MAX_PATH);
-        strcpy(buf, szPath);
-        buf[n - 1] = '\0';
-        
-        return stat(buf, pStat);
-    }
-    return stat(szPath, pStat);
-}
-
-
-#undef strftime
-
-/* Partial replacement for strftime. This adds certain expandos to the
- * Windows version
- */
-
-API_EXPORT(int) os_strftime(char *s, size_t max, const char *format,
-                            const struct tm *tm) {
-   /* If the new format string is bigger than max, the result string probably
-    * won't fit anyway. When %-expandos are added, made sure the padding below
-    * is enough.
-    */
-    char *new_format = (char *) _alloca(max + 11);
-    size_t i, j, format_length = strlen(format);
-    int return_value;
-    int length_written;
-
-    for (i = 0, j = 0; (i < format_length && j < max);) {
-        if (format[i] != '%') {
-            new_format[j++] = format[i++];
-            continue;
-        }
-        switch (format[i+1]) {
-            case 'D':
-                /* Is this locale dependent? Shouldn't be...
-                   Also note the year 2000 exposure here */
-                memcpy(new_format + j, "%m/%d/%y", 8);
-                i += 2;
-                j += 8;
-                break;
-            case 'r':
-                memcpy(new_format + j, "%I:%M:%S %p", 11);
-                i += 2;
-                j += 11;
-                break;
-            case 'T':
-                memcpy(new_format + j, "%H:%M:%S", 8);
-                i += 2;
-                j += 8;
-                break;
-            case 'e':
-                length_written = ap_snprintf(new_format + j, max - j, "%2d",
-                    tm->tm_mday);
-                j = (length_written == -1) ? max : (j + length_written);
-                i += 2;
-                break;
-            default:
-                /* We know we can advance two characters forward here. */
-                new_format[j++] = format[i++];
-                new_format[j++] = format[i++];
-        }
-    }
-    if (j >= max) {
-        *s = '\0';  /* Defensive programming, okay since output is undefined */
-        return_value = 0;
-    } else {
-        new_format[j] = '\0';
-        return_value = strftime(s, max, new_format, tm);
-    }
-    return return_value;
-}
-
 /*
  * ap_os_is_filename_valid is given a filename, and returns 0 if the filename
  * is not valid for use on this system. On Windows, this means it fails any