X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Ftapefile.c;h=b4212e5894238b47bc4d49e9801938ba26f4d78e;hb=refs%2Ftags%2Fupstream%2F3.3.0;hp=406a0c426ee6e1d5340b3030799101d6c562b61b;hpb=011a59f5a54864108a16af570a6b287410597cc2;p=debian%2Famanda diff --git a/server-src/tapefile.c b/server-src/tapefile.c index 406a0c4..b4212e5 100644 --- a/server-src/tapefile.c +++ b/server-src/tapefile.c @@ -104,6 +104,8 @@ write_tapelist( else g_fprintf(tapef, " no-reuse"); if (tp->barcode) g_fprintf(tapef, " BARCODE:%s", tp->barcode); + if (tp->meta) + g_fprintf(tapef, " META:%s", tp->meta); if (tp->comment) g_fprintf(tapef, " #%s", tp->comment); g_fprintf(tapef, "\n"); @@ -398,6 +400,7 @@ parse_tapeline( s[-1] = '\0'; skip_whitespace(s, ch); } + if (strncmp_const(s - 1, "BARCODE:") == 0) { s1 = s - 1 + 8; skip_non_whitespace(s, ch); @@ -408,6 +411,15 @@ parse_tapeline( tp->barcode = NULL; } + if (strncmp_const(s - 1, "META:") == 0) { + s1 = s - 1 + 5; + skip_non_whitespace(s, ch); + s[-1] = '\0'; + skip_whitespace(s, ch); + tp->meta = stralloc(s1); + } else { + tp->meta = NULL; + } if (*(s - 1) == '#') { tp->comment = stralloc(s); /* skip leading '#' */