diff options
Diffstat (limited to 'src/docker.c')
-rw-r--r-- | src/docker.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/docker.c b/src/docker.c index d5cffd9..e2a392b 100644 --- a/src/docker.c +++ b/src/docker.c @@ -168,3 +168,15 @@ int docker_capable(struct DockerCapabilities *result) { result->usable = true; return true; } + +void docker_sanitize_tag(char *str) { + char *pos = str; + while (*pos != 0) { + if (!isalnum(*pos)) { + if (*pos != '.' && *pos != ':' && *pos != '/') { + *pos = '-'; + } + } + pos++; + } +} |